changeset 174:ff26436d42d6

Make data_generation.transformations importable and fixup test.py to not try some of the modules.
author Arnaud Bergeron <abergeron@gmail.com>
date Sat, 27 Feb 2010 12:18:26 -0500
parents 954185d6002a
children 224321bf043a
files data_generation/transformations/pycaptcha/Facade.py test.py
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data_generation/transformations/pycaptcha/Facade.py	Sat Feb 27 12:01:08 2010 -0500
+++ b/data_generation/transformations/pycaptcha/Facade.py	Sat Feb 27 12:18:26 2010 -0500
@@ -1,6 +1,8 @@
 #!/usr/bin/env python
-
-
+import sys, os
+curdir = os.path.dirname(__file__)
+if curdir != '':
+    sys.path.append(curdir)
 
 from Captcha.Visual.Tests import PseudoGimpy, AngryGimpy
 import numpy
--- a/test.py	Sat Feb 27 12:01:08 2010 -0500
+++ b/test.py	Sat Feb 27 12:18:26 2010 -0500
@@ -5,8 +5,11 @@
     predefs = ift6266.__dict__
     for (_, name, ispkg) in pkgutil.walk_packages(ift6266.__path__, ift6266.__name__+'.'):
         if not ispkg:
-            if name.startswith('ift6266.scripts') or \
-               name in ['ift6266.test']:
+            if name.startswith('ift6266.scripts.') or \
+               name.startswith('ift6266.data_generation.transformations.pycaptcha.') or \
+               name in ['ift6266.test',
+                        'ift6266.data_generation.transformations.testmod',
+                        'ift6266.data_generation.transformations.gimp_script']:
                 continue
             print "Testing:", name
             __import__(name)