36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
|
#@+leo-ver=4-thin
|
||
|
#@+node:jpenner.20090607135901.3:@thin login.py
|
||
|
from basetoken import *
|
||
|
import ansi
|
||
|
|
||
|
class LoginTerm(Terminal):
|
||
|
def run(self):
|
||
|
self.setColBg(ansi.BLUE)
|
||
|
self.newLine(3, 300)
|
||
|
self.type("Logon Please: ")
|
||
|
user = self.getLine()
|
||
|
self.newLine()
|
||
|
self.type("Password: ")
|
||
|
self.chEcho = "*"
|
||
|
passwd = self.getLine()
|
||
|
self.chEcho = None
|
||
|
self.newLine(2, 300)
|
||
|
if self.client.login(user, passwd):
|
||
|
self.typeLn("Welcome to MarMOTS, " + user)
|
||
|
self.typeLn("I see you have driven here in your Ferrari.")
|
||
|
self.typeLn("Logging you in...")
|
||
|
self.wait(250)
|
||
|
self.game.finish(True)
|
||
|
else:
|
||
|
self.setColBg(ansi.RED)
|
||
|
self.typeLn("I am sorry, " + user + ", but you appear to be insufficiently rhinoceros.")
|
||
|
self.typeLn("Please report back after joining the Klik of the Month Klub.")
|
||
|
self.newLine(2,300)
|
||
|
self.setColBg(ansi.BLACK)
|
||
|
self.printSt("NO CARRIER")
|
||
|
self.wait(200)
|
||
|
self.game.finish(False)
|
||
|
#@nonl
|
||
|
#@-node:jpenner.20090607135901.3:@thin login.py
|
||
|
#@-leo
|