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
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
def main(): """ Main processing loop. """ flow = startup.Startup() mofloc.execute(flow, startup.ENTRY_POINT, ui.CURSES)
#!/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)
def main(): """ Main procedure. """ mofloc.execute(TopLevel(), START)