示例#1
0
文件: impl.py 项目: garaemon/kasabake
 def __init__(self, manager):
     parser = CommandParser(prog = INSTALL_PLUGIN_COMMAND,
                                description = self.__doc__)
     parser.add_command("install", "get",
                        narg = 3,
                        completion_policies = [NullCompletionPolicy(),
                                               NullCompletionPolicy(),
                                               NullCompletionPolicy()],
                        callback = self.install,
                        help = "install a plugin")
     parser.add_command("update", "upgrade",
                        narg = 1,
                        completion_policies = [NullCompletionPolicy()],
                        callback = self.update,
                        help = "update a plugin")
     KasabakeCommandPlugin.__init__(self, manager,
                                    INSTALL_PLUGIN_COMMAND,
                                    parser,
                                    INSTALL_PLUGIN_DIR)
     return
示例#2
0
文件: impl.py 项目: garaemon/kasabake
    def __init__(self, manager):
        parser = CommandParser(prog = DB_COMMAND,
                               description = self.__doc__)
        parser.add_command("cat",
                           narg = 0,
                           callback = self.printXML,
                           help = "print your DB xml")
        parser.add_option("-w", "--over-write", dest = "over_write",
                          action = "store_true",
                          default = False,
                          help = """overwrite the values if DB has the \
same value""")
        parser.add_option("-x", "--format-as-xml", dest = "format_as_xml",
                          action = "store_true",
                          default = False,
                          help = """print the xml value in xml format""")
        parser.add_command("init", "initialize",
                           narg = 0,
                           callback = self.initializeXML,
                           help = "initialize your DB xml")
        parser.add_command("get",
                           narg = 1,
                           callback = self.printXMLValue,
                           help = "get an XML value as a dictionary")
        parser.add_command("set",
                           narg = 2,
                           callback = self.setXMLValue,
                           help = "set an XML value.")
        parser.add_command("append",
                           narg = 1,
                           callback = self.appendXML,
                           help = "append an XML file into DB")
        KasabakeCommandPlugin.__init__(self, manager,
                                       DB_COMMAND,
                                       parser,
                                       DB_DIR)
        return
    def __init__(self, manager):
        parser = CommandParser(prog = PLUGIN_COMMAND,
                               description = self.__doc__)
        parser.add_command("install",
                           narg = 0,
                           callback = self.install,
                           help = "install screen setting files")
        parser.add_command("twitter",
                           narg = 0,
                           callback = self.twitter,
                           help = "print timeline of your twitter. \
this is a helper command for screen.")
        parser.add_command("date",
                           narg = 0,
                           callback = self.date,
                           help = "print date. this is a helper commmand \
for screen.")
        FileInstaller.__init__(self, manager,
                               PLUGIN_COMMAND,
                               parser,
                               PLUGIN_DIR)
        return