Commit 28f22393 by David Baumgold

whitespace-only changes

parent c8416451
......@@ -28,6 +28,7 @@ MAX_SCORE = 1
FILE_NOT_FOUND_IN_RESPONSE_MESSAGE = "We could not find a file in your submission. Please try choosing a file or pasting a link to your file into the answer box."
ERROR_SAVING_FILE_MESSAGE = "We are having trouble saving your file. Please try another file or paste a link to your file into the answer box."
def upload_to_s3(file_to_upload, keyname, s3_interface):
'''
Upload file to S3 using provided keyname.
......
......@@ -21,6 +21,7 @@ from execute import execute
LOG = logging.getLogger(__name__)
def merge(locale, target='django.po', fail_if_missing=True):
"""
For the given locale, merge django-partial.po, messages.po, mako.po -> django.po
......@@ -52,6 +53,7 @@ def merge(locale, target='django.po', fail_if_missing=True):
django_filename = locale_directory.joinpath(target)
os.rename(merged_filename, django_filename) # can't overwrite file on Windows
def clean_metadata(file):
"""
Clean up redundancies in the metadata caused by merging.
......@@ -59,6 +61,7 @@ def clean_metadata(file):
"""
pofile(file).save()
def validate_files(dir, files_to_merge):
"""
Asserts that the given files exist.
......@@ -71,7 +74,8 @@ def validate_files(dir, files_to_merge):
if not pathname.exists():
raise Exception("I18N: Cannot generate because file not found: {0}".format(pathname))
def main ():
def main():
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
for locale in CONFIGURATION.locales:
......@@ -81,5 +85,6 @@ def main ():
compile_cmd = 'django-admin.py compilemessages'
execute(compile_cmd, working_directory=BASE_DIR)
if __name__ == '__main__':
main()
......@@ -28,6 +28,7 @@ from dummy import Dummy
from config import CONFIGURATION
from execute import create_dir_if_necessary
def main(file, locale):
"""
Takes a source po file, reads it, and writes out a new po file
......@@ -44,6 +45,7 @@ def main(file, locale):
create_dir_if_necessary(new_file)
pofile.save(new_file)
def new_filename(original_filename, new_locale):
"""Returns a filename derived from original_filename, using new_locale as the locale"""
orig_dir = os.path.dirname(original_filename)
......@@ -57,10 +59,10 @@ def new_filename(original_filename, new_locale):
if __name__ == '__main__':
# required arg: file
if len(sys.argv)<2:
if len(sys.argv) < 2:
raise Exception("missing file argument")
# optional arg: locale
if len(sys.argv)<3:
if len(sys.argv) < 3:
locale = CONFIGURATION.get_dummy_locale()
else:
locale = sys.argv[2]
......
......@@ -51,4 +51,4 @@ MIDDLEWARE_CLASSES = tuple([mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startsw
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
)
Markdown is supported
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