Exemplo n.º 1
0
def lsNode(i,n,long,maxlevel):
    if i >= 0:
        print "%s%s" % (' '*i, long and n or immom.split_dn(n)[0])
    if i >= maxlevel:
        return
    for e in immom.getchildobjects(n):
        lsNode(i+1,e,long,maxlevel)
Exemplo n.º 2
0
 def getwo(self, args, validate=True):
     if not args:
         wo = self.cwd
     elif args[0] == '/':
         wo = args[1:]
     elif args == '..':
         wo = immom.split_dn(self.cwd)[1]
     elif args == '-':
         wo = self.lastcwd
     else:
         if self.cwd == '':
             wo = args
         else:
             wo = '%s,%s' % (args, self.cwd)
     wo = wo.strip()
     if validate and wo != '':
         immom.getobject(wo)
     return wo