Merge pull request #205 from imanhodjaev/master

Cleanup: IO and formatting
This commit is contained in:
2017-02-08 14:24:42 -06:00
committed by GitHub
4 changed files with 10 additions and 7 deletions
+3 -3
View File
@@ -209,7 +209,7 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals
else:
if not bare:
click.echo(crayons.yellow('Installing dependencies from Pipfile.lock...'))
with open(project.lockfile_location, 'r') as f:
with open(project.lockfile_location) as f:
lockfile = json.load(f)
# Install default dependencies, always.
@@ -224,7 +224,7 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals
# --requirements was passed.
if requirements:
with open(deps_path, 'r') as f:
with open(deps_path) as f:
click.echo(f.read())
sys.exit(0)
@@ -679,7 +679,7 @@ def format_pip_output(out, r=None):
def easter_egg(package_name):
if package_name in ['requests', 'maya', 'crayons', 'delegator.py' 'records', 'tablib']:
click.echo('P.S. You have excellent taste! ✨ 🍰 ✨')
click.echo(u'P.S. You have excellent taste! ✨ 🍰 ✨')
@click.group(invoke_without_command=True)
+2 -1
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys
import os
import platform
@@ -16,7 +17,7 @@ def format_full_version(info):
if hasattr(sys, 'implementation'):
implementation_version = format_full_version(sys.implementation.version)
else:
implementation_version = "0"
implementation_version = '0'
# Default to cpython for 2.7.
if hasattr(sys, 'implementation'):
+4 -3
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import json
import os
@@ -68,7 +69,7 @@ class Project(object):
@property
def proper_names(self):
with open(self.proper_names_location, 'r') as f:
with open(self.proper_names_location) as f:
return f.read().splitlines()
def register_proper_name(self, name):
@@ -85,7 +86,7 @@ class Project(object):
@property
def parsed_pipfile(self):
with open(self.pipfile_location, 'r') as f:
with open(self.pipfile_location) as f:
# return toml.load(f)
return toml.load(f, _dict=OrderedDict)
@@ -99,7 +100,7 @@ class Project(object):
@property
def lockfile_content(self):
with open(self.lockfile_location, 'r') as lock:
with open(self.lockfile_location) as lock:
return json.load(lock)
def create_pipfile(self):
+1
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os
import tempfile