Skip to content

Instantly share code, notes, and snippets.

@wooyek
Created December 6, 2013 17:07
Show Gist options
  • Save wooyek/7828422 to your computer and use it in GitHub Desktop.
Save wooyek/7828422 to your computer and use it in GitHub Desktop.
Babel CLI wrapper for Flask-Script
# 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