changeset 8036:e7b6a0ce123c

cleanup: minor formatting
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 27 Dec 2019 01:43:46 +0100
parents eefb46488667
children 1522a33ac21f
files kallithea/lib/utils.py kallithea/lib/utils2.py kallithea/lib/vcs/backends/git/inmemory.py kallithea/lib/vcs/backends/git/repository.py kallithea/lib/vcs/subprocessio.py kallithea/lib/vcs/utils/__init__.py
diffstat 6 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/utils.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/utils.py	Fri Dec 27 01:43:46 2019 +0100
@@ -376,7 +376,6 @@
     :param config:
     """
     hgsettings = Setting.get_app_settings()
-
     for k, v in hgsettings.items():
         config[k] = v
 
--- a/kallithea/lib/utils2.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/utils2.py	Fri Dec 27 01:43:46 2019 +0100
@@ -154,12 +154,10 @@
     :param val:
     :param default:
     """
-
     try:
         val = int(val)
     except (ValueError, TypeError):
         val = default
-
     return val
 
 
--- a/kallithea/lib/vcs/backends/git/inmemory.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/vcs/backends/git/inmemory.py	Fri Dec 27 01:43:46 2019 +0100
@@ -184,8 +184,8 @@
                         return obj
                     else:
                         raise RepositoryError("Cannot create directory %s "
-                        "at tree %s as path is occupied and is not a "
-                        "Tree" % (dirname, tree))
+                            "at tree %s as path is occupied and is not a "
+                            "Tree" % (dirname, tree))
             return None
 
         trees = []
--- a/kallithea/lib/vcs/backends/git/repository.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/vcs/backends/git/repository.py	Fri Dec 27 01:43:46 2019 +0100
@@ -214,7 +214,7 @@
         gitdata = resp.read()
         if 'service=git-upload-pack' not in gitdata:
             raise urllib2.URLError(
-                "url [%s] does not look like an git" % (cleaned_uri))
+                "url [%s] does not look like an git" % cleaned_uri)
 
         return True
 
--- a/kallithea/lib/vcs/subprocessio.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/vcs/subprocessio.py	Fri Dec 27 01:43:46 2019 +0100
@@ -377,8 +377,7 @@
                 bg_out = iter([out])
                 _p = None
             elif err:
-                raise EnvironmentError(
-                    "Subprocess exited due to an error:\n" + err)
+                raise EnvironmentError("Subprocess exited due to an error: %s" % err)
             else:
                 raise EnvironmentError(
                     "Subprocess exited with non 0 ret code: %s" % returncode)
--- a/kallithea/lib/vcs/utils/__init__.py	Wed Dec 25 23:03:28 2019 +0100
+++ b/kallithea/lib/vcs/utils/__init__.py	Fri Dec 27 01:43:46 2019 +0100
@@ -25,7 +25,7 @@
     :param sep:
     :param strip:
     """
-    if isinstance(obj, (basestring)):
+    if isinstance(obj, basestring):
         lst = obj.split(sep)
         if strip:
             lst = [v.strip() for v in lst]