Esempio n. 1
0
 def test_default(self):
     # is directory.
     self.assertFalse(lzspool.is_scriptspool(self.poolname))
     self._write("desc.ini", ["[info]", "maintainers=Jabba <*****@*****.**>"])
     self.pool = self._load_pool()
     self.assertTrue(lzspool.is_scriptspool(self.poolname))
     self.assertEquals("Jabba <*****@*****.**>", self.pool.maintainers)
Esempio n. 2
0
 def test_default(self):
     # is directory.
     self.assertFalse(lzspool.is_scriptspool(self.poolname))
     self._write('desc.ini',
                 ['[info]', 'maintainers=Jabba <*****@*****.**>'])
     self.pool = self._load_pool()
     self.assertTrue(lzspool.is_scriptspool(self.poolname))
     self.assertEquals('Jabba <*****@*****.**>', self.pool.maintainers)
Esempio n. 3
0
    def info(self):
        root = env.resource_name('pools')
        if self.argc <= 1:
            script_path = os.path.curdir
        else:
            if pool.is_scriptspool(os.path.curdir):
                script_path = self.args[1]
            else:
                script_path = os.path.join(root, self.args[1])

        if not lzsscript.is_scriptdir(script_path):
            print "fetal: %s is not a script detectory." % script_path
            return False

        script = lzsscript.Script(script_path)
        # get attritubte.
        attrs = []
        for attr in script.parser.options('attrs'):
            if not getattr(script, attr): continue
            attrs.append(attr)
        # get package info.
        pkginfo = script.get_pkginfo()
        _pkgs = ['-%s' % e for e in pkginfo['remove']] + \
                  ['+%s' % e for e in pkginfo['install']]
        msg_pkg = ' '.join(_pkgs)
        msg = [
            "Script Name: %s" % script.name,
            "Package Info: %s" % msg_pkg,
            "Support With: %s" % " ".join(attrs),
            "Script Maintaner: %s" % '\n'.join(script.maintainers),
            "Script Author: %s " % '\n'.join(script.authors),
            "Description: \n%s" % script.desc
        ]

        print "\n".join(msg)
Esempio n. 4
0
    def info(self):
        root = env.resource_name('pools')
        if self.argc <=  1:
            script_path = os.path.curdir;
        else:
            if pool.is_scriptspool(os.path.curdir):
                script_path = self.args[1]
            else:
                script_path = os.path.join(root, self.args[1])

        if not lzsscript.is_scriptdir(script_path):
            print "fetal: %s is not a script detectory." % script_path
            return False

        script = lzsscript.Script(script_path)
        # get attritubte.
        attrs = []
        for attr in script.parser.options('attrs'):
           if not getattr(script, attr):    continue
           attrs.append(attr)
        # get package info.
        pkginfo = script.get_pkginfo()
        _pkgs = ['-%s' % e for e in pkginfo['remove']] + \
                  ['+%s' % e for e in pkginfo['install']]
        msg_pkg = ' '.join(_pkgs)
        msg = ["Script Name: %s" % script.name,
               "Package Info: %s" % msg_pkg,
               "Support With: %s" % " ".join(attrs),
               "Script Maintaner: %s" % '\n'.join(script.maintainers),
               "Script Author: %s " % '\n'.join(script.authors),
               "Description: \n%s" % script.desc]

        print "\n".join(msg)