diff --git a/modules/django.py b/modules/django.py index e4294d3..16fc37a 100644 --- a/modules/django.py +++ b/modules/django.py @@ -52,11 +52,11 @@ def commandline(args="", workingdir=None): args=args, djangosettings=configuration.imports.settings,) else: - commandline = "{djangoroot}/manage.py {args} --pythonpath='{djangoroot}'" \ - " --settings={djangosettings}".format( - djangoroot=configuration.paths.django.root, - args=args, - djangosettings=configuration.imports.settings,) + commandline = "{djangoroot}/manage.py {args} --pythonpath='"\ + "{djangoroot}' --settings={djangosettings}".format( + djangoroot=configuration.paths.django.root, + args=args, + djangosettings=configuration.imports.settings,) print(commandline) @@ -89,11 +89,12 @@ def manage(args="", workingdir=None): shell='/bin/bash') with cd(configuration.paths.django.root): - cmd = "{djangoroot}/manage.py {args} --pythonpath='{djangoroot}' " \ - "--settings={djangosettings}".format( - djangoroot=configuration.paths.django.root, - args=args, - djangosettings=configuration.imports.settings,) + cmd = "{djangoroot}/manage.py {args} " \ + " --pythonpath='{djangoroot}' " \ + "--settings={djangosettings}".format( + djangoroot=configuration.paths.django.root, + args=args, + djangosettings=configuration.imports.settings,) if env.debug: print("command: with cd(%s)" % configuration.paths.django.root) @@ -282,12 +283,13 @@ def create_project(): project_path_old = "{project_path}/{project_name}.old".format( project_path=project_path, project_name=project_name) - + if exists(project_path_old): prompt_continue( - message="found an already existing old version of " - "{project_path}, do you want to ignore backing up the version or exit? Y/n" - "( Y to continue without backing up. N to exit )", default="n") + message="found an already existing old " + "version of {project_path}, do you want to ignore" + " backing up the version or exit? Y/n ( Y to " + "continue without backing up. N to exit )", default="n") fabric_ops.run("rm -Rf {project_path}/{project_name}".format( project_name=project_name, @@ -880,7 +882,7 @@ def fixtures(appname=None, backup=False): try: pos = match.end() output = output[pos:] - except: + except Exception: pass # now find the first occurence of [ on a newline, e.g. @@ -889,12 +891,12 @@ def fixtures(appname=None, backup=False): # "model.auth": 40, # etc. - p = re.compile(r"\n\[") - m = p.search(output) - pos = m.end() - 1 - output = output[pos:] + # p = re.compile(r"\n\[") + # m = p.search(output) + # pos = m.end() - 1 + # output = output[pos:] - from StringIO import StringIO + from io import StringIO fixture_iostring = StringIO(output) fabric_ops.put(fixture_iostring, path_fixture)