summaryrefslogtreecommitdiff
path: root/apscheduler
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2014-07-01 03:35:41 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2014-07-01 03:35:41 +0300
commit2d794e22b335d45863ffe148a5b4afc6f3999e9e (patch)
tree019dcdec164972b35e21606513110d7684f33b42 /apscheduler
parente210cee397d475edf643813e375d8f55e13a5330 (diff)
downloadapscheduler-2d794e22b335d45863ffe148a5b4afc6f3999e9e.tar.gz
Fixed falsely passing tests and the bugs they uncovered in BaseScheduler
Diffstat (limited to 'apscheduler')
-rw-r--r--apscheduler/schedulers/base.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/apscheduler/schedulers/base.py b/apscheduler/schedulers/base.py
index fba9dee..cdc0bf0 100644
--- a/apscheduler/schedulers/base.py
+++ b/apscheduler/schedulers/base.py
@@ -74,14 +74,15 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
if self.running:
raise SchedulerAlreadyRunningError
- # If a non-empty prefix was given,
+ # If a non-empty prefix was given, strip it from the keys in the global configuration dict
if prefix:
- gconfig = dict((key[11:], value) for key, value in six.iteritems(gconfig) if key.startswith(prefix))
+ prefixlen = len(prefix)
+ gconfig = dict((key[prefixlen:], value) for key, value in six.iteritems(gconfig) if key.startswith(prefix))
# Create a structure from the dotted options (e.g. "a.b.c = d" -> {'a': {'b': {'c': 'd'}}})
config = {}
for key, value in six.iteritems(gconfig):
- parts = key.split('.', 1)
+ parts = key.split('.')
parent = config
key = parts.pop(0)
while parts:
@@ -119,7 +120,7 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
self.add_jobstore(self._create_default_jobstore(), 'default')
# Start all the job stores
- for alias, store in six.iteritems(self._executors):
+ for alias, store in six.iteritems(self._jobstores):
store.start(self, alias)
# Schedule all pending jobs