Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e9b0cc71
Commit
e9b0cc71
authored
Mar 19, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
from __future__ import print_function
and print errors and warnings to sys.stderr
parent
6f38ea43
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
10 deletions
+29
-10
pavelib/docs.py
+13
-4
pavelib/prereqs.py
+1
-1
pavelib/servers.py
+3
-2
pavelib/utils/envs.py
+11
-2
pavelib/utils/process.py
+1
-1
No files found.
pavelib/docs.py
View file @
e9b0cc71
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
:
...
...
pavelib/prereqs.py
View file @
e9b0cc71
...
...
@@ -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
():
...
...
pavelib/servers.py
View file @
e9b0cc71
"""
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
:
...
...
pavelib/utils/envs.py
View file @
e9b0cc71
"""
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
...
...
pavelib/utils/process.py
View file @
e9b0cc71
"""
Helper functions for managing processes.
"""
from
__future__
import
print_function
import
sys
import
os
import
subprocess
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment