def __init__(self, cmdName, func, desc, help, ensoapi, generatorManager, takesArg=False, argValue=None): CommandObject.__init__(self) self.name = cmdName # added to unify command name retrieval self.cmdName = cmdName self.func = func self.takesArg = takesArg self.argValue = argValue self.ensoapi = ensoapi self.generatorManager = generatorManager self.setName(cmdName) self.setHelp(help) self.setDescription(desc)
def __init__(self, cmdName, func, desc, help, ensoapi, generatorManager, takesArg=False, argValue=None, overrideKeycodes=None): CommandObject.__init__(self) self.name = cmdName self.func = func self.takesArg = takesArg self.argValue = argValue self.ensoapi = ensoapi self.generatorManager = generatorManager self.setName(cmdName) if hasattr(func, "help"): self.setHelp(func.help) else: self.setHelp(help) func.setDescription = self.setDescription func.setHelp = self.setHelp if hasattr(func, "description"): self.setDescription(func.description) else: if hasattr(func, "set_description") and callable( func.set_description): new_desc = None try: new_desc = func.set_description(argValue) except: pass if new_desc: self.setDescription(new_desc) else: self.setDescription(desc) else: if "%s" in desc: if argValue: new_desc = desc % u"\u201c%s\u201d" % argValue else: arg_name = getargspec(func)[0][1] new_desc = desc % "{%s}" % arg_name self.setDescription(new_desc) else: self.setDescription(desc) if overrideKeycodes: self.OVERRIDE_ALLOWED_KEYCODES = overrideKeycodes
def __init__(self, parameter=None): """ Initializes the google command. """ CommandObject.__init__(self) self.parameter = parameter if parameter != None: self.setDescription("Performs a Google web search for " "\u201c%s\u201d." % parameter)
def __init__( self, parameter = None ): """ Initializes the google command. """ CommandObject.__init__( self ) self.parameter = parameter if parameter != None: self.setDescription( u"Performs a Google web search for " u"\u201c%s\u201d." % parameter )
def __init__( self, cmdName, func, desc, help, ensoapi, generatorManager, takesArg = False, argValue = None ): CommandObject.__init__( self ) self.name = cmdName self.func = func self.takesArg = takesArg self.argValue = argValue self.ensoapi = ensoapi self.generatorManager = generatorManager self.setName( cmdName ) self.setHelp( help ) self.setDescription( desc )
def __init__(self, parameter=None): """ Initializes the undo command. """ print "UndoCommand.__init__()" CommandObject.__init__(self) self.parameter = parameter """ if parameter != None: self.setDescription( u"Performs a Google web search for " u"\u201c%s\u201d." % parameter ) """ self.setDescription(" sfsdfsfsf") self.setHelp("asdsf ")
def __init__( self, parameter = None ): """ Initializes the undo command. """ print "UndoCommand.__init__()" CommandObject.__init__( self ) self.parameter = parameter """ if parameter != None: self.setDescription( u"Performs a Google web search for " u"\u201c%s\u201d." % parameter ) """ self.setDescription(" sfsdfsfsf") self.setHelp("asdsf ")
def __init__(self, description, message, ensoapi): CommandObject.__init__(self) self.setDescription(description) self.ensoapi = ensoapi self.message = message
def __init__(self): CommandObject.__init__(self) self.setName(self.NAME) self.setDescription(self.DESCRIPTION)
def __init__( self, description, message, ensoapi ): CommandObject.__init__( self ) self.setDescription( description ) self.ensoapi = ensoapi self.message = message
def __init__(self, parameter=None): CommandObject.__init__(self) self.parameter = parameter
def __init__(self, parameter = None): CommandObject.__init__( self ) self.parameter = parameter
def __init__( self ): CommandObject.__init__( self ) self.setName( self.NAME ) self.setDescription( self.DESCRIPTION )