示例#1
0
 def try_add(self, user_input):
     """
     If 'user_input' is an 'add' command invokation, start a
     CharCreationFlow subflow and then return True, otherwise return False.
     """
     output = parse(self.parsers[party.CMD_ADD], user_input)
     if output is None:
         return False
     subflow = charstage.CharCreationFlow(self.io, self.data, self.game)
     mofloc.execute(subflow, charstage.CREATE_NEW)
     self.welcome_back()
     return True
示例#2
0
 def try_edit(self, user_input):
     """
     If 'user_input' is an 'edit' command invokation, edit a specified
     character using CharCreationFlow and then return True, otherwise return
     False.
     """
     output = parse(self.parsers[party.CMD_EDIT], user_input)
     if output is None:
         return False
     if output[Capture.PC] is None:
         self.io.say(
             self.data.strings[cat.PARTY_CREATION][party.NO_SUCH_CHARACTER])
         return True
     subflow = charstage.CharCreationFlow(self.io, self.data, self.game)
     mofloc.execute(subflow, charstage.EDIT_EXISTING, output[Capture.PC])
     self.welcome_back()
     return True
示例#3
0
def main():
    """ Main processing loop. """
    flow = startup.Startup()
    mofloc.execute(flow, startup.ENTRY_POINT, ui.CURSES)
示例#4
0
文件: main.py 项目: mpevnev/toi
#!/usr/bin/python
""" Main module. """

import mofloc

import toi.stage.startup as start

if __name__ == "__main__":
    flow = start.StartupFlow()
    mofloc.execute(flow, start.ENTRY_POINT)
示例#5
0
def main():
    """ Main procedure. """
    mofloc.execute(TopLevel(), START)