Exemple #1
0
    def __init__(self, memobj, config=None, symobj=None):

        self.extcmds = {}
        self.basecmds = []
        self.emptymeth = None
        self.extsubsys = collections.defaultdict(list)
        self.scriptpaths = []
        self.addScriptPathEnvVar('ENVI_SCRIPT_PATH')

        Cmd.__init__(self, stdout=self)

        for name in dir(self):
            if name.startswith('do_'):
                self.basecmds.append(name[3:])

        self.shutdown = threading.Event()

        # If they didn't give us a resolver, make one.
        if symobj == None:
            symobj = e_resolv.SymbolResolver()

        if config == None:
            config = e_config.EnviConfig(defaults=cfgdefs)

        # Force it to be there if its not
        config.getSubConfig('cli')

        self.config = config
        self.memobj = memobj
        self.symobj = symobj
        self.canvas = e_canvas.MemoryCanvas(memobj, syms=symobj)

        self.aliases = {} # For *runtime* aliases only!
Exemple #2
0
    def __init__(self, memobj, config=None, symobj=None):

        self.extcmds = {}

        Cmd.__init__(self, stdout=self)

        self.shutdown = threading.Event()

        # If they didn't give us a resolver, make one.
        if symobj == None:
            symobj = e_resolv.SymbolResolver()

        if config == None:
            config = e_config.EnviConfig(defaults=cfgdefs)

        self.config = config
        self.memobj = memobj
        self.symobj = symobj
        self.canvas = e_canvas.MemoryCanvas(memobj, syms=symobj)