Changeset - c1ed9572b965
[Not reviewed]
default
0 10 0
Lars Kruse - 8 years ago 2017-08-25 14:33:37
devel@sumpfralle.de
codingstyle: replace "not ... in ..." with "... not in ..."

Reported by flake8.
10 files changed with 16 insertions and 16 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth_modules/auth_crowd.py
Show inline comments
 
@@ -52,7 +52,7 @@ class CrowdServer(object):
 
                                  passwd="some_passwd",
 
                                  version="1")
 
        """
 
        if not "port" in kwargs:
 
        if "port" not in kwargs:
 
            kwargs["port"] = "8095"
 
        self._logger = kwargs.get("logger", logging.getLogger(__name__))
 
        self._uri = "%s://%s:%s/crowd" % (kwargs.get("method", "http"),
kallithea/lib/indexers/daemon.py
Show inline comments
 
@@ -353,7 +353,7 @@ class WhooshIndexingDaemon(object):
 
                    indexed_repo_path = fields['repository']
 
                    indexed_paths.add(indexed_path)
 

	
 
                    if not indexed_repo_path in self.filtered_repo_update_paths:
 
                    if indexed_repo_path not in self.filtered_repo_update_paths:
 
                        continue
 

	
 
                    repo = self.repo_paths[indexed_repo_path]
kallithea/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -110,7 +110,7 @@ class GitChangeset(BaseChangeset):
 
    def _get_id_for_path(self, path):
 
        path = safe_str(path)
 
        # FIXME: Please, spare a couple of minutes and make those codes cleaner;
 
        if not path in self._paths:
 
        if path not in self._paths:
 
            path = path.strip('/')
 
            # set root tree
 
            tree = self.repository._repo[self._tree_id]
 
@@ -155,7 +155,7 @@ class GitChangeset(BaseChangeset):
 
                        name = item
 
                    self._paths[name] = id
 
                    self._stat_modes[name] = stat
 
            if not path in self._paths:
 
            if path not in self._paths:
 
                raise NodeDoesNotExistError("There is no file nor directory "
 
                    "at the given path '%s' at revision %s"
 
                    % (path, safe_str(self.short_id)))
 
@@ -423,7 +423,7 @@ class GitChangeset(BaseChangeset):
 
                                     "or Blob, is %r" % type(obj))
 
        nodes = dirnodes + filenodes
 
        for node in nodes:
 
            if not node.path in self.nodes:
 
            if node.path not in self.nodes:
 
                self.nodes[node.path] = node
 
        nodes.sort()
 
        return nodes
 
@@ -432,7 +432,7 @@ class GitChangeset(BaseChangeset):
 
        if isinstance(path, unicode):
 
            path = path.encode('utf-8')
 
        path = self._fix_path(path)
 
        if not path in self.nodes:
 
        if path not in self.nodes:
 
            try:
 
                id_ = self._get_id_for_path(path)
 
            except ChangesetError:
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -214,7 +214,7 @@ class GitRepository(BaseRepository):
 

	
 
        # now detect if it's proper git repo
 
        gitdata = resp.read()
 
        if not 'service=git-upload-pack' in gitdata:
 
        if 'service=git-upload-pack' not in gitdata:
 
            raise urllib2.URLError(
 
                "url [%s] does not look like an git" % (cleaned_uri))
 

	
 
@@ -329,7 +329,7 @@ class GitRepository(BaseRepository):
 
        filesystem (``file:///``) schema.
 
        """
 
        url = safe_str(url)
 
        if url != 'default' and not '://' in url:
 
        if url != 'default' and '://' not in url:
 
            url = ':///'.join(('file', url))
 
        return url
 

	
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -377,7 +377,7 @@ class MercurialChangeset(BaseChangeset):
 

	
 
        path = self._fix_path(path)
 

	
 
        if not path in self.nodes:
 
        if path not in self.nodes:
 
            if path in self._file_paths:
 
                node = FileNode(path, changeset=self)
 
            elif path in self._dir_paths or path in self._dir_paths:
kallithea/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -482,7 +482,7 @@ class MercurialRepository(BaseRepository
 
        (``file:///``) schema.
 
        """
 
        url = safe_str(url)
 
        if url != 'default' and not '://' in url:
 
        if url != 'default' and '://' not in url:
 
            url = "file:" + urllib.pathname2url(url)
 
        return url
 

	
kallithea/lib/vcs/utils/__init__.py
Show inline comments
 
@@ -189,7 +189,7 @@ def author_name(author):
 
    """
 
    if not author:
 
        return ''
 
    if not '@' in author:
 
    if '@' not in author:
 
        return author
 
    return author.replace(author_email(author), '').replace('<', '') \
 
        .replace('>', '').strip()
kallithea/lib/vcs/utils/helpers.py
Show inline comments
 
@@ -139,7 +139,7 @@ def parse_changesets(text):
 
    """
 
    text = text.strip()
 
    CID_RE = r'[a-zA-Z0-9]+'
 
    if not '..' in text:
 
    if '..' not in text:
 
        m = re.match(r'^(?P<cid>%s)$' % CID_RE, text)
 
        if m:
 
            return {
kallithea/tests/models/test_notifications.py
Show inline comments
 
@@ -103,7 +103,7 @@ class TestNotifications(TestController):
 
            Session().commit()
 

	
 
            notifications = Notification.query().all()
 
            assert not notification in notifications
 
            assert notification not in notifications
 

	
 
            un = UserNotification.query().filter(UserNotification.notification
 
                                                 == notification).all()
kallithea/tests/models/test_repo_groups.py
Show inline comments
 
@@ -24,11 +24,11 @@ def _update_repo_group(id_, group_name, 
 

	
 

	
 
def _update_repo(name, **kwargs):
 
    if not 'repo_name' in kwargs:
 
    if 'repo_name' not in kwargs:
 
        kwargs['repo_name'] = name
 
    if not 'perms_new' in kwargs:
 
    if 'perms_new' not in kwargs:
 
        kwargs['perms_new'] = []
 
    if not 'perms_updates' in kwargs:
 
    if 'perms_updates' not in kwargs:
 
        kwargs['perms_updates'] = []
 
    r = RepoModel().update(name, **kwargs)
 
    return r
0 comments (0 inline, 0 general)