from __future__ import print_function
and print errors and warnings to sys.stderr
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
from paver.easy import *
|
||||
|
||||
@@ -31,13 +32,21 @@ def doc_path(options, allow_default=True):
|
||||
path = DOC_PATHS.get(doc_type)
|
||||
|
||||
if doc_type == 'default' and not allow_default:
|
||||
print "You must specify a documentation type using '--type'. Valid options are: {options}".format(
|
||||
options=valid_doc_types())
|
||||
print(
|
||||
"You must specify a documentation type using '--type'. "
|
||||
"Valid options are: {options}".format(
|
||||
options=valid_doc_types()
|
||||
)
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
if path is None:
|
||||
print "Invalid documentation type '{doc_type}'. Valid options are: {options}".format(
|
||||
doc_type=doc_type, options=valid_doc_types())
|
||||
print(
|
||||
"Invalid documentation type '{doc_type}'. "
|
||||
"Valid options are: {options}".format(
|
||||
doc_type=doc_type, options=valid_doc_types()
|
||||
)
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
else:
|
||||
|
||||
@@ -89,7 +89,7 @@ def prereq_cache(cache_name, paths, install_func):
|
||||
cache_file.write(new_hash)
|
||||
|
||||
else:
|
||||
print '{cache} unchanged, skipping...'.format(cache=cache_name)
|
||||
print('{cache} unchanged, skipping...'.format(cache=cache_name))
|
||||
|
||||
|
||||
def install_ruby_prereqs():
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"""
|
||||
Run and manage servers for local development.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import argparse
|
||||
from paver.easy import *
|
||||
from .utils.cmd import django_cmd
|
||||
@@ -21,7 +22,7 @@ def run_server(system, settings=None, port=None, skip_assets=False):
|
||||
If `skip_assets` is True, skip the asset compilation step.
|
||||
"""
|
||||
if system not in ['lms', 'studio']:
|
||||
print "System must be either lms or studio"
|
||||
print("System must be either lms or studio", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
if not skip_assets:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Helper functions for loading environment settings.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
@@ -34,7 +35,11 @@ class Env(object):
|
||||
|
||||
# If the file does not exist, issue a warning and return an empty dict
|
||||
if not os.path.isfile(env_path):
|
||||
print "Warning: could not find environment JSON file at '{path}'".format(path=env_path)
|
||||
print(
|
||||
"Warning: could not find environment JSON file "
|
||||
"at '{path}'".format(path=env_path),
|
||||
file=sys.stderr,
|
||||
)
|
||||
return dict()
|
||||
|
||||
# Otherwise, load the file as JSON and return the resulting dict
|
||||
@@ -43,7 +48,11 @@ class Env(object):
|
||||
return json.load(env_file)
|
||||
|
||||
except ValueError:
|
||||
print "Error: Could not parse JSON in {path}".format(path=env_path)
|
||||
print(
|
||||
"Error: Could not parse JSON "
|
||||
"in {path}".format(path=env_path),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
@lazy
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Helper functions for managing processes.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
Reference in New Issue
Block a user