Changeset - 9d6cc55384fe
[Not reviewed]
default
0 8 0
Mads Kiilerich - 6 years ago 2020-02-09 19:46:43
mads@kiilerich.com
cleanup: mute some pyflakes "imported but unused" by adding asserts
8 files changed with 46 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli.py
Show inline comments
 
@@ -25,3 +25,8 @@ import kallithea.bin.kallithea_cli_repo
 
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
kallithea/bin/kallithea_cli_iis.py
Show inline comments
 
@@ -67,6 +67,7 @@ def iis_install(virtualdir):
 

	
 
    try:
 
        import isapi_wsgi
 
        assert isapi_wsgi
 
    except ImportError:
 
        sys.stderr.write('missing requirement: isapi-wsgi not installed\n')
 
        sys.exit(1)
kallithea/config/app_cfg.py
Show inline comments
 
@@ -113,6 +113,7 @@ base_config = KallitheaAppConfig()
 
try:
 
    from tgext.debugbar import enable_debugbar
 
    import kajiki # only to check its existence
 
    assert kajiki
 
except ImportError:
 
    pass
 
else:
kallithea/controllers/admin/settings.py
Show inline comments
 
@@ -120,6 +120,7 @@ class SettingsController(BaseController)
 
                if sett.ui_active:
 
                    try:
 
                        import hgsubversion  # pragma: no cover
 
                        assert hgsubversion
 
                    except ImportError:
 
                        raise HgsubversionImportError
 

	
kallithea/lib/celerypylons/__init__.py
Show inline comments
 
@@ -21,6 +21,12 @@ from celery.bin import worker
 
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"""
 

	
kallithea/lib/compat.py
Show inline comments
 
@@ -62,3 +62,8 @@ if os.name == 'nt': # Windows
 

	
 
else:
 
    kill = os.kill
 

	
 

	
 
# mute pyflakes "imported but unused"
 
assert hybrid_property
 
assert OrderedSet
kallithea/lib/helpers.py
Show inline comments
 
@@ -57,6 +57,25 @@ from kallithea.lib.vcs.exceptions import
 
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__)
 

	
 

	
kallithea/lib/utils2.py
Show inline comments
 
@@ -45,6 +45,14 @@ from kallithea.lib.vcs.utils import asci
 
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
0 comments (0 inline, 0 general)