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
914b91ec
Commit
914b91ec
authored
Jul 11, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor based on Cale's comments.
parent
8dc4a183
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
pavelib/assets.py
+10
-6
pavelib/servers.py
+2
-2
No files found.
pavelib/assets.py
View file @
914b91ec
...
...
@@ -641,7 +641,7 @@ def restart_django_servers():
))
def
collect_assets
(
systems
,
settings
,
debug
=
None
,
collectstatic_log
=
None
):
def
collect_assets
(
systems
,
settings
,
collectstatic_log
=
"/dev/null"
):
"""
Collect static assets, including Django pipeline processing.
`systems` is a list of systems (e.g. 'lms' or 'studio' or both)
...
...
@@ -654,11 +654,9 @@ def collect_assets(systems, settings, debug=None, collectstatic_log=None):
"""
# unless specified, collectstatic (which can be very verbose) pipes to /dev/null
collectstatic_stdout_str
=
"> /dev/null"
if
debug
:
# pipe to console
if
collectstatic_log
is
None
:
collectstatic_stdout_str
=
""
if
collectstatic_log
:
else
:
# pipe to specified file, even if debug has also been passed in
collectstatic_stdout_str
=
"> {output_file}"
.
format
(
output_file
=
collectstatic_log
)
...
...
@@ -795,7 +793,13 @@ def update_assets(args):
execute_compile_sass
(
args
)
if
args
.
collect
:
collect_assets
(
args
.
system
,
args
.
settings
,
debug
=
args
.
debug
,
collectstatic_log
=
args
.
collect_log_file
)
collect_log_file
=
args
.
collect_log_file
# run collectstatic in debug mode if update_assets is in debug mode and no log location is specified
if
args
.
debug
and
not
collect_log_file
:
collect_log_file
=
None
collect_assets
(
args
.
system
,
args
.
settings
,
collectstatic_log
=
collect_log_file
)
if
args
.
watch
:
call_task
(
...
...
pavelib/servers.py
View file @
914b91ec
...
...
@@ -213,8 +213,8 @@ def run_all_servers(options):
# means that the optimized assets are ignored, so we skip collectstatic in that
# case to save time.
if
settings
!=
DEFAULT_SETTINGS
:
collect_assets
([
'lms'
],
asset_settings_lms
,
collectstatic_log
=
"/dev/null"
)
collect_assets
([
'studio'
],
asset_settings_cms
,
collectstatic_log
=
"/dev/null"
)
collect_assets
([
'lms'
],
asset_settings_lms
)
collect_assets
([
'studio'
],
asset_settings_cms
)
# Install an asset watcher to regenerate files that change
call_task
(
'pavelib.assets.watch_assets'
,
options
=
{
'background'
:
True
})
...
...
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