Files
edx-platform/pavelib/utils/cmd.py
David Glance df2e410f2a Replace rake functions with python paver functions
Deprecated rake functions issue a warning and then call paver
replacements

Bring Paver commands up to date with master for servers, assets, and docs.
Revert deprecation of quality, tests, and i18n for a future pull request.
Deprecate workspace migration
2014-02-14 11:25:55 -05:00

24 lines
691 B
Python

"""
Helper functions for constructing shell commands.
"""
def cmd(*args):
"""
Concatenate the arguments into a space-separated shell command.
"""
return " ".join([str(arg) for arg in args])
def django_cmd(sys, settings, *args):
"""
Construct a Django management command.
`sys` is either 'lms' or 'studio'.
`settings` is the Django settings module (such as "dev" or "test")
`args` are concatenated to form the rest of the command.
"""
# Maintain backwards compatibility with manage.py,
# which calls "studio" "cms"
sys = 'cms' if sys == 'studio' else sys
return cmd("python manage.py", sys, "--settings={}".format(settings), *args)