コード例 #1
0
ファイル: book_area.py プロジェクト: HoverHell/mcomix
    def _sort_by_name(self, treemodel, iter1, iter2, user_data):
        """ Compares two books based on their file name without the
        path component. """
        path1 = self._liststore.get_value(iter1, 2)
        path2 = self._liststore.get_value(iter2, 2)

        # Catch None values from liststore
        if path1 is None:
            return 1
        elif path2 is None:
            return -1

        name1 = os.path.split(path1.decode('utf-8'))[1].lower()
        name2 = os.path.split(path2.decode('utf-8'))[1].lower()

        return tools.alphanumeric_compare(name1, name2)
コード例 #2
0
    def _sort_by_name(self, treemodel, iter1, iter2, user_data):
        ''' Compares two books based on their file name without the
        path component. '''
        path1 = self._liststore.get_value(iter1, 2)
        path2 = self._liststore.get_value(iter2, 2)

        # Catch None values from liststore
        if path1 is None:
            return 1
        elif path2 is None:
            return -1

        name1 = os.path.split(path1)[1].lower()
        name2 = os.path.split(path2)[1].lower()

        return tools.alphanumeric_compare(name1, name2)
コード例 #3
0
ファイル: book_area.py プロジェクト: HoverHell/mcomix
 def _sort_by_path(self, treemodel, iter1, iter2, user_data):
     """ Compares two books based on their full path, in natural order. """
     path1 = self._liststore.get_value(iter1, 2)
     path2 = self._liststore.get_value(iter2, 2)
     return tools.alphanumeric_compare(path1, path2)
コード例 #4
0
 def _sort_by_path(self, treemodel, iter1, iter2, user_data):
     ''' Compares two books based on their full path, in natural order. '''
     path1 = self._liststore.get_value(iter1, 2)
     path2 = self._liststore.get_value(iter2, 2)
     return tools.alphanumeric_compare(path1, path2)