Howde...
I posted this in the Fido echo for Mystic, and got a reply, but noticed
my reply never went out from Necro BBS. So I guess i will ask here.
I am writing a Python script to have new users accept the Acceptable Use Policy for my board, and when I try to have it display the text of the file, nothing happens. Someone suggested it may be scrolling past the screen to fast. I scroll back and nothing is there. I added a pause, nothing. So not sure what I am missing. but, here is the code in hopes someone can see something I don't get.
Any help would be appreciated. Thank you!
Running on the current version of Mystic with Python 2.7 on Linux...
===Begin code===
#################################################
# Acceptable Use Policy Script for Mystic BBS #
# Written by Rich Lawrence, KB2MOB #
# SysOp of Radio Freqs & Geeks BBS #
# Telnet/SSH: rfgeeksbbs.ddns.net # #################################################
from mystic_bbs import *
file = open('aup.txt' , 'r')
for line in file:
writeln(line)
writeln("|PA")
writeln ('|CLTo agree to the AUP, please type in "I AGREE" in the input field.'
writeln ('Typing in anything else besides "I AGREE", is the same as a No respon e')
writeln ('and you will disconnected from the BBS, but able to reapply in the fu ure.')
write ('|CRDo you agree to the Acceptable Use Policy|CRof Radio Freqs & Geeks B S? -> ')
answer = getstr(11 , 7, 7, "I AGREE")
if answer.upper() == "I AGREE":
writeln('Thank You. You will return to the new account setup...|CR|PA') else:
writeln ('|CRYou will now be disconnected from the BBS. You may reapply at anytime.')
writeln ('Press ENTER to disconnect... |PN')
shutdown()
===End code===
Howde...
I posted this in the Fido echo for Mystic, and got a reply, but noticed
my reply never went out from Necro BBS. So I guess i will ask here.
I am writing a Python script to have new users accept the Acceptable Use Policy for my board, and when I try to have it display the text of the file, nothing happens. Someone suggested it may be scrolling past the screen to fast. I scroll back and nothing is there. I added a pause, nothing. So not sure what I am missing. but, here is the code in hopes someone can see something I don't get.
interesting. i dont do python that well i would for me use a mpl for
that. what if they dont accept? what would the python script do after
hang up? is this after they create an account?
interesting. i dont do python that well i would for me use a mpl for
that. what if they dont accept? what would the python script do after
hang up? is this after they create an account?
I don't do Python that well either but for this example I'm really going to try and learn enough to offer an answer... as I think it's also cool that efforts to use Python in Mystic are encouraged. It will also help g00r00 to spotlight things that are more requested functions to be
enabled in Python that are already available in MPL... just a thought :)
g00r00 to spotlight things that are more requested functions to be enabled in Python that are already available in MPL... just a thought
I've been looking for a way to expand my Python skills. I started to
write a CNet Amiga BBS clone, and have a basic framework, but using a external Telnet server. And I want the message bases to be capable of doing fido without any in between, like Mystic does. I have the JAM
docs, but I'm struggling with reading and writing binary files, and the only code I have found that I have been looking at to learn more is in C and it's like reading a foreign language to me. And tutorials I watch on YouTube seem to just make my head swim worse.
interesting. i dont do python that well i would for me use a mpl for that. what if they dont accept? what would the python script do after hang up? is this after they create an account?No, it's before they fill out the new user questions. It prompts after
the AUP is displayed if they want to continue or hang up. If they say
yes, then it just goes into the regular new user workflow.
have a few ideas I want to do that I had planned on baking into my project. Just need to figure out this whole displaying a file. LOL. Not sure why it doens't work.
I'm a n00b at Python, bought a basic how to book earlier this year at
got 65% of the way through it before work/family life took my attention away from it. I like the idea of learning this language and lord know
the Raspberry Pi seems to be built to embrace it. When g00r00 added some BBS functions and the ability to embrace Python I was really happy.
I presume you have checked out the python.txt file in the docs dir? It shows where things are at right now, but I figure when g00r00 does come back be sure to let him know the kind of functions that would make a difference being able to use for the benefit of your project. It would help him (I'm guessing here) to know where he might put his efforts next in that space :)
so ran via startup.mps?
Sysop: | sneaky |
---|---|
Location: | Ashburton,NZ |
Users: | 31 |
Nodes: | 8 (0 / 8) |
Uptime: | 226:43:14 |
Calls: | 2,087 |
Calls today: | 1 |
Files: | 11,140 |
Messages: | 948,455 |