from ccdb.cmd import ConsoleUtilBase def create_util_instance(): import ccdb.cmd util = ListUtil() if(ccdb.cmd.verbose): print "registring HelpConsoleUtil" return util class ListUtil(ConsoleUtilBase): command = "ls" name = "List" shortDescr = "List objects in a given directory" def process(self, args): print "List module is gained a control over the process." print args if len(args) > 0: path = args[0] else: path = self.context.current_path dir=self.context.provider.GetDirectory(path) if dir: print dir.GetFullPath() subdirs = dir.GetSubdirectories() for subdir in subdirs: print subdir.GetName() else: print "Can't find the directory"