def download_scripts (self): conf = env.resource('config') if not self.recommands_list: self.pool = env.resource('pool') else: path = os.path.join(env.resource_name('pools'), conf.get_default('pool')) self.pool = lzspool.GitScriptsPool(path, self.win.recommands_list)
def download_scripts(self): conf = env.resource('config') if not self.recommands_list: self.pool = env.resource('pool') else: path = os.path.join(env.resource_name('pools'), conf.get_default('pool')) self.pool = lzspool.GitScriptsPool(path, self.win.recommands_list)
def test_add_pool(self): self._admin.onecmd("pool") path = os.path.join(env.resource_name("pools"), "zenpool") self._admin.onecmd("pool add zenpool") mypool = pool.GitScriptsPool(path) self.assertEquals({"origin": "", "rev": "stable", "upstream": ""}, env.resource("config").get_pool("zenpool")) shutil.rmtree(path) self._admin.onecmd("pool add zenpool /tmp/upstreampool") mypool = pool.GitScriptsPool(path) self.assertEquals( {"origin": "", "rev": "stable", "upstream": "/tmp/upstreampool"}, env.resource("config").get_pool("zenpool") ) shutil.rmtree(path)
def _ask_user_selectpool(self): conf = env.resource('config') lang = env.get_local() pools = conf.get_support_pools(distro.Distribution().name, distro.Distribution().version, lang) if len(pools) == 1: poolname = pools[0][0] else: poolname = gui.select_defaultpool(pools) self.conf.set_default(pool=poolname) self.conf.save() return poolname
def test_add_pool(self): self._admin.onecmd("pool") path = os.path.join(env.resource_name('pools'), 'zenpool') self._admin.onecmd("pool add zenpool") mypool = pool.GitScriptsPool(path) self.assertEquals({ 'origin': '', 'rev': 'stable', 'upstream': '' }, env.resource('config').get_pool('zenpool')) shutil.rmtree(path) self._admin.onecmd("pool add zenpool /tmp/upstreampool") mypool = pool.GitScriptsPool(path) self.assertEquals( { 'origin': '', 'rev': 'stable', 'upstream': '/tmp/upstreampool' }, env.resource('config').get_pool('zenpool')) shutil.rmtree(path)
def _ask_user_selectpool(self): conf = env.resource('config') lang = env.get_locale() pools = conf.get_support_pools(distro.Distribution().name, distro.Distribution().version, lang) if not pools: pools = conf.get_support_pools(distro.Distribution().name, distro.Distribution().version, 'en_US') if len(pools) == 1: poolname = pools[0][0] else: poolname = ui.select_defaultpool(pools) self.conf.set_default(pool=poolname) self.conf.save() return poolname
def info(self): if self.argc <= 1: return False conf = env.resource('config') poolname = self.args[1] poolobj = self._load_pool(poolname) pooldata = self.conf.get_pool(poolname) pooldata = self.conf.get_pool(poolname) msgs = [ "Pool Name: %s" % poolobj.get_i18n('info', 'name'), "Upstream Repo: %s" % pooldata.get('upstream', 'None'), "Remote Repo: %s" % pooldata.get('origin', 'None'), "Maintainers: %s" % poolobj.maintainers, "Description: %s" % poolobj.get_i18n('info', 'desc'), ] print '\n'.join(msgs)
def info(self): if self.argc <= 1: return False conf = env.resource('config') poolname = self.args[1] poolobj = self._load_pool(poolname) pooldata = self.conf.get_pool(poolname) pooldata = self.conf.get_pool(poolname) msgs = [ "Pool Name: %s" % poolobj.get_i18n('info', 'name'), "Upstream Repo: %s" % pooldata.get('upstream','None'), "Remote Repo: %s" % pooldata.get('origin','None'), "Maintainers: %s" % poolobj.maintainers, "Description: %s" % poolobj.get_i18n('info', 'desc'), ] print '\n'.join(msgs)
def __init__(self, args=None): self.args = args.split(' ') self.argc = len(self.args) self.optparser = optparse.OptionParser() self.curdir = os.path.abspath(os.path.curdir) self.conf = env.resource('config')