From 2c339da2c685fa7c85bd39020d04d06e2848e808 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 29 Aug 2015 17:41:39 +0200 Subject: [PATCH] Linting code --- djangocms_installer/config/__init__.py | 4 ++-- djangocms_installer/config/data.py | 8 ++++---- djangocms_installer/config/ini.py | 2 +- djangocms_installer/install/__init__.py | 3 +-- djangocms_installer/share/starting_page.py | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/djangocms_installer/config/__init__.py b/djangocms_installer/config/__init__.py index da55850..c0475c0 100644 --- a/djangocms_installer/config/__init__.py +++ b/djangocms_installer/config/__init__.py @@ -78,7 +78,7 @@ def parse(args): # Advanced options. These have a predefined default and are not managed # by config wizard. - #parser.add_argument('--aldryn', '-a', dest='aldryn', action='store_true', + # parser.add_argument('--aldryn', '-a', dest='aldryn', action='store_true', # default=False, help="Use Aldryn-boilerplate as project template") parser.add_argument('--no-input', '-q', dest='noinput', action='store_true', default=False, help="Don't run the configuration wizard, just use the provided values") @@ -109,7 +109,7 @@ def parse(args): for action in parser._positionals._actions: if action.dest == 'timezone': action.default = 'UTC' - + # If config_args then pretend that config args came from the stdin and run parser again. config_args = ini.parse_config_file(parser, args) args = parser.parse_args(config_args + args) diff --git a/djangocms_installer/config/data.py b/djangocms_installer/config/data.py index dfd4d45..f6111ef 100644 --- a/djangocms_installer/config/data.py +++ b/djangocms_installer/config/data.py @@ -7,13 +7,13 @@ '--permissions', '--bootstrap', '--templates', '--starting-page'] -DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?%s' % time.time() ## to avoid getting this from caches or mirrors +DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?%s' % time.time() DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/3.0c2.zip' DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip' DJANGOCMS_SUPPORTED = ('2.4', '3.0', '3.1', 'stable', 'develop') -DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?%s' % time.time() ## to avoid getting this from caches or mirrors -DJANGO_BETA = 'https://github.com/django/django/archive/master.zip?%s' % time.time() ## to avoid getting this from caches or mirrors +DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?%s' % time.time() +DJANGO_BETA = 'https://github.com/django/django/archive/master.zip?%s' % time.time() DJANGO_SUPPORTED = ('1.4', '1.5', '1.6', '1.7', '1.8', 'stable') CMS_VERSION_MATRIX = { @@ -35,7 +35,7 @@ 3.2: (1.6, 1.8), } -REQUIREMENTS ={ +REQUIREMENTS = { 'default': [ 'django-classy-tags>=0.3.4.1', 'html5lib', diff --git a/djangocms_installer/config/ini.py b/djangocms_installer/config/ini.py index aaac42b..182334b 100644 --- a/djangocms_installer/config/ini.py +++ b/djangocms_installer/config/ini.py @@ -57,7 +57,7 @@ def dump_config_file(filename, args, parser=None): keys_empty_values_not_pass = ( '--extra-settings', '--languages', '--requirements', '--template', '--timezone') - #_positionals._option_string_actions + # positionals._option_string_actions for action in parser._actions: if action.dest in ('help', 'config_file', 'config_dump', 'project_name'): continue diff --git a/djangocms_installer/install/__init__.py b/djangocms_installer/install/__init__.py index 072db6c..aab1f62 100644 --- a/djangocms_installer/install/__init__.py +++ b/djangocms_installer/install/__init__.py @@ -20,7 +20,6 @@ def check_install(config_data): Many other errors will go undetected """ errors = [] - size = 128, 128 # PIL tests try: @@ -73,7 +72,7 @@ def cleanup(requirements): # pragma: no cover args = ['uninstall', '-q', '-y'] args.extend(requirements.split()) - exit_status = pip.main(args) + pip.main(args) return True diff --git a/djangocms_installer/share/starting_page.py b/djangocms_installer/share/starting_page.py index a81885f..abf9013 100644 --- a/djangocms_installer/share/starting_page.py +++ b/djangocms_installer/share/starting_page.py @@ -31,8 +31,8 @@ def create_pages(): try: # try to get a feature placeholder placeholder_feature = page.placeholders.get(slot='feature') - p = add_plugin(placeholder_feature, 'TextPlugin', lang, - body=content['feature']) + add_plugin(placeholder_feature, 'TextPlugin', lang, + body=content['feature']) except Placeholder.DoesNotExist: # fallback, add it to the add_plugin(placeholder['main'], 'TextPlugin', lang, body=content['feature']) @@ -57,4 +57,4 @@ def create_pages(): if __name__ == '__main__': if LooseVersion(django.get_version()) >= LooseVersion('1.7'): django.setup() - create_pages() \ No newline at end of file + create_pages()