Created
December 6, 2013 17:07
-
-
Save wooyek/7828422 to your computer and use it in GitHub Desktop.
Babel CLI wrapper for Flask-Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import logging | |
import sys | |
from main import app | |
from flask_script import Manager, Command | |
manager = Manager(app) | |
class BabelCommand(Command): | |
capture_all_args = True | |
def run(self, args): | |
args.insert(0, sys.argv[0]) | |
from babel.messages.frontend import CommandLineInterface | |
cli = CommandLineInterface() | |
cli.run(args) | |
manager.add_command("babel", BabelCommand()) | |
if __name__ == "__main__": | |
manager.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment