Skip to content
Myr

Added __main__ module

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 8a46eec · Browse files · 2 files+30 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+30 added−1 removed

  • other:+30 added−1 removed

2 files+30 added−1 removed

added:flask/__main__.py+15 added
1# -*- coding: utf-8 -*-2"""3 flask.__main__4 ~~~~~~~~~~~~~~56 Alias for flask.run for the command line.78 :copyright: (c) 2014 by Armin Ronacher.9 :license: BSD, see LICENSE for more details.10"""111213if __name__ == '__main__':14 from run import main15 main(as_module=True)
modified:flask/run.py+15 added-1 removed
1# -*- coding: utf-8 -*-2"""3 flask.run4 ~~~~~~~~~56 A simple command line application to run flask apps.78 :copyright: (c) 2014 by Armin Ronacher.9 :license: BSD, see LICENSE for more details.10"""1112import os13import sys14from threading import Lock15from optparse import OptionParser
158 unmodified lines
174def main(as_module=False):175 this_module = __package__ + '.run'176177 if as_module:178 if sys.version_info >= (2, 7):179 name = 'python -m ' + this_module.rsplit('.', 1)[0]180 else:167 name = 'python -m ' + this_module181 name = 'python -m ' + this_module182 else:183 name = 'flask-run'184185 parser = OptionParser(usage='%prog [options] module', prog=name)
62 unmodified lines