From a3e3df3e3336234b5812d6f0d2b890f3469ab54f Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 14 Jan 2017 21:30:36 +0100 Subject: [PATCH] Clean up fabfile --- fabfile.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/fabfile.py b/fabfile.py index 90b9880f1..588d42e9d 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,21 +1,18 @@ -from __future__ import print_function +# coding: utf-8 +from __future__ import unicode_literals, print_function from fabric.api import local, lcd, env, settings, prefix -from os.path import exists as file_exists from fabtools.python import virtualenv -from os import path -import os -import shutil -from pathlib import Path +from os import path, environ PWD = path.dirname(__file__) -ENV = os.environ["VENV_DIR"] if 'VENV_DIR' in os.environ else '.env' +ENV = environ['VENV_DIR'] if 'VENV_DIR' in environ else '.env' VENV_DIR = path.join(PWD, ENV) -def env(lang="python2.7"): - if file_exists(VENV_DIR): +def env(lang='python2.7'): + if path.exists(VENV_DIR): local('rm -rf {env}'.format(env=VENV_DIR)) local('virtualenv -p {lang} {env}'.format(lang=lang, env=VENV_DIR))