def egginst_remove(pkg): fn = basename(pkg) pprint_fn_action(fn, 'removing') if dry_run: return ei = egginst.EggInst(pkg) ei.remove()
def install(self, egg, dir_path, extra_info=None): ei = egginst.EggInst(join(dir_path, egg), prefix=self.prefix, hook=self.hook, evt_mgr=self.evt_mgr, pkgs_dir=self.pkgs_dir, verbose=self.verbose) ei.super_id = getattr(self, 'super_id', None) ei.install(extra_info)
def remove(self, egg): ei = egginst.EggInst(egg, prefix=self.prefix, hook=self.hook, evt_mgr=self.evt_mgr, pkgs_dir=self.pkgs_dir, verbose=self.verbose) ei.super_id = getattr(self, 'super_id', None) ei.remove()
def self_install(): tmp_dir = tempfile.mkdtemp() egg_path = join(tmp_dir, 'ironpkg-1.0.0-1.egg') data = base64.b64decode(b64eggdata) assert hashlib.md5(data).hexdigest() == '41787f5a12384e482e8e9f1d90f8bcdc' fo = open(egg_path, 'wb') fo.write(data) fo.close() unzip(egg_path, tmp_dir) sys.path.insert(0, tmp_dir) import egginst print "Bootstrapping:", egg_path ei = egginst.EggInst(egg_path) ei.install()
def egginst_install(conf, dist): repo, fn = dist_naming.split_dist(dist) pkg_path = join(conf['local'], fn) pprint_fn_action(fn, 'installing') if dry_run: return ei = egginst.EggInst(pkg_path) ei.install() info = get_installed_info(cname_fn(fn)) path = join(info['meta_dir'], '__enpkg__.txt') fo = open(path, 'w') fo.write("repo = %r\n" % repo) fo.close()
def main(prefix=sys.prefix, hook=False, pkgs_dir=None, verbose=False): """ To bootstrap enstaller into a Python environment, used the following code: sys.path.insert(0, '/path/to/enstaller.egg') from egginst.bootstrap import main main() """ import egginst # This is the path to the egg which we want to install. # Note that whoever calls this function has inserted the egg to the # from of sys.path egg_path = sys.path[0] print("Bootstrapping:", egg_path) ei = egginst.EggInst(egg_path, prefix, hook=hook, pkgs_dir=pkgs_dir) ei.install()