Mercurial > wikked
annotate wk.py @ 224:d45450a0256a
Various changes/improvements:
* Nicer init/deinit loop in Wiki class.
* Renamed `wk cache` to `wk resolve`, made resolving pages a 1st class API on
the Wiki class.
* The `wk update` command now takes a path instead of an URL.
* Re-implemented auto-updating pages when their file has changed. This added a
new `isCacheValid` function on the DB layer.
* Got rid of exceptions with some meta-properties being arrays and some not.
Now they're all arrays, but there's some helper functions to work with that.
* Remove trailing empty lines from multi-line meta-properties.
* Fixed some issues parsing multi-line meta-properties and queries.
* Fixed some issues resolving queries, especially with custom item templates.
* Better handling of page/wiki permissions.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 10 Mar 2014 16:47:21 -0700 |
parents | 2dd7535045eb |
children |
rev | line source |
---|---|
158
e53a3b64dfd8
Renamed main Wikked script.
Ludovic Chabant <ludovic@chabant.com>
parents:
151
diff
changeset
|
1 #!/usr/local/bin/python |
214
2dd7535045eb
Print logging to `stdout`.
Ludovic Chabant <ludovic@chabant.com>
parents:
207
diff
changeset
|
2 import sys |
131
9d22cf4d2412
Massive change that should have been several smaller ones, but whatever:
Ludovic Chabant <ludovic@chabant.com>
parents:
129
diff
changeset
|
3 import logging |
207
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
4 import colorama |
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
5 from wikked.witch import ColoredFormatter, main |
0 | 6 |
7 | |
168
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
8 # Configure logging. |
207
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
9 colorama.init() |
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
10 root_logger = logging.getLogger() |
214
2dd7535045eb
Print logging to `stdout`.
Ludovic Chabant <ludovic@chabant.com>
parents:
207
diff
changeset
|
11 handler = logging.StreamHandler(stream=sys.stdout) |
207
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
12 handler.setFormatter(ColoredFormatter('%(message)s')) |
c6dd9b0c5009
Make logging start right away in `witch`.
Ludovic Chabant <ludovic@chabant.com>
parents:
168
diff
changeset
|
13 root_logger.addHandler(handler) |
112
a65cedc183d6
Added more functions to the `manage` CLI tool.
Ludovic Chabant <ludovic@chabant.com>
parents:
108
diff
changeset
|
14 |
a65cedc183d6
Added more functions to the `manage` CLI tool.
Ludovic Chabant <ludovic@chabant.com>
parents:
108
diff
changeset
|
15 |
0 | 16 if __name__ == "__main__": |
168
a71822a4beed
Refactoring to not better use Flask, only when needed:
Ludovic Chabant <ludovic@chabant.com>
parents:
158
diff
changeset
|
17 main() |
158
e53a3b64dfd8
Renamed main Wikked script.
Ludovic Chabant <ludovic@chabant.com>
parents:
151
diff
changeset
|
18 |