updated print funcs
This commit is contained in:
parent
dc02488e8b
commit
a5677a96a0
11 changed files with 41 additions and 41 deletions
|
|
@ -3,7 +3,7 @@ from fabric.operations import run, put
|
|||
from fabric.api import env, task
|
||||
import os
|
||||
|
||||
from maintenance import _get_configuration_path, load_configuration
|
||||
from .maintenance import _get_configuration_path, load_configuration
|
||||
|
||||
|
||||
@task
|
||||
|
|
@ -297,7 +297,7 @@ def edit(param='help'):
|
|||
else:
|
||||
# if param == 'help':
|
||||
|
||||
print """
|
||||
print("""
|
||||
"fab configuration.edit" automates opening up and editing project
|
||||
configuration files
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ def edit(param='help'):
|
|||
parameter
|
||||
|
||||
currently editable locations are:
|
||||
"""
|
||||
""")
|
||||
|
||||
for k_loc in locations.keys():
|
||||
print("\t{0: <20} - {1}".format(k_loc, locations[k_loc]['desc']))
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from fabric.api import env, task
|
||||
# # from jinja2 import Environment
|
||||
import os
|
||||
from utils import upload_template as utils_upload_template
|
||||
from utils import loggify, print_console, booleanize
|
||||
from .utils import upload_template as utils_upload_template
|
||||
from .utils import loggify, print_console, booleanize
|
||||
# from utils import prompt_continue
|
||||
from getpass import getpass
|
||||
import fabric.operations as fabric_ops
|
||||
|
|
@ -554,7 +554,7 @@ def edit(param='help'):
|
|||
remote_path = locations[param]['path']
|
||||
maintenance_edit(remote_path=remote_path)
|
||||
else:
|
||||
print """
|
||||
print("""
|
||||
"fab database.edit" automates editing files important to django whether
|
||||
locally or remotely
|
||||
|
||||
|
|
@ -562,7 +562,7 @@ def edit(param='help'):
|
|||
parameter
|
||||
|
||||
currently editable locations are:
|
||||
"""
|
||||
""")
|
||||
|
||||
for k_loc in locations.keys():
|
||||
print("\t{0: <20} - {1}".format(
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ from fabric.operations import local
|
|||
# from fabric.contrib.files import upload_template
|
||||
# from utils import print_run
|
||||
|
||||
from utils import virtualenv_source, booleanize, loggify
|
||||
from utils import print_console
|
||||
from .utils import virtualenv_source, booleanize, loggify
|
||||
from .utils import print_console
|
||||
|
||||
from pip import setup_virtualenv
|
||||
from pip import bootstrap_pip
|
||||
from .pip import setup_virtualenv
|
||||
from .pip import bootstrap_pip
|
||||
|
||||
import os
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ def sync(full=True, extras=False):
|
|||
# either SYNCING TO OR FROM, then just exit at this point
|
||||
|
||||
if configuration.project.branch == "development":
|
||||
print """
|
||||
print("""
|
||||
------------------------------------
|
||||
NOTE: this is a hack for the function deploy.sync()
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ def sync(full=True, extras=False):
|
|||
Right after this message gets printed, the sync function is told to
|
||||
"return" without any arguments
|
||||
------------------------------------\n
|
||||
"""
|
||||
""")
|
||||
|
||||
#
|
||||
# exit the function without any arguments
|
||||
|
|
@ -617,7 +617,7 @@ def remove(full=True):
|
|||
|
||||
import sys
|
||||
if env.branch == "development" and not env.debug and full:
|
||||
print """
|
||||
print("""
|
||||
------------------------------
|
||||
WARNING:
|
||||
|
||||
|
|
@ -628,7 +628,7 @@ def remove(full=True):
|
|||
|
||||
Exiting NOW.
|
||||
--------------------------------
|
||||
"""
|
||||
""")
|
||||
sys.exit()
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import fabric.operations as fabric_ops
|
|||
from fabric.contrib.files import exists
|
||||
|
||||
|
||||
from utils import loggify, print_run, booleanize
|
||||
from utils import generate_template_build_path
|
||||
from utils import generate_template_files_path
|
||||
from .utils import loggify, print_run, booleanize
|
||||
from .utils import generate_template_build_path
|
||||
from .utils import generate_template_files_path
|
||||
|
||||
import os
|
||||
|
||||
|
|
@ -42,8 +42,8 @@ def commandline(args=""):
|
|||
"""
|
||||
configuration = env.config
|
||||
|
||||
commandline = "{djangoroot}/manage.py {args} --pythonpath='{djangoroot}' " \
|
||||
"--settings={djangosettings}".format(
|
||||
commandline = "{djangoroot}/manage.py {args} --pythonpath='{djangoroot}'" \
|
||||
" --settings={djangosettings}".format(
|
||||
djangoroot=configuration.paths.django.root,
|
||||
args=args,
|
||||
djangosettings=configuration.imports.settings,)
|
||||
|
|
@ -599,7 +599,7 @@ def edit(param='help'):
|
|||
else:
|
||||
# if param == 'help':
|
||||
|
||||
print """
|
||||
print("""
|
||||
"fab django.edit" automates editing files important to django whether
|
||||
locally or remotely
|
||||
|
||||
|
|
@ -607,7 +607,7 @@ def edit(param='help'):
|
|||
parameter
|
||||
|
||||
currently editable locations are:
|
||||
"""
|
||||
""")
|
||||
|
||||
for k_loc in locations.keys():
|
||||
print("\t{0: <20} - {1}".format(k_loc, locations[k_loc]['desc']))
|
||||
|
|
@ -618,7 +618,7 @@ def edit(param='help'):
|
|||
@task
|
||||
def clearmigrations(appname="help"):
|
||||
if appname == "help":
|
||||
print """
|
||||
print("""
|
||||
"fab django.clearmigration:{appname}" clears out all migrations for the
|
||||
specified appname
|
||||
|
||||
|
|
@ -627,7 +627,7 @@ def clearmigrations(appname="help"):
|
|||
|
||||
Note: if your appname is actually "help" you might want to go into this
|
||||
function and change it up a bit!
|
||||
"""
|
||||
""")
|
||||
return
|
||||
|
||||
configuration = env.config
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from fabric.operations import run
|
|||
|
||||
from fabric.contrib.files import upload_template
|
||||
|
||||
from utils import loggify, generate_template_files_path, booleanize
|
||||
from utils import generate_template_build_path, print_console
|
||||
from .utils import loggify, generate_template_files_path, booleanize
|
||||
from .utils import generate_template_build_path, print_console
|
||||
|
||||
|
||||
@task
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ def environment(branchname):
|
|||
|
||||
host = env.config.server.database.host
|
||||
|
||||
from docker import docker_ip
|
||||
from .docker import docker_ip
|
||||
if host == 'docker':
|
||||
env.config.server.database.host = docker_ip()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import os
|
|||
import sys
|
||||
|
||||
from . import utils
|
||||
from utils import executize, virtualenv, loggify
|
||||
from .utils import executize, virtualenv, loggify
|
||||
|
||||
|
||||
def command(program=None, cmd=None, extra_param=None):
|
||||
|
|
@ -210,7 +210,7 @@ def load_configuration(name, branch):
|
|||
elif name == "layout":
|
||||
file_path = _get_configuration_path('layout', branch)
|
||||
|
||||
configuration_file = yaml.load(file(file_path, 'r'))
|
||||
configuration_file = yaml.load(open(file_path, 'r'))
|
||||
return configuration_file
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ from fabric.operations import sudo
|
|||
import os
|
||||
# import sys
|
||||
|
||||
from maintenance import command as maintenance_command
|
||||
from maintenance import edit as maintenance_edit
|
||||
from .maintenance import command as maintenance_command
|
||||
from .maintenance import edit as maintenance_edit
|
||||
|
||||
from utils import loggify
|
||||
from .utils import loggify
|
||||
|
||||
|
||||
@task
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import sys
|
|||
import os
|
||||
import logging
|
||||
|
||||
from utils import virtualenv_source, virtualenv
|
||||
from utils import print_console, printerr
|
||||
from .utils import virtualenv_source, virtualenv
|
||||
from .utils import print_console, printerr
|
||||
|
||||
ERROR_BAD_BRANCH_PARAM = -3
|
||||
ERROR_BAD_PARAM = -2
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ from fabric.operations import sudo, run
|
|||
|
||||
import os
|
||||
|
||||
from maintenance import command as maintenance_command
|
||||
from maintenance import edit as maintenance_edit
|
||||
from .maintenance import command as maintenance_command
|
||||
from .maintenance import edit as maintenance_edit
|
||||
|
||||
from utils import loggify
|
||||
from .utils import loggify
|
||||
|
||||
|
||||
def _initialize(configuration):
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ def ensure_dir(directory):
|
|||
print("creating directory: %s" % directory)
|
||||
os.makedirs(directory)
|
||||
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
print("Error occurred while creating directory: %s"
|
||||
% directory)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue