changeset 3583:347dff3b8197

provide moin script command for people not using setup.py, use it for mailimport script
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 11 May 2008 23:37:34 +0200
parents 27ba7445b480
children 5be4f4a8fa65
files contrib/mailimport/wikimailimport wiki/server/moin
diffstat 2 files changed, 43 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/mailimport/wikimailimport	Sun May 11 22:59:25 2008 +0200
+++ b/contrib/mailimport/wikimailimport	Sun May 11 23:37:34 2008 +0200
@@ -1,8 +1,11 @@
 #!/bin/sh
 
+# the "moin" script command has to be in your PATH
+#export PATH=/path_to_moin_command:$PATH
+
 # add the directories were your mailimport configuration and your MoinMoin code is located to the python path:
-export PYTHONPATH='/path_to_MoinMoin:/path_to_mailimportconfig'
+#export PYTHONPATH='/path_to_MoinMoin:/path_to_mailimportconfig'
 
 # call the xmlrpc client code
-/path_to_MoinMoin/MoinMoin/script/moin.py xmlrpc mailimport
+moin xmlrpc mailimport
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/server/moin	Sun May 11 23:37:34 2008 +0200
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+"""
+    moin script command
+
+    @copyright: 2008 by MoinMoin:ThomasWaldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+
+import sys, os
+
+# a) Configuration of Python's code search path
+#    If you already have set up the PYTHONPATH environment variable for the
+#    stuff you see below, you don't need to do a1) and a2).
+
+# a1) Path of the directory where the MoinMoin code package is located.
+#     Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
+#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
+
+# a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
+#     See wiki/config/... for some sample config files.
+#sys.path.insert(0, '/path/to/wikiconfigdir')
+#sys.path.insert(0, '/path/to/farmconfigdir')
+
+# b) Configuration of moin's logging
+#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
+#    You also don't need this if you are happy with the builtin defaults.
+#    See wiki/config/logging/... for some sample config files.
+#from MoinMoin import log
+#log.load_config('/path/to/logging_configuration_file')
+
+# Debug mode - show detailed error reports
+#os.environ['MOIN_DEBUG'] = '1'
+
+
+from MoinMoin.script.moin import run
+run()
+