annotate MoinMoin/script/__init__.py @ 2017:615ca978863f

remove more system items / sysitems_upgrade related code
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 02 Mar 2013 18:15:47 +0100
parents 384555088cab
children 12961b623cb6
rev   line source
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
1 # Copyright: 2000-2002 Juergen Hermann <jh@web.de>
82
df1fc8a424e8 remove old script infrastructure, remove migration script (use xml dump)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
2 # Copyright: 2006,2011 MoinMoin:ThomasWaldmann
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
3 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
4
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 """
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
6 MoinMoin - Extension Script Package
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
7 """
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
8
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
9 import sys
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
10
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
11
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
12 def main(default_command='moin', wiki_config=None):
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
13 """
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
14 console_script entry point
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
15 """
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
16 from MoinMoin.app import create_app
1767
54be46b8a0b4 flask ext import change
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1397
diff changeset
17 from flask.ext.script import Manager, Server
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
18
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
19 manager = Manager(create_app)
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
20 manager.add_option('-c', '--config', dest='config', required=False, default=wiki_config)
1975
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1916
diff changeset
21 manager.add_option('-i', '--index-create', action='store_true', dest='create_index',
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1916
diff changeset
22 required=False, default=False)
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1916
diff changeset
23 manager.add_option('-s', '--storage-create', action='store_true', dest='create_storage',
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1916
diff changeset
24 required=False, default=False)
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
25 manager.add_command("moin", Server(host='127.0.0.1', port=8080))
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
26
852
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
27 from MoinMoin.script.maint import index
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
28 manager.add_command("index-create", index.IndexCreate())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
29 manager.add_command("index-build", index.IndexBuild())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
30 manager.add_command("index-update", index.IndexUpdate())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
31 manager.add_command("index-destroy", index.IndexDestroy())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
32 manager.add_command("index-move", index.IndexMove())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
33 manager.add_command("index-optimize", index.IndexOptimize())
870
04cdc3823cac add index-dump script command
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 854
diff changeset
34 manager.add_command("index-dump", index.IndexDump())
852
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
35 from MoinMoin.script.maint import serialization
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
36 manager.add_command("save", serialization.Serialize())
5ad4ae0b1e09 lots of fixes / adaptions for storage-ng code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 355
diff changeset
37 manager.add_command("load", serialization.Deserialize())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
38 from MoinMoin.script.account.create import Create_User
1916
1fb4116270ab script commands: consistently use minus (not underscore) within command names
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1767
diff changeset
39 manager.add_command("account-create", Create_User())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
40 from MoinMoin.script.account.disable import Disable_User
1916
1fb4116270ab script commands: consistently use minus (not underscore) within command names
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1767
diff changeset
41 manager.add_command("account-disable", Disable_User())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
42 from MoinMoin.script.account.resetpw import Set_Password
1916
1fb4116270ab script commands: consistently use minus (not underscore) within command names
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1767
diff changeset
43 manager.add_command("account-password", Set_Password())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
44 from MoinMoin.script.maint.reduce_revisions import Reduce_Revisions
1916
1fb4116270ab script commands: consistently use minus (not underscore) within command names
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1767
diff changeset
45 manager.add_command("maint-reduce-revisions", Reduce_Revisions())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
46 from MoinMoin.script.maint.set_meta import Set_Meta
1916
1fb4116270ab script commands: consistently use minus (not underscore) within command names
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1767
diff changeset
47 manager.add_command("maint-set-meta", Set_Meta())
872
135198715129 implement item-get / item-put script commands
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 870
diff changeset
48 from MoinMoin.script.maint import modify_item
135198715129 implement item-get / item-put script commands
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 870
diff changeset
49 manager.add_command("item-get", modify_item.GetItem())
135198715129 implement item-get / item-put script commands
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 870
diff changeset
50 manager.add_command("item-put", modify_item.PutItem())
925
86dcdd927b29 1.9 migration: use sane package name, fix import
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 923
diff changeset
51 from MoinMoin.script.migration.moin19.import19 import ImportMoin19
923
c62f12d7ef01 1.9 migration: make a 'import19' script command, make a migration package
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 873
diff changeset
52 manager.add_command("import19", ImportMoin19())
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
53
1020
2c4087f61d39 add a new moin command called moinshell, that runs a python shell with preseted flaskg variables
Fabio Montefuscolo <fabio.montefuscolo@gmail.com>
parents: 925
diff changeset
54 from MoinMoin.script.maint.moinshell import MoinShell
1027
1f3d66455a88 workaround in flask-script command to run in ipython 0.10 and 0.11
Fabio Montefuscolo <fabio.montefuscolo@gmail.com>
parents: 1020
diff changeset
55 manager.add_command("shell", MoinShell())
1020
2c4087f61d39 add a new moin command called moinshell, that runs a python shell with preseted flaskg variables
Fabio Montefuscolo <fabio.montefuscolo@gmail.com>
parents: 925
diff changeset
56
83
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
57 return manager.run(default_command=default_command)
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
58
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
59
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
60 def fatal(msg):
8a5be4814a48 use console_script entry point - setup.py now installs a "moin" script for the platform
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 82
diff changeset
61 sys.exit(msg)