updating for python3

This commit is contained in:
Ronny Abraham 2018-10-18 12:45:07 +03:00
parent 15ffc7ac8c
commit 4eba2cbf5a
8 changed files with 16 additions and 20 deletions

View file

@ -76,8 +76,6 @@ def setup_rootpath():
@task
def bootstrap():
import database as db
configuration = env.config
if env.debug:

View file

@ -8,6 +8,7 @@ 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 handle_help
import os
@ -145,7 +146,6 @@ def startapp(appname='help'):
\tappname - the name of the app you want to start
"""
from utils import handle_help
import sys
if handle_help(appname, msg_help, 'help'):
@ -317,7 +317,7 @@ def generate_scripts(template_name, make_copy=False):
backup_cmd = "cp {copy_full_path} " \
"{copy_full_path}.bak".format(copy_full_path=copy_full_path)
from utils import upload_template as utils_upload_template
from .utils import upload_template as utils_upload_template
if env.debug:
logger.debug("template_name : %s" % template_name)
@ -501,7 +501,7 @@ def generate_gunicorn(make_link=True):
logger.debug('\n%s' % print_run(msg_link_gunicorn))
from utils import upload_template as utils_upload_template
from .utils import upload_template as utils_upload_template
upload_msg = utils_upload_template(
filename=configuration.templates.gunicorn.conf.src,
@ -538,7 +538,7 @@ def edit(param='help'):
calls up mvim on the gunicorn conf file
"""
from maintenance import edit as maintenance_edit
from .maintenance import edit as maintenance_edit
configuration = env.config
@ -712,7 +712,7 @@ def fixtures(appname=None, backup=False):
print("debug - path_fixture: %s" % path_fixture)
from utils import ensure_dir
from .utils import ensure_dir
ensure_dir(path_data)
ensure_dir(path_backup)

View file

@ -21,8 +21,8 @@ def setup_virtualenv():
format='\n%(levelname)s: deploy.setup_virtualenv %(message)s',
level=logging.DEBUG)
mkvirtualenv_cmd = "mkvirtualenv --no-site-packages --python=`which python3` " \
"{virtualenv_name}".format(
mkvirtualenv_cmd = "mkvirtualenv --no-site-packages " \
"--python=`which python3` {virtualenv_name}".format(
virtualenv_name=configuration.virtualenv.name)
if env.debug:
@ -147,7 +147,7 @@ def freeze(param='help'):
\tFalse (default) - print the freeze output to the console
"""
from utils import booleanize, handle_help
from .utils import booleanize, handle_help
if handle_help(param, msg_help, 'help'):
sys.exit()
@ -209,7 +209,7 @@ def copyto(branch):
"This will simply copy over \n\tthe requirements file for "
"this branch with itself", ERROR_BAD_BRANCH_PARAM)
from initialize import get_config
from .initialize import get_config
branch_config = get_config(branch)
@ -228,10 +228,10 @@ def copyto(branch):
"destination branch '{branch_dst}'. Continue? Y/n ".format(
branch_src=configuration.project.branch, branch_dst=branch)
from utils import prompt_continue
from .utils import prompt_continue
prompt_continue(message=message)
from utils import upload_template
from .utils import upload_template
upload_template(
filename=configuration.virtualenv.requirements.filename,
destination=branch_local_path,

View file

@ -224,7 +224,7 @@ def upload():
logger.debug("run(%s)" % copy_command)
else:
import utils
from . import utils
utils.printvar("files_path", files_path)
upload_template(

View file

@ -3,7 +3,7 @@ BRANCH = '{{ project_branch }}'
from {{ project_name }}.settings import *
import initialize
from modules import initialize
import logging
LOCAL_LOGGING_PREFIX = "%s %%(message)s" % BRANCH

View file

@ -23,7 +23,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, os.pardir))
# infomration for the settings file
sys.path.insert(0, os.path.join(
PROJECT_ROOT, 'usr', 'bin', 'fabric', 'modules'))
PROJECT_ROOT, 'usr', 'bin', 'fabric'))
#
# add an "apps" directory to this project, which is where all the apps
@ -60,7 +60,6 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

View file

@ -3,7 +3,7 @@ BRANCH = '{{ project_branch }}'
from {{ project_name }}.settings import *
import initialize
from modules import initialize
import logging
LOCAL_LOGGING_PREFIX = "%s %%(message)s" % BRANCH

View file

@ -23,7 +23,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, os.pardir))
# infomration for the settings file
sys.path.insert(0, os.path.join(
PROJECT_ROOT, 'usr', 'bin', 'fabric', 'modules'))
PROJECT_ROOT, 'usr', 'bin', 'fabric'))
#
# add an "apps" directory to this project, which is where all the apps
@ -60,7 +60,6 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]