Exemple #1
0
    def load(self, config):
        config = self._cparser.load(config)

        # special cases:
        if "template_paths" in config:
            config.template_paths = self.template_paths + \
                P.parse_list(config.template_paths)

        self.update(config)
Exemple #2
0
    def load(self, config, forced_type=None):
        config = self._cparser.load(config, forced_type)

        # special cases:
        if "relations" in config:
            try:
                config.relations = P.parse(config.relations)
            except:
                print "config.relations=" + str(config.relations)
                raise

        if "template_paths" in config:
            config.template_paths = self.template_paths + \
                P.parse_list(config.template_paths)

        self.update(config)
Exemple #3
0
 def test_01_parse_list(self):
     self.assertEquals(P.parse_list(""), [])
     self.assertEquals(P.parse_list("a,b"), ["a", "b"])
     self.assertEquals(P.parse_list("1,2"), [1, 2])
     self.assertEquals(P.parse_list("a,b,"), ["a", "b"])
     self.assertEquals(P.parse_list("a|b|", "|"), ["a", "b"])
def driver_to_format(driver):
    """
    >>> driver_to_format("autotools.single.rpm")
    'rpm'
    """
    return P.parse_list(driver, ".")[-1]