src/reportlab/__init__.py
branchpy33
changeset 4050 a899d3baa5f4
parent 4047 2319faeb2f5e
child 4053 173718fd2975
--- a/src/reportlab/__init__.py	Thu Feb 27 10:32:27 2014 +0000
+++ b/src/reportlab/__init__.py	Thu Feb 27 12:51:04 2014 +0000
@@ -3,9 +3,9 @@
 #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/__init__.py
 __version__=''' $Id$ '''
 __doc__="""The Reportlab PDF generation library."""
-Version = "3.0-20140220"
+Version = "3.0-20140226"
 
-import sys
+import sys, os, imp
 
 if sys.version_info[0:2]!=(2, 7) and sys.version_info<(3, 3):
     raise ImportError("""reportlab requires Python 2.7+ or 3.3+; 3.0-3.2 are not supported.""")
@@ -26,8 +26,23 @@
     __builtin__.ascii = ascii
     del ascii, __builtin__
 
-#the module reportlab.local_rl_mods can be used to customize just about anything
+#try to use dynamic modifications from
+#reportlab.local_rl_mods.py
+#reportlab_mods or ~/.reportlab_mods
 try:
     import reportlab.local_rl_mods
 except ImportError:
     pass
+
+def _fake_import(fn,name):
+    if os.path.isfile(fn):
+        with open(fn,'rb') as f:
+            imp.load_source('reportlab_mods',fn,f)
+
+try:
+    import reportlab_mods   #application specific modifications can be anywhere on python path
+except ImportError:
+    try:
+        _fake_import(os.path.expanduser(os.path.join('~','.reportlab_mods')),'reportlab_mods')
+    except ImportError:
+        pass