示例#1
0
    def _load_info(self):
        """Return info dictionary

        This method extracts the content of info file by marshal and
        return the resulting dictionary.  If the file does not exists,
        an empty dictionary is returned.
        """
        try:
            if os.path.exists(self._info_file_path):
                return marshal.load(file(self._info_file_path))
            else:
                return {}
        except EOFError, why:
            Logger.log("EOFError in bbs.Topic._load_info() %s" % why)
            return {}
示例#2
0
def main(argv=None):
    # Parse options
    if argv is None:
        argv = sys.argv
    if len(argv) > 1:
        opts, args = getopt.getopt(argv[1:], "d")
        if "-d" in [o for o,v in opts]:
            Logger.set_debug_mode()
    Logger.clear()

    app = Application(UserInterface)
    Logger.log("app.start()")
    app.start()
    Logger.log("app.start() finished")
示例#3
0
文件: app.py 项目: wozozo/KittyWalk2
 def start(self):
     """Start KittyWalk application"""
     Logger.log("Application started.")
     self._ui.start()
     Logger.log("Application quit.")