You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
877 B
37 lines
877 B
#!/usr/local/webapps/moin/moin-env/bin/python |
|
|
|
import sys |
|
|
|
|
|
CONFIG_PATH = '/var/www/moin/config/' |
|
|
|
|
|
def is_venv(): |
|
return (hasattr(sys, 'real_prefix') or |
|
(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix)) |
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if not is_venv(): |
|
print 'you need to activate the virtual environment' |
|
sys.exit(1) |
|
|
|
sys.path.append(CONFIG_PATH) |
|
from farmconfig import wikis |
|
from MoinMoin.script.moin import run |
|
|
|
for module_name, url_regex in wikis: |
|
# removes starting carret and port definitions and onward |
|
tmp = url_regex[1:-11] |
|
url = tmp.replace('?', '') |
|
|
|
sys.argv = [ |
|
'moin', |
|
'--config-dir=' + CONFIG_PATH, |
|
'--wiki-url=' + url, |
|
'index', |
|
'build', |
|
'--mode=rebuild'] |
|
|
|
run()
|
|
|