catherder/classes.py
def sort_cards(self, column_name=None):
        r"""Sort cards alphabetically and into appropriate columns,
        putting automation cards at the bottom.

        Args:
            column_name (str, optional): Name of the column that should be
                sorted. None causes all columns to be sorted. Defaults to None.

        """
        regex_obj = '([0-9]+)([A-Z]+)([0-9]+):'
        if column_name is None:
            column_name = list(self.github_project_map.keys())
        if isinstance(column_name, list):
            for column in column_name:
                self.sort_cards(column)
            return
        elif isinstance(column_name, github.ProjectColumn.ProjectColumn):
            column = column_name
        else:
            column = self.github_project_map[column_name]['column']
        keymap = ('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                  'abcdefghijklmnopqrstuvwxyz')

        def sort_cards(card):
            if card.note:
                if card.note.startswith('###### Automation Rules'):
                    return 'zzzz' + card.note
                return '0000' + card.note
            else:
                issue_name = card.get_content().title
                matches = re.findall(regex_obj, issue_name)
                if matches:
                    return ''.join([keymap[int(matches[0][0])], matches[0][1],
                                    keymap[int(matches[0][2])]])
                return '0000' + issue_name

        cards = sorted(list(column.get_cards()), key=sort_cards)
        self.edit_card(cards[0], position='top')
        for i in range(1, len(cards)):
            self.edit_card(cards[i], position=('after:%s'
                                               % cards[i - 1].id))
r"""Sort cards alphabetically and into appropriate columns,
        putting automation cards at the bottom.

        Args:
            column_name (str, optional): Name of the column that should be
                sorted. None causes all columns to be sorted. Defaults to None.

        
r"""Sort cards alphabetically and into appropriate columns,
putting automation cards at the bottom.
r " " " Sort cards alphabetically and into appropriate columns putting automation cards at the bottom .
def sort_cards(self, column_name=None):
        regex_obj = '([0-9]+)([A-Z]+)([0-9]+):'
        if column_name is None:
            column_name = list(self.github_project_map.keys())
        if isinstance(column_name, list):
            for column in column_name:
                self.sort_cards(column)
            return
        elif isinstance(column_name, github.ProjectColumn.ProjectColumn):
            column = column_name
        else:
            column = self.github_project_map[column_name]['column']
        keymap = ('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                  'abcdefghijklmnopqrstuvwxyz')
        def sort_cards(card):
            if card.note:
                if card.note.startswith('###### Automation Rules'):
                    return 'zzzz' + card.note
                return '0000' + card.note
            else:
                issue_name = card.get_content().title
                matches = re.findall(regex_obj, issue_name)
                if matches:
                    return ''.join([keymap[int(matches[0][0])], matches[0][1],
                                    keymap[int(matches[0][2])]])
                return '0000' + issue_name
        cards = sorted(list(column.get_cards()), key=sort_cards)
        self.edit_card(cards[0], position='top')
        for i in range(1, len(cards)):
            self.edit_card(cards[i], position=('after:%s'
                                               % cards[i - 1].id))
def sort_cards ( self , column_name = None ) : regex_obj = '([0-9]+)([A-Z]+)([0-9]+):' if column_name is None : column_name = list ( self . github_project_map . keys ( ) ) if isinstance ( column_name , list ) : for column in column_name : self . sort_cards ( column ) return elif isinstance ( column_name , github . ProjectColumn . ProjectColumn ) : column = column_name else : column = self . github_project_map [ column_name ] [ 'column' ] keymap = ( '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' ) def sort_cards ( card ) : if card . note : if card . note . startswith ( '###### Automation Rules' ) : return 'zzzz' + card . note return '0000' + card . note else : issue_name = card . get_content ( ) . title matches = re . findall ( regex_obj , issue_name ) if matches : return '' . join ( [ keymap [ int ( matches [ 0 ] [ 0 ] ) ] , matches [ 0 ] [ 1 ] , keymap [ int ( matches [ 0 ] [ 2 ] ) ] ] ) return '0000' + issue_name cards = sorted ( list ( column . get_cards ( ) ) , key = sort_cards ) self . edit_card ( cards [ 0 ] , position = 'top' ) for i in range ( 1 , len ( cards ) ) : self . edit_card ( cards [ i ] , position = ( 'after:%s' % cards [ i - 1 ] . id ) )
r"""Sort cards alphabetically and into appropriate columns,
putting automation cards at the bottom.
r " " " Sort cards alphabetically and into appropriate columns putting automation cards at the bottom .
r"""Sort cards alphabetically and into appropriate columns,
        putting automation cards at the bottom.

        Args:
            column_name (str, optional): Name of the column that should be
                sorted. None causes all columns to be sorted. Defaults to None.

        """
self
column_name
Name of the column that should be
sorted. None causes all columns to be sorted. Defaults to None.
Name of the column that should be sorted . None causes all columns to be sorted . Defaults to None .