Mercurial > p > roundup > code
comparison roundup/instance.py @ 1162:86d41c31f9be
old habits...
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 18 Sep 2002 00:02:13 +0000 |
| parents | 30db4a11d700 |
| children | 8e318dfaf479 |
comparison
equal
deleted
inserted
replaced
| 1161:f2b77ac79641 | 1162:86d41c31f9be |
|---|---|
| 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.7 2002-09-17 23:59:32 richard Exp $ | 18 # $Id: instance.py,v 1.8 2002-09-18 00:02:13 richard Exp $ |
| 19 | 19 |
| 20 __doc__ = ''' | 20 __doc__ = ''' |
| 21 Tracker handling (open tracker). | 21 Tracker handling (open tracker). |
| 22 | 22 |
| 23 Currently this module provides one function: open. This function opens | 23 Currently this module provides one function: open. This function opens |
| 24 a tracker. Note that trackers used to be called instances. | 24 a tracker. Note that trackers used to be called instances. |
| 25 ''' | 25 ''' |
| 26 | 26 |
| 27 import imp, os | 27 import imp, os |
| 28 | 28 |
| 29 class InstanceError(Exception): | 29 class TrackerError(Exception): |
| 30 pass | 30 pass |
| 31 | 31 |
| 32 class Opener: | 32 class Opener: |
| 33 def __init__(self): | 33 def __init__(self): |
| 34 self.number = 0 | 34 self.number = 0 |
| 52 tracker = imp.load_package(modname, tracker_home) | 52 tracker = imp.load_package(modname, tracker_home) |
| 53 | 53 |
| 54 # ensure the tracker has all the required bits | 54 # ensure the tracker has all the required bits |
| 55 for required in 'config open init Client MailGW'.split(): | 55 for required in 'config open init Client MailGW'.split(): |
| 56 if not hasattr(tracker, required): | 56 if not hasattr(tracker, required): |
| 57 raise InstanceError, 'Required tracker attribute "%s" '\ | 57 raise TrackerError, 'Required tracker attribute "%s" '\ |
| 58 'missing'%required | 58 'missing'%required |
| 59 | 59 |
| 60 return tracker | 60 return tracker |
| 61 | 61 |
| 62 opener = Opener() | 62 opener = Opener() |
