Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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
Exemple #5
0
 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)
Exemple #6
0
 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
Exemple #7
0
 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)
Exemple #8
0
 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)
Exemple #9
0
 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')
Exemple #10
0
 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')