Example #1
0
    def make(self):
        themes_dir = join(self.cfg.mozSrc, "mozilla", "toolkit", "themes")

        color_names = set()
        for css_path in utils.paths_from_path_patterns([themes_dir],
                                                       includes=["*.css"]):
            for color_name in self._color_names_from_css_path(css_path):
                if color_name not in color_names:
                    color_names.add(color_name)
                    print color_name
Example #2
0
 def make(self):
     themes_dir = join(self.cfg.mozSrc, "mozilla", "toolkit", "themes")
     
     color_names = set()
     for css_path in utils.paths_from_path_patterns(
                         [themes_dir], includes=["*.css"]):
         for color_name in self._color_names_from_css_path(css_path):
             if color_name not in color_names:
                 color_names.add(color_name)
                 print color_name
Example #3
0
 def entities_from_locale_dir(self, locale_dir):
     self.duplicate_entities = set()
     self.dtd_paths_from_entity = defaultdict(set)
     entities = set()
     for dtd_path in utils.paths_from_path_patterns([locale_dir],
                                                    includes=["*.dtd"]):
         for entity in self._entities_from_dtd_path(dtd_path):
             self.dtd_paths_from_entity[entity].add(dtd_path)
             if entity in entities:
                 self.duplicate_entities.add(entity)
                 #self.log.warn("duplicate entity: %r (one defn in `%s')",
                 #              entity, dtd_path)
             else:
                 entities.add(entity)
     return entities
Example #4
0
 def entities_from_locale_dir(self, locale_dir):
     self.duplicate_entities = set()
     self.dtd_paths_from_entity = defaultdict(set)
     entities = set()
     for dtd_path in utils.paths_from_path_patterns(
                         [locale_dir], includes=["*.dtd"]):
         for entity in self._entities_from_dtd_path(dtd_path):
             self.dtd_paths_from_entity[entity].add(dtd_path)
             if entity in entities:
                 self.duplicate_entities.add(entity)
                 #self.log.warn("duplicate entity: %r (one defn in `%s')",
                 #              entity, dtd_path)
             else:
                 entities.add(entity)
     return entities
Example #5
0
    def make(self):
        en_us_dir = join(dirname(__file__), "src", "chrome", "komodo",
                         "locale", "en-US")
        content_dir = join(dirname(__file__), "src", "chrome", "komodo",
                           "content")

        entities = self.entities_from_locale_dir(en_us_dir)
        if self.duplicate_entities:
            self.log.warn("have %d entities with the same name",
                          len(self.duplicate_entities))

        entity_use_re = re.compile("&(.*?);")
        for xul_path in utils.paths_from_path_patterns([content_dir],
                                                       includes=["*.xul"]):
            xul = open(xul_path, 'r').read()
            for entity in entity_use_re.findall(xul):
                entities.discard(entity)
        for entity in entities:
            print entity
        if entities:
            self.log.info("%d unused entities", len(entities))
Example #6
0
    def make(self):
        en_us_dir = join(dirname(__file__), "src", "chrome", "komodo",
                         "locale", "en-US")
        content_dir = join(dirname(__file__), "src", "chrome", "komodo",
                           "content")
        
        entities = self.entities_from_locale_dir(en_us_dir)
        if self.duplicate_entities:
            self.log.warn("have %d entities with the same name",
                          len(self.duplicate_entities))

        entity_use_re = re.compile("&(.*?);")
        for xul_path in utils.paths_from_path_patterns(
                            [content_dir], includes=["*.xul"]):
            xul = open(xul_path, 'r').read()
            for entity in entity_use_re.findall(xul):
                entities.discard(entity)
        for entity in entities:
            print entity
        if entities:
            self.log.info("%d unused entities", len(entities))