示例#1
0
def get_egginfo(egginfo):
    if vfs.is_folder(egginfo) and egginfo.endswith('.egg-info'):
        egginfo = join(egginfo, 'PKG-INFO')
    elif not (vfs.is_file(egginfo) and egginfo.endswith('.egg-info')):
        return None

    handler = PKGINFOFile(egginfo)
    handler.load_state()
    attrs = handler.attrs
    return attrs
示例#2
0
文件: packages.py 项目: kennym/itools
def get_egginfo(egginfo):
    if vfs.is_folder(egginfo) and egginfo.endswith('.egg-info'):
        egginfo = join(egginfo, 'PKG-INFO')
    elif not (vfs.is_file(egginfo) and egginfo.endswith('.egg-info')):
        return None

    handler = PKGINFOFile(egginfo)
    handler.load_state()
    attrs = handler.attrs
    return attrs
示例#3
0
文件: metadata.py 项目: nkhine/itools
def parse_setupconf(package_dir):
    """Return a dict containing information from setup.conf in a itools package
    plus the version of the package
    """
    attributes = {}
    if not vfs.is_folder(package_dir):
        return attributes
    if not vfs.exists(join(package_dir, "setup.conf")):
        return attributes
    config = SetupFile(join(package_dir, "setup.conf"))
    for attribute in config.schema:
        attributes[attribute] = config.get_value(attribute)
    if vfs.exists(join(package_dir, "version.txt")):
        attributes['version'] = open(join(package_dir, "version.txt")).read()
    else:
        attributes['version'] = get_package_version(attributes['name'])
    return attributes
示例#4
0
def parse_setupconf(package_dir):
    """Return a dict containing information from setup.conf in a itools package
    plus the version of the package
    """
    attributes = {}
    if not vfs.is_folder(package_dir):
        return attributes
    if not vfs.exists(join(package_dir, "setup.conf")):
        return attributes
    config = SetupFile(join(package_dir, "setup.conf"))
    for attribute in config.schema:
        attributes[attribute] = config.get_value(attribute)
    if vfs.exists(join(package_dir, "version.txt")):
        attributes['version'] = open(join(package_dir, "version.txt")).read()
    else:
        attributes['version'] = get_package_version(attributes['name'])
    return attributes
示例#5
0
文件: test_fs.py 项目: kennym/itools
 def test07_make_folder(self):
     vfs.make_folder('tests/folder')
     self.assertEqual(vfs.is_folder('tests/folder'), True)
示例#6
0
文件: test_fs.py 项目: kennym/itools
 def test04_is_folder(self):
     is_folder = vfs.is_folder('tests')
     self.assertEqual(is_folder, True)
示例#7
0
 def test07_make_folder(self):
     vfs.make_folder('tests/folder')
     self.assertEqual(vfs.is_folder('tests/folder'), True)
示例#8
0
 def test04_is_folder(self):
     is_folder = vfs.is_folder('tests')
     self.assertEqual(is_folder, True)