Mercurial > p > roundup > code
diff roundup/scripts/roundup_mailgw.py @ 4766:86ef4ab17dc5
Run scripts (roundup_admin.py, ...) directly from checkout.
Convenient when you don't want to install Roundup, but want
to run latest version.
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Thu, 21 Feb 2013 20:49:45 +0300 |
| parents | 6e3e4f24c753 |
| children | 63574f1f3570 |
line wrap: on
line diff
--- a/roundup/scripts/roundup_mailgw.py Thu Feb 21 19:36:49 2013 +0300 +++ b/roundup/scripts/roundup_mailgw.py Thu Feb 21 20:49:45 2013 +0300 @@ -18,6 +18,20 @@ """ __docformat__ = 'restructuredtext' + +# --- patch sys.path to make sure 'import roundup' finds correct version +import sys +import os.path as osp + +thisdir = osp.dirname(osp.abspath(__file__)) +rootdir = osp.dirname(osp.dirname(thisdir)) +if (osp.exists(thisdir + '/__init__.py') and + osp.exists(rootdir + '/roundup/__init__.py')): + # the script is located inside roundup source code + sys.path.insert(0, rootdir) +# --/ + + # python version check from roundup import version_check from roundup import __version__ as roundup_version
