~flimm/epidermis/icon-theme-bugfix

« back to all changes in this revision

Viewing changes to epidermis/pigments/skin.py

  • Committer: David D Lowe
  • Date: 2011-01-04 22:50:19 UTC
  • Revision ID: daviddlowe.flimm@gmail.com-20110104225019-uo31kb54cbxjt5vt
Tidy up code with better comments.
Deleted unused functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        self.webPage = ""
55
55
    
56
56
    def get_words(self, words, lang="en"):
57
 
        """Returns a string with the items in either words seperated by commas
58
 
        words: can be self.keyWords, self.primaryColours, self.secondaryColours
59
 
        lang: if self.keyWords is passed, a language should be specified"""
 
57
        """Return a string with the items in either words seperated by commas
 
58
        
 
59
        Keyword arguments:
 
60
        words -- can be self.keyWords, self.primaryColours, 
 
61
                 self.secondaryColours
 
62
        lang -- if self.keyWords is passed, a language should 
 
63
                be specified
 
64
        
 
65
        """
60
66
        out = ""
61
67
        if isinstance(words, list):
62
68
            for word in words:
88
94
        Pigment.remove(self, progressCallback, shell)
89
95
    
90
96
    def activate(self, progressCallback=None, shell=None):
91
 
        """Activates Skin, including all linked Pigments"""
 
97
        """Activate Skin, including all linked Pigments"""
92
98
        if progressCallback is None: progressCallback = lambda(a1): False
93
99
        if progressCallback(0.0): return
94
100
        
105
111
        progressCallback(1.0)
106
112
    
107
113
    def load_with_pigments(self, filePath, pigments):
108
 
        """Similar to load, but accepts a list of Pigment objects which will
 
114
        """Similar to load, but accepting a list of Pigment objects which will
109
115
        take priority in the search for linked pigments over (other) installed
110
 
        pigments"""
 
116
        pigments
 
117
        
 
118
        """
111
119
        dir = self._extract_in_temp(filePath)
112
120
        self.read_with_pigments(os.path.join(dir, "pigment.xml"), pigments)
113
121
        self._rearrange_temp(dir)
115
123
    def read_with_pigments(self, filePath, pigments):
116
124
        """Similar to read, but will look for linked pigments in the pigments
117
125
        argument, before looking for installed pigments
118
 
        filePath: the path of the xml file to read
119
 
        pigments: a list of Pigment objects from which to search for linked pigments"""
 
126
        
 
127
        Keyword arguments:
 
128
        filePath -- the path of the xml file to read
 
129
        pigments -- a list of Pigment objects from which to search for 
 
130
                    linked pigments"""
120
131
        
121
132
        Pigment.read(self, filePath)
122
133
        
288
299
            if el.nodeType == xml.dom.Node.TEXT_NODE:
289
300
                return el.data
290
301
        raise(ep_exceptions.NoFirstTextError())
291
 
 
292
 
 
293
 
 
294
 
def main():
295
 
    print "do not run"
296
 
 
297
 
 
298
 
if __name__ == "__main__":
299
 
    main()