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
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
def test07_make_folder(self): vfs.make_folder('tests/folder') self.assertEqual(vfs.is_folder('tests/folder'), True)
def test04_is_folder(self): is_folder = vfs.is_folder('tests') self.assertEqual(is_folder, True)