got rid of some unnecessary regex in the fixtures function
This commit is contained in:
parent
f64b235eae
commit
15370c4a28
1 changed files with 22 additions and 20 deletions
|
|
@ -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)
|
||||
|
|
@ -285,9 +286,10 @@ def create_project():
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue