Example #1
0
 def buildEpisodesBouquet(self, vid):
     files = Bouquet(Bouquet.TYPE_MENU, vid)
     for x in self.videos[vid].files:
         print 'add fid', x, 'to bouquet'
         file = Bouquet(Bouquet.TYPE_SERVICE, x)
         files.append(file)
     return files
Example #2
0
 def buildVideoBouquet(self):
     movs = Bouquet(Bouquet.TYPE_MENU, 'films')
     for x in self.currentPageIds:
         mov = Bouquet(Bouquet.TYPE_MENU, x, self.videos[x].name,
                       self.videos[x].year)  #two sort args [name, year]
         movs.append(mov)
     return movs
Example #3
0
 def sortByName(self):
     x = [(val.name, key) for (key, val) in self.channels.items()]
     x.sort()
     services = Bouquet(Bouquet.TYPE_MENU, 'all')
     for item in x:
         ch = self.channels[item[1]]
         services.append(
             Bouquet(Bouquet.TYPE_SERVICE, item[1], ch.name,
                     ch.num))  #two sort args [channel_name, number]
     return services
Example #4
0
 def sortByGroup(self):
     x = [(val.group, key) for (key, val) in self.channels.items()]
     x.sort()
     groups = Bouquet(Bouquet.TYPE_MENU, 'By group')
     groupname = x[0][0]
     ch = self.channels[x[0][1]]
     group = Bouquet(Bouquet.TYPE_MENU, groupname, ch.group,
                     ch.gid)  #two sort args [group_name, number]
     for item in x:
         ch = self.channels[item[1]]
         if item[0] == groupname:
             group.append(
                 Bouquet(Bouquet.TYPE_SERVICE, item[1], ch.name, ch.num))
         else:
             groups.append(group)
             groupname = item[0]
             ch = self.channels[item[1]]
             group = Bouquet(Bouquet.TYPE_MENU, groupname, ch.group,
                             ch.gid)  #two sort args [group_name, number]
             group.append(
                 Bouquet(Bouquet.TYPE_SERVICE, item[1], ch.name, ch.num))
     groups.append(group)
     return groups