예제 #1
0
 def compareTags(self, x, y):
     timeCmp = cmp(self.getTagTimeInSeconds(x), self.getTagTimeInSeconds(y))
     if timeCmp:
         return timeCmp
     elif len(x) != len(y):
         # If the timing is the same, sort alphabetically
         # Any number should be sorted numerically, do this by padding them with leading zeroes
         return cmp(plugins.padNumbersWithZeroes(x), plugins.padNumbersWithZeroes(y))
     else:
         return cmp(x, y)
예제 #2
0
 def insertIntoModel(self, parentIter, modelAttributes):
     if parentIter:
         paddedClassifier = plugins.padNumbersWithZeroes(modelAttributes[0])
         follower = self.findChildIter(
             parentIter, lambda name: plugins.padNumbersWithZeroes(name) >
             paddedClassifier)
         return self.treeModel.insert_before(parentIter, follower,
                                             modelAttributes)
     else:
         return self.treeModel.append(parentIter, modelAttributes)
예제 #3
0
 def tagSortKey(self, x):
     return self.getTagTimeInSeconds(x), plugins.padNumbersWithZeroes(x)
예제 #4
0
 def getDateTagKey(self, info):
     return info[0], plugins.padNumbersWithZeroes(info[1])