Changeset - 1fe54442db38
[Not reviewed]
default
0 1 0
drewp - 21 years ago 2003-07-08 09:18:47

get_all_subs sorts, and puts some elements at the end
1 file changed with 12 insertions and 1 deletions:
0 comments (0 inline, 0 general)
flax/Submaster.py
Show inline comments
 
@@ -92,7 +92,18 @@ class Submasters:
 
            self.submasters[filename] = Submaster(filename)
 
    def get_all_subs(self):
 
        "All Submaster objects"
 
        return self.submasters.values()
 
        l = self.submasters.items()
 
        l.sort()
 
        l = [x[1] for x in l]
 
        songs = []
 
        notsongs = []
 
        for s in l:
 
            if s.name.startswith('song'):
 
                songs.append(s)
 
            else:
 
                notsongs.append(s)
 
        combined = notsongs + songs
 
        return combined
 
    def get_sub_by_name(self, name):
 
        "Makes a new sub if there isn't one."
 
        return self.submasters.get(name, Submaster(name))
0 comments (0 inline, 0 general)