Skip to content
Snippets Groups Projects
Commit 1a67819c authored by Jeremy Bowman's avatar Jeremy Bowman
Browse files

PLAT-1945 Better management command ergonomics

parent 6c752186
Branches
Tags
No related merge requests found
......@@ -27,5 +27,5 @@ class MathJaxExtension(markdown.Extension):
md.inlinePatterns.add('mathjax', MathJaxPattern(), '<escape')
def makeExtension(configs=None):
return MathJaxExtension(configs)
def makeExtension(**kwargs):
return MathJaxExtension(**kwargs)
......@@ -142,7 +142,7 @@ version = "0.1.6"
class VideoExtension(markdown.Extension):
def __init__(self, configs):
def __init__(self, **kwargs):
self.config = {
'bliptv_width': ['480', 'Width for Blip.tv videos'],
'bliptv_height': ['300', 'Height for Blip.tv videos'],
......@@ -163,8 +163,7 @@ class VideoExtension(markdown.Extension):
}
# Override defaults with user settings
for key, value in configs:
self.setConfig(key, value)
super(VideoExtension, self).__init__(**kwargs)
def add_inline(self, md, name, klass, re): # pylint: disable=invalid-name
"""Adds the inline link"""
......@@ -285,15 +284,12 @@ def flash_object(url, width, height):
param.set('name', 'allowFullScreen')
param.set('value', 'true')
obj.append(param)
#param = etree.Element('param')
#param.set('name', 'allowScriptAccess')
#param.set('value', 'sameDomain')
#obj.append(param)
return obj
def makeExtension(configs=None):
return VideoExtension(configs=configs)
def makeExtension(**kwargs):
return VideoExtension(**kwargs)
if __name__ == "__main__":
import doctest
......
......@@ -12,8 +12,8 @@ class ExtendMarkdownPlugin(BasePlugin):
"""
markdown_extensions = [
mdx_mathjax.MathJaxExtension(configs={}),
mdx_video.VideoExtension(configs={}),
mdx_mathjax.MathJaxExtension(),
mdx_video.VideoExtension(),
]
plugin_registry.register(ExtendMarkdownPlugin)
......@@ -43,7 +43,7 @@ def parse_args():
lms.add_argument(
'--settings',
help="Which django settings module to use under lms.envs. If not provided, the DJANGO_SETTINGS_MODULE "
"environment variable will be used if it is set, otherwise it will default to lms.envs.dev")
"environment variable will be used if it is set, otherwise it will default to lms.envs.devstack_docker")
lms.add_argument(
'--service-variant',
choices=['lms', 'lms-xml', 'lms-preview'],
......@@ -57,7 +57,7 @@ def parse_args():
lms.set_defaults(
help_string=lms.format_help(),
settings_base='lms/envs',
default_settings='lms.envs.dev',
default_settings='lms.envs.devstack_docker',
startup='lms.startup',
)
......@@ -70,7 +70,7 @@ def parse_args():
cms.add_argument(
'--settings',
help="Which django settings module to use under cms.envs. If not provided, the DJANGO_SETTINGS_MODULE "
"environment variable will be used if it is set, otherwise it will default to cms.envs.dev")
"environment variable will be used if it is set, otherwise it will default to cms.envs.devstack_docker")
cms.add_argument('-h', '--help', action='store_true', help='show this help message and exit')
cms.add_argument(
'--contracts',
......@@ -80,7 +80,7 @@ def parse_args():
cms.set_defaults(
help_string=cms.format_help(),
settings_base='cms/envs',
default_settings='cms.envs.dev',
default_settings='cms.envs.devstack_docker',
service_variant='cms',
startup='cms.startup',
)
......
......@@ -115,6 +115,15 @@ def log_python_warnings():
each test case.
"""
warnings.simplefilter('default')
warnings.filterwarnings('ignore', 'Not importing directory ')
warnings.filterwarnings('ignore', 'Setting _field_data is deprecated')
warnings.filterwarnings('ignore', 'Setting _field_data via the constructor is deprecated')
try:
# There are far too many of these deprecation warnings in startup to output for every management command;
# suppress them until we've fixed at least the most common ones as reported by the test suite
from django.utils.deprecation import RemovedInDjango20Warning, RemovedInDjango21Warning
warnings.simplefilter('ignore', RemovedInDjango20Warning)
warnings.simplefilter('ignore', RemovedInDjango21Warning)
except ImportError:
pass
logging.captureWarnings(True)
......@@ -50,7 +50,7 @@
# Third-party:
git+https://github.com/jazzband/django-pipeline.git@d068a019169c9de5ee20ece041a6dea236422852#egg=django-pipeline==1.5.3
-e git+https://github.com/edx/django-wiki.git@v0.0.16#egg=django-wiki
-e git+https://github.com/edx/django-wiki.git@v0.0.17#egg=django-wiki
git+https://github.com/edx/django-openid-auth.git@0.14#egg=django-openid-auth==0.14
git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0
git+https://github.com/edx/nltk.git@2.0.6#egg=nltk==2.0.6
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment