def save(package): """Save Package changes to disk. The package _must_ already exist on disk. That is, it must be created with dpm.lib.init before. :param package: - The package that will be updated on disk :type package: :py:class:`Package <dpm.package.Package>` :return: - :py:class:`Package <dpm.package.Package>` -- The Package object stored at package_path """ try: dpm.load_package("file://" + package.installed_path) except (IOError, TypeError): raise ValueError( "No valid installation path at " + str(package.installed_path) + ". Have you inited the package before?") package.dist.write(package.installed_path) package.name = os.path.basename(package.installed_path) return package
def _test_load_package(self): pkg = dpm.load_package(self.file_spec)