Mercurial > wikked
annotate wk.py @ 168:a71822a4beed
Refactoring to not better use Flask, only when needed:
- command-line utility is using plain `argparse`.
- no Flask app created unless we want to run a server.
- split all commands into sub-modules.
- do more initialization stuff in the `WikiParameters`.
- make `Wiki` init as cheap as possible.
- one `Wiki` instance now created per request.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 22 Jan 2014 21:39:02 -0800 |
parents | e53a3b64dfd8 |
children | c6dd9b0c5009 |
rev | line source |
---|---|
158
e53a3b64dfd8
Renamed main Wikked script.
Ludovic Chabant <ludovic@chabant.com>
parents:
151
diff
changeset
|
1 #!/usr/local/bin/python |
131
9d22cf4d2412
Massive change that should have been several smaller ones, but whatever:
Ludovic Chabant <ludovic@chabant.com>
parents:
129
diff
changeset
|
2 import logging |
168
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
3 from wikked.witch import main |
0 | 4 |
5 | |
168
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
6 # Configure logging. |
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
7 logging.basicConfig(level=logging.DEBUG, |
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
8 format="[%(levelname)s]: %(message)s") |
112
a65cedc183d6
Added more functions to the `manage` CLI tool.
Ludovic Chabant <ludovic@chabant.com>
parents:
108
diff
changeset
|
9 |
a65cedc183d6
Added more functions to the `manage` CLI tool.
Ludovic Chabant <ludovic@chabant.com>
parents:
108
diff
changeset
|
10 |
0 | 11 if __name__ == "__main__": |
168
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
12 main() |
158
e53a3b64dfd8
Renamed main Wikked script.
Ludovic Chabant <ludovic@chabant.com>
parents:
151
diff
changeset
|
13 |