示例#1
0
文件: bundle.py 项目: nnen/nmapps
 def is_egg(cls, pth):
     pth = Path.make(pth)
     
     if pth.extension.lower() <> "egg":
         return False
     if not pth.is_file:
         return False
     return True
示例#2
0
文件: bundle.py 项目: nnen/nmapps
def get_bundle(pth = "."):
    pth = Path.make(pth).real
    
    bundle = Bundle(pth)
    
    for parent in pth.iter_parents():
        if Egg.is_egg(parent):
            return Egg(parent)
        if (parent + INIT_FILE).is_file:
            bundle = Bundle(parent)
    
    return bundle