예제 #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)
예제 #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)
예제 #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"])
예제 #4
0
def driver_to_format(driver):
    """
    >>> driver_to_format("autotools.single.rpm")
    'rpm'
    """
    return P.parse_list(driver, ".")[-1]