Changeset - bdb79ef2c879
[Not reviewed]
default
0 7 0
Mads Kiilerich - 6 years ago 2019-12-26 05:17:09
mads@kiilerich.com
Grafted from: ca11709d4a95
py3: drop .keys when we don't need them

In python 3 they will be iterators and mostly useless ... but they are already
mostly redundant in py2.
7 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changelog.py
Show inline comments
 
@@ -134,11 +134,11 @@ class ChangelogController(BaseRepoContro
 

	
 
        c.branch_name = branch_name
 
        c.branch_filters = [('', _('None'))] + \
 
            [(k, k) for k in c.db_repo_scm_instance.branches.keys()]
 
            [(k, k) for k in c.db_repo_scm_instance.branches]
 
        if c.db_repo_scm_instance.closed_branches:
 
            prefix = _('(closed)') + ' '
 
            c.branch_filters += [('-', '-')] + \
 
                [(k, prefix + k) for k in c.db_repo_scm_instance.closed_branches.keys()]
 
                [(k, prefix + k) for k in c.db_repo_scm_instance.closed_branches]
 
        revs = []
 
        if not f_path:
 
            revs = [x.revision for x in c.cs_pagination]
kallithea/lib/indexers/daemon.py
Show inline comments
 
@@ -331,8 +331,8 @@ class WhooshIndexingDaemon(object):
 
                    log.debug('>> NOTHING TO COMMIT TO CHANGESET INDEX<<')
 

	
 
    def update_file_index(self):
 
        log.debug((u'STARTING INCREMENTAL INDEXING UPDATE FOR EXTENSIONS %s '
 
                   'AND REPOS %s') % (INDEX_EXTENSIONS, self.repo_paths.keys()))
 
        log.debug(u'STARTING INCREMENTAL INDEXING UPDATE FOR EXTENSIONS %s '
 
                  'AND REPOS %s', INDEX_EXTENSIONS, ' and '.join(self.repo_paths))
 

	
 
        idx = open_dir(self.index_location, indexname=self.indexname)
 
        # The set of all paths in the index
 
@@ -432,7 +432,7 @@ class WhooshIndexingDaemon(object):
 
        file_idx = create_in(self.index_location, SCHEMA, indexname=IDX_NAME)
 
        file_idx_writer = file_idx.writer()
 
        log.debug('BUILDING INDEX FOR EXTENSIONS %s '
 
                  'AND REPOS %s' % (INDEX_EXTENSIONS, self.repo_paths.keys()))
 
                  'AND REPOS %s', INDEX_EXTENSIONS, ' and '.join(self.repo_paths))
 

	
 
        for repo_name, repo in sorted(self.repo_paths.items()):
 
            log.debug('Updating indices for repo %s', repo_name)
kallithea/lib/vcs/backends/__init__.py
Show inline comments
 
@@ -9,7 +9,6 @@
 
    :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
 
"""
 
import os
 
from pprint import pformat
 

	
 
from kallithea.lib.vcs.conf import settings
 
from kallithea.lib.vcs.exceptions import VCSError
 
@@ -51,7 +50,7 @@ def get_backend(alias):
 
    """
 
    if alias not in settings.BACKENDS:
 
        raise VCSError("Given alias '%s' is not recognized! Allowed aliases:\n"
 
            "%s" % (alias, pformat(settings.BACKENDS.keys())))
 
            "%s" % (alias, '", "'.join(settings.BACKENDS)))
 
    backend_path = settings.BACKENDS[alias]
 
    klass = import_class(backend_path)
 
    return klass
kallithea/lib/vcs/utils/termcolors.py
Show inline comments
 
@@ -188,7 +188,7 @@ def parse_color_setting(config_string):
 
                definition['bg'] = colors[-1]
 

	
 
            # All remaining instructions are options
 
            opts = tuple(s for s in styles if s in opt_dict.keys())
 
            opts = tuple(s for s in styles if s in opt_dict)
 
            if opts:
 
                definition['opts'] = opts
 

	
kallithea/model/db.py
Show inline comments
 
@@ -74,6 +74,7 @@ class BaseDbModel(object):
 
    @classmethod
 
    def _get_keys(cls):
 
        """return column names for this model """
 
        # Note: not a normal dict - iterator gives "users.firstname", but keys gives "firstname"
 
        return class_mapper(cls).c.keys()
 

	
 
    def get_dict(self):
kallithea/model/notification.py
Show inline comments
 
@@ -177,7 +177,7 @@ class EmailNotificationModel(object):
 
        try:
 
            subj = tmpl % kwargs
 
        except KeyError as e:
 
            log.error('error generating email subject for %r from %s: %s', type_, ','.join(self._subj_map.keys()), e)
 
            log.error('error generating email subject for %r from %s: %s', type_, ', '.join(self._subj_map), e)
 
            raise
 
        # gmail doesn't do proper threading but will ignore leading square
 
        # bracket content ... so that is where we put status info
kallithea/templates/base/perms_summary.html
Show inline comments
 
@@ -5,7 +5,7 @@
 

	
 
<%def name="perms_summary(permissions, show_all=False, actions=True)">
 
<div id="perms">
 
     %for section in sorted(permissions.keys()):
 
     %for section in sorted(permissions):
 
        <div class="perms_section_head">
 
            <h4>${section.replace("_"," ").capitalize()}</h4>
 
            %if section != 'global':
0 comments (0 inline, 0 general)