Fixed hen-egg problem in setup.py

setup.py tried to use babel imports before the necessary requirements
were fetched. Now only tries to import that stuff if
babel_{refresh|compile|new} is called instead of importing it
in the file header.
This commit is contained in:
Gina Häußge 2014-08-28 15:59:57 +02:00
parent bc8fe527f7
commit 35b1232b0a
4 changed files with 10 additions and 8 deletions

View file

@ -13,8 +13,6 @@ import os
import shutil
import glob
from babel.messages import frontend as babel
I18N_MAPPING_FILE = "babel.cfg"
I18N_DOMAIN = "messages"
I18N_INPUT_DIRS = "."
@ -63,6 +61,7 @@ class NewTranslation(Command):
boolean_options = []
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_init_messages = babel.init_catalog(dist)
Command.__init__(self, dist, **kw)
@ -86,6 +85,7 @@ class RefreshTranslation(Command):
boolean_options = []
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_extract_messages = babel.extract_messages(dist)
self.babel_update_messages = babel.update_catalog(dist)
Command.__init__(self, dist, **kw)
@ -116,6 +116,7 @@ class CompileTranslation(Command):
boolean_options = []
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_compile_messages = babel.compile_catalog(dist)
Command.__init__(self, dist, **kw)

File diff suppressed because one or more lines are too long

View file

@ -1,8 +1,9 @@
# German translations for OctoPrint.
# Translations template for OctoPrint.
# Copyright (C) 2014 The OctoPrint Project
# This file is distributed under the same license as the OctoPrint project.
#
# Translators:
# demod <reg@demod.org>, 2014
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
# Gina Häußge <gina@foosel.net>, 2014
# demod <reg@demod.org>, 2014
@ -11,16 +12,16 @@ msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2014-08-28 15:52+0200\n"
"PO-Revision-Date: 2014-08-28 15:53+0100\n"
"PO-Revision-Date: 2014-08-28 15:56+0100\n"
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/"
"language/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: Babel 1.3\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.8\n"
#: src/octoprint/static/js/app/dataupdater.js:43