Mercurial > p > roundup > code
comparison templates/detectors/__init__.py @ 26:c7c14960f413
Final commit of Grande Splite
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 22 Jul 2001 12:09:32 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 25:4cf1daf2f2eb | 26:c7c14960f413 |
|---|---|
| 1 #$Id: __init__.py,v 1.1 2001-07-22 12:09:32 richard Exp $ | |
| 2 | |
| 3 def init(db): | |
| 4 ''' execute the init functions of all the modules in this directory | |
| 5 ''' | |
| 6 import os, sys | |
| 7 this_dir = os.path.split(__file__)[0] | |
| 8 try: | |
| 9 sys.path.insert(0, this_dir) | |
| 10 for file in os.listdir(this_dir): | |
| 11 file, ext = os.path.splitext(file) | |
| 12 if file == '__init__': continue | |
| 13 if ext in ('.py', '.pyc'): | |
| 14 module = __import__(file) | |
| 15 module.init(db) | |
| 16 finally: | |
| 17 del sys.path[0] | |
| 18 | |
| 19 # | |
| 20 #$Log: not supported by cvs2svn $ | |
| 21 # |
