示例#1
0
    def __init__(self, node):
        self.prefixes = {}

        prefixes = utils.node_get_elements_by_tag_name(node, "prefix")
        for child in prefixes:
            name = child.getAttribute("name")
            if len(name) == 0:
                name = "default"
            value = utils.evaluate_environment_variables(utils.node_get_string(child))
            self.prefixes[name] = value

        child = utils.node_get_element_by_tag_name(node, "image")
        if child:
            pass # FIXME: implement
        
        child = utils.node_get_element_by_tag_name(node, "run-install-name-tool")
        if child:
            self.run_install_name_tool = True
        else:
            self.run_install_name_tool = False

        child = utils.node_get_element_by_tag_name(node, "destination")
        self.overwrite = utils.node_get_property_boolean(child, "overwrite", False)
        self.dest = utils.node_get_string(child, "${project}")

        child = utils.node_get_element_by_tag_name(node, "gtk")
        if child:
            self.gtk = utils.node_get_string(child)
        else:
            self.gtk = "gtk+-2.0"
示例#2
0
    def __init__(self, node):
        self.prefixes = {}

        prefixes = utils.node_get_elements_by_tag_name(node, "prefix")
        for child in prefixes:
            name = child.getAttribute("name")
            if len(name) == 0:
                name = "default"
            value = utils.evaluate_environment_variables(
                utils.node_get_string(child))
            self.prefixes[name] = value

        child = utils.node_get_element_by_tag_name(node, "image")
        if child:
            pass  # FIXME: implement

        child = utils.node_get_element_by_tag_name(node,
                                                   "run-install-name-tool")
        if child:
            self.run_install_name_tool = True
        else:
            self.run_install_name_tool = False

        child = utils.node_get_element_by_tag_name(node, "destination")
        self.overwrite = utils.node_get_property_boolean(
            child, "overwrite", False)
        self.dest = utils.node_get_string(child, "${project}")
示例#3
0
    def from_node(cls, node, validate=True):
        source = utils.node_get_string(node)
        dest = node.getAttribute("dest")
        if len(dest) == 0:
            dest = None

        if validate:
            Path.validate(source, dest)

        return Path(source, dest)
示例#4
0
    def from_node(cls, node, validate=True):
        source = utils.node_get_string(node)
        dest = node.getAttribute("dest")
        if len(dest) == 0:
            dest = None

        if validate:
            Path.validate(source, dest)
            
        return Path(source, dest)
示例#5
0
    def from_node(cls, node):
        source = utils.node_get_string(node)
        dest = node.getAttribute("dest")
        if len(dest) == 0:
            dest = None
        name = node.getAttribute("name")
        if len(name) == 0:
            raise "The tag 'translations' must have a 'name' property"

        return Translation(name, source, dest)
示例#6
0
    def from_node(cls, node):
        source = utils.node_get_string(node)
        dest = node.getAttribute("dest")
        if len(dest) == 0:
            dest = None
        name = node.getAttribute("name")
        if len(name) == 0:
            raise "The tag 'translations' must have a 'name' property"

        return Translation(name, source, dest)
示例#7
0
    def __init__(self, node):
        self.runtime_variables = []
        self.scripts = []

        variables = utils.node_get_elements_by_tag_name(node, "runtime-variable")
        for child in variables:
            self.runtime_variables.append(Variable(child))

        scripts = utils.node_get_elements_by_tag_name(node, "script")
        for child in scripts:
            script = Path(utils.node_get_string(child), "${bundle}/Resources/Scripts")
            self.scripts.append(script)
示例#8
0
    def __init__(self, node):
        self.runtime_variables = []
        self.scripts = []

        variables = utils.node_get_elements_by_tag_name(
            node, "runtime-variable")
        for child in variables:
            self.runtime_variables.append(Variable(child))

        scripts = utils.node_get_elements_by_tag_name(node, "script")
        for child in scripts:
            script = Path(utils.node_get_string(child),
                          "${bundle}/Resources/Scripts")
            self.scripts.append(script)
示例#9
0
    def from_node(cls, node):
        name = utils.node_get_string(node)
        if not name:
            raise Exception("Icon theme must have a 'name' property")

        string = node.getAttribute("icons")
        if string == "all":
            icons = IconTheme.ICONS_ALL
        elif string == "none":
            icons = IconTheme.ICONS_NONE
        elif string == "auto" or len(string) == 0:
            icons = IconTheme.ICONS_AUTO

        return IconTheme(name, icons)
示例#10
0
 def from_node(cls, node):
     name = utils.node_get_string(node)
     if not name:
         raise Exception("Icon theme must have a 'name' property")
     
     string = node.getAttribute("icons")
     if string == "all":
         icons = IconTheme.ICONS_ALL
     elif string == "none":
         icons = IconTheme.ICONS_NONE
     elif string == "auto" or len(string) == 0:
         icons = IconTheme.ICONS_AUTO
         
     return IconTheme(name, icons)
示例#11
0
 def from_node(cls, node, validate=True):
     source = utils.node_get_string(node)
     dest = node.getAttribute("dest")
     recurse = node.getAttribute("recurse")
     if len(dest) == 0:
         dest = None
     if recurse == "True":
         recurse = True
     else:
         recurse = False
     if validate:
         Path.validate(source, dest)
         
     return Path(source, dest, recurse)
示例#12
0
    def from_node(cls, node, validate=True):
        source = utils.node_get_string(node)
        dest = node.getAttribute("dest")
        recurse = node.getAttribute("recurse")
        if len(dest) == 0:
            dest = None
        if recurse == "True":
            recurse = True
        else:
            recurse = False
        if validate:
            Path.validate(source, dest)

        return Path(source, dest, recurse)
示例#13
0
 def __init__(self, node):
     self.name = node.getAttribute("name")
     self.value = utils.node_get_string(node)
示例#14
0
 def get_plist_path(self):
     plist = utils.node_get_element_by_tag_name(self.root, "plist")
     if not plist:
         raise Exception("The 'plist' tag is required")
     return self.evaluate_path(utils.node_get_string(plist))
示例#15
0
 def __init__(self, node):
     self.name = node.getAttribute("name")
     self.value = utils.node_get_string(node)
示例#16
0
 def get_plist_path(self):
     plist = utils.node_get_element_by_tag_name(self.root, "plist")
     if not plist:
         raise Exception("The 'plist' tag is required")
     return  self.evaluate_path(utils.node_get_string(plist))