def __init__(self, path_esono, path1=None, path2=None): ''' path_esono ''' db_path = None rep_path = None # if path1==path2==None: ue.mezz("usage path1 path2"); sys.exit(0) if path1==path2==None: path1='.' if path1: if os.path.isdir(path1): rep_path = path1 elif os.path.isfile(path1): db_path = path1 else: db_path = path1 if path2: if os.path.isdir(path2): rep_path = path2 elif os.path.isfile(path2): db_path = path2 else: db_path = path2 self.path_esono = self.norm(path_esono) if rep_path!=None: self.rep_path = self.norm(rep_path) t, rep_name, t, t = ue.path_decompose(self.rep_path) self.rep_name = rep_name else: self.rep_path = './' self.rep_name = './' if db_path==None: db_path = os.path.join(self.rep_path, rep_name+'.xml.esono') self.db_path = self.norm(db_path) if sys.platform=="windoz": self.esono = os.path.dirname(os.path.realpath(self.path_esono)) else: __file__path = os.path.split(__file__)[0] if not __file__path: __file__path = os.path.abspath(os.curdir) self.esono = __file__path if 'site-packages.zip' in self.esono: self.esono = os.path.abspath(self.esono+'../../') self.esono = os.path.abspath(self.esono) print ('Esonoclaste path is :', self.esono) self.doc = os.path.join(self.esono,'doc') self.icons = os.path.join(self.esono, 'icons') self.extras = os.path.join(self.esono, 'extras') self.startdir = os.path.abspath(os.path.curdir)
def __init__(self, path): self.path = pabs(pnorm(path)) self.rep, self.name, self.name_noext, self.ext = ue.path_decompose(self()) self.isdir = pisdir(self()) self.isfile = pisfile(self()) self.ismark = not (self.isfile or self.isdir) self.parent = Mpath(os.path.dirname(self())) if self.isdir: self.eso_txt = pjoin(self(), self.name) else: self.eso_txt = self() self.eso_txt += '.esono.txt' self.read()
def __init__(self, path): self.path = pabs(pnorm(path)) self.isdir = pisdir(self()) self.isfile = pisfile(self()) self.rep, self.name, self.name_noext, self.ext = ue.path_decompose(self()) self.isup = (self.name in [esono.upelt, esono.upelt0]) self.ismark = not (self.isfile or self.isdir or self.isup) self.parent = os.path.dirname(self()) self.parents = self.splitall() self.depth = self.gdepth() if self.isdir: self.eso_txt = pjoin(self(), self.name) else: self.eso_txt = self() self.eso_txt += '.esono.txt' self.read()