Mercurial > p > roundup > code
comparison roundup/instance.py @ 3777:74aebbbea305
Sorry for the mega-patch - was all done on the train:
- handling of required for booelan False and numeric 0 [SF#1608200]
- removed bogus args attr of ConfigurationError [SF#1608056]
- implemented start_response in roundup.cgi [SF#1604304]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 11 Dec 2006 23:36:15 +0000 |
| parents | 46e3d5d0901d |
| children | bbab97f8ffb2 |
comparison
equal
deleted
inserted
replaced
| 3776:1ac3c7ed91e8 | 3777:74aebbbea305 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: instance.py,v 1.36 2006-12-01 10:38:40 schlatterbeck Exp $ | 18 # $Id: instance.py,v 1.37 2006-12-11 23:36:15 richard Exp $ |
| 19 | 19 |
| 20 '''Tracker handling (open tracker). | 20 '''Tracker handling (open tracker). |
| 21 | 21 |
| 22 Backwards compatibility for the old-style "imported" trackers. | 22 Backwards compatibility for the old-style "imported" trackers. |
| 23 ''' | 23 ''' |
| 69 schemafile.close() | 69 schemafile.close() |
| 70 # load database detectors | 70 # load database detectors |
| 71 self.detectors = self.get_extensions('detectors') | 71 self.detectors = self.get_extensions('detectors') |
| 72 # db_open is set to True after first open() | 72 # db_open is set to True after first open() |
| 73 self.db_open = 0 | 73 self.db_open = 0 |
| 74 sys.path.remove (libdir) | 74 if libdir in sys.path: |
| 75 sys.path.remove(libdir) | |
| 75 | 76 |
| 76 def get_backend_name(self): | 77 def get_backend_name(self): |
| 77 o = __builtins__['open'] | 78 o = __builtins__['open'] |
| 78 f = o(os.path.join(self.tracker_home, 'db', 'backend_name')) | 79 f = o(os.path.join(self.tracker_home, 'db', 'backend_name')) |
| 79 name = f.readline().strip() | 80 name = f.readline().strip() |
| 114 self._load_python('schema.py', vars) | 115 self._load_python('schema.py', vars) |
| 115 # reload extensions and detectors | 116 # reload extensions and detectors |
| 116 for extension in self.get_extensions('extensions'): | 117 for extension in self.get_extensions('extensions'): |
| 117 extension(self) | 118 extension(self) |
| 118 detectors = self.get_extensions('detectors') | 119 detectors = self.get_extensions('detectors') |
| 119 sys.path.remove (libdir) | 120 if libdir in sys.path: |
| 121 sys.path.remove(libdir) | |
| 120 db = vars['db'] | 122 db = vars['db'] |
| 121 # apply the detectors | 123 # apply the detectors |
| 122 for detector in detectors: | 124 for detector in detectors: |
| 123 detector(db) | 125 detector(db) |
| 124 # if we are running in debug mode | 126 # if we are running in debug mode |
