changeset 8239:9d6cc55384fe

cleanup: mute some pyflakes "imported but unused" by adding asserts
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 09 Feb 2020 19:46:43 +0100
parents 27c4ad3e584f
children 51af7c12ffb1
files kallithea/bin/kallithea_cli.py kallithea/bin/kallithea_cli_iis.py kallithea/config/app_cfg.py kallithea/controllers/admin/settings.py kallithea/lib/celerypylons/__init__.py kallithea/lib/compat.py kallithea/lib/helpers.py kallithea/lib/utils2.py
diffstat 8 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/bin/kallithea_cli.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/bin/kallithea_cli.py	Sun Feb 09 19:46:43 2020 +0100
@@ -25,3 +25,8 @@
 import kallithea.bin.kallithea_cli_ssh
 # 'cli' is the main entry point for 'kallithea-cli', specified in setup.py as entry_points console_scripts
 from kallithea.bin.kallithea_cli_base import cli
+
+
+# mute pyflakes "imported but unused"
+assert kallithea.bin.kallithea_cli_ssh
+assert cli
--- a/kallithea/bin/kallithea_cli_iis.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/bin/kallithea_cli_iis.py	Sun Feb 09 19:46:43 2020 +0100
@@ -67,6 +67,7 @@
 
     try:
         import isapi_wsgi
+        assert isapi_wsgi
     except ImportError:
         sys.stderr.write('missing requirement: isapi-wsgi not installed\n')
         sys.exit(1)
--- a/kallithea/config/app_cfg.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/config/app_cfg.py	Sun Feb 09 19:46:43 2020 +0100
@@ -113,6 +113,7 @@
 try:
     from tgext.debugbar import enable_debugbar
     import kajiki # only to check its existence
+    assert kajiki
 except ImportError:
     pass
 else:
--- a/kallithea/controllers/admin/settings.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/controllers/admin/settings.py	Sun Feb 09 19:46:43 2020 +0100
@@ -120,6 +120,7 @@
                 if sett.ui_active:
                     try:
                         import hgsubversion  # pragma: no cover
+                        assert hgsubversion
                     except ImportError:
                         raise HgsubversionImportError
 
--- a/kallithea/lib/celerypylons/__init__.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/lib/celerypylons/__init__.py	Sun Feb 09 19:46:43 2020 +0100
@@ -21,6 +21,12 @@
 from celery.task import task
 
 
+# mute pyflakes "imported but unused"
+assert result
+assert worker
+assert task
+
+
 def celery_config(config):
     """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
 
--- a/kallithea/lib/compat.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/lib/compat.py	Sun Feb 09 19:46:43 2020 +0100
@@ -62,3 +62,8 @@
 
 else:
     kill = os.kill
+
+
+# mute pyflakes "imported but unused"
+assert hybrid_property
+assert OrderedSet
--- a/kallithea/lib/helpers.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/lib/helpers.py	Sun Feb 09 19:46:43 2020 +0100
@@ -57,6 +57,25 @@
 from kallithea.lib.vcs.utils import author_email, author_name
 
 
+# mute pyflakes "imported but unused"
+assert Option
+assert checkbox
+assert end_form
+assert password
+assert radio
+assert submit
+assert text
+assert textarea
+assert format_byte_size
+assert chop_at
+assert wrap_paragraphs
+assert HasPermissionAny
+assert HasRepoGroupPermissionLevel
+assert HasRepoPermissionLevel
+assert time_to_datetime
+assert EmptyChangeset
+
+
 log = logging.getLogger(__name__)
 
 
--- a/kallithea/lib/utils2.py	Sun Feb 09 19:42:16 2020 +0100
+++ b/kallithea/lib/utils2.py	Sun Feb 09 19:46:43 2020 +0100
@@ -45,6 +45,14 @@
 from kallithea.lib.vcs.utils.lazy import LazyProperty
 
 
+# mute pyflakes "imported but unused"
+assert ascii_bytes
+assert ascii_str
+assert safe_bytes
+assert safe_str
+assert LazyProperty
+
+
 def str2bool(_str):
     """
     returns True/False value from given string, it tries to translate the