Adnane Belmadiaf has proposed merging lp:~daker/loco-directory/fix.708995 into
lp:loco-directory.
Requested reviews:
loco-directory-dev (loco-directory-dev)
Related bugs:
Bug #708995 in LoCo Team Directory: "Warn when packages are not installed"
https://bugs.launchpad.net/loco-directory/+bug/708995
For more details, see:
https://code.launchpad.net/~daker/loco-directory/fix.708995/+merge/63308
--
https://code.launchpad.net/~daker/loco-directory/fix.708995/+merge/63308
Your team loco-directory-dev is requested to review the proposed merge of
lp:~daker/loco-directory/fix.708995 into lp:loco-directory.
=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py 2010-12-07 21:42:01 +0000
+++ loco_directory/settings.py 2011-06-02 22:12:33 +0000
@@ -1,6 +1,8 @@
# Django settings for loco_directory project.
import os
+import sys
+
try:
import ubuntu_website
uw_import = True
@@ -8,10 +10,18 @@
print "You will need to run ./manage.py init-ld to make the LoCo Team Directory fully work."
uw_import = False
-try:
- import pytz
-except ImportError:
- print "Missing library: pytz, Install package: python-tz"
+# Check for necessary modules
+modules = {
+ 'pytz': 'python-tz',
+ 'vobject': 'python-vobject',
+ }
+
+for module,package in modules.items():
+ try:
+ __import__(module)
+ except ImportError:
+ sys.stderr.write("Missing library: %s, Install package: %s\n" % (module, package))
+ sys.exit(1)
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help : https://help.launchpad.net/ListHelp