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
 
@@ -22,6 +22,11 @@ import kallithea.bin.kallithea_cli_iis
 
import kallithea.bin.kallithea_cli_index
 
import kallithea.bin.kallithea_cli_ishell
 
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
 
@@ -64,12 +64,13 @@ def iis_install(virtualdir):
 
    """Install into IIS using isapi-wsgi."""
 

	
 
    config_file_abs = kallithea.CONFIG['__file__']
 

	
 
    try:
 
        import isapi_wsgi
 
        assert isapi_wsgi
 
    except ImportError:
 
        sys.stderr.write('missing requirement: isapi-wsgi not installed\n')
 
        sys.exit(1)
 

	
 
    dispatchfile = os.path.join(os.getcwd(), 'dispatch.py')
 
    click.echo('Writing %s' % dispatchfile)
kallithea/config/app_cfg.py
Show inline comments
 
@@ -110,12 +110,13 @@ base_config = KallitheaAppConfig()
 
# To enable it, install 'tgext.debugbar' and 'kajiki', and run Kallithea with
 
# 'debug = true' (not in production!)
 
# See the Kallithea documentation for more information.
 
try:
 
    from tgext.debugbar import enable_debugbar
 
    import kajiki # only to check its existence
 
    assert kajiki
 
except ImportError:
 
    pass
 
else:
 
    base_config['renderers'].append('kajiki')
 
    enable_debugbar(base_config)
 

	
kallithea/controllers/admin/settings.py
Show inline comments
 
@@ -117,12 +117,13 @@ class SettingsController(BaseController)
 

	
 
                sett = Ui.get_or_create('extensions', 'hgsubversion')
 
                sett.ui_active = form_result['extensions_hgsubversion']
 
                if sett.ui_active:
 
                    try:
 
                        import hgsubversion  # pragma: no cover
 
                        assert hgsubversion
 
                    except ImportError:
 
                        raise HgsubversionImportError
 

	
 
#                sett = Ui.get_or_create('extensions', 'hggit')
 
#                sett.ui_active = form_result['extensions_hggit']
 

	
kallithea/lib/celerypylons/__init__.py
Show inline comments
 
@@ -18,12 +18,18 @@ import celery
 
import celery.result as result
 
import tg
 
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"""
 

	
 
    # Verify .ini file configuration has been loaded
 
    assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded'
 

	
kallithea/lib/compat.py
Show inline comments
 
@@ -59,6 +59,11 @@ if os.name == 'nt': # Windows
 
        kernel32 = ctypes.windll.kernel32
 
        handle = kernel32.OpenProcess(1, 0, pid)
 
        return (0 != kernel32.TerminateProcess(handle, 0))
 

	
 
else:
 
    kill = os.kill
 

	
 

	
 
# mute pyflakes "imported but unused"
 
assert hybrid_property
 
assert OrderedSet
kallithea/lib/helpers.py
Show inline comments
 
@@ -54,12 +54,31 @@ from kallithea.lib.vcs.exceptions import
 
#==============================================================================
 
# SCM FILTERS available via h.
 
#==============================================================================
 
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__)
 

	
 

	
 
def canonical_url(*args, **kargs):
 
    '''Like url(x, qualified=True), but returns url that not only is qualified
 
    but also canonical, as configured in canonical_url'''
kallithea/lib/utils2.py
Show inline comments
 
@@ -42,12 +42,20 @@ from tg.i18n import ungettext
 
from webhelpers2.text import collapse, remove_formatting, strip_tags
 

	
 
from kallithea.lib.vcs.utils import ascii_bytes, ascii_str, safe_bytes, safe_str  # re-export
 
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
 
    string into boolean
 

	
 
    :param _str: string value to translate into boolean
0 comments (0 inline, 0 general)