1.1 --- a/imiptools/handlers/scheduling/manifest.py Tue Jan 31 16:18:55 2017 +0100
1.2 +++ b/imiptools/handlers/scheduling/manifest.py Sun Feb 05 22:16:24 2017 +0100
1.3 @@ -1,45 +1,52 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"""
1.7 +Scheduling functions manifest.
1.8 +
1.9 +Copyright (C) 2017 Paul Boddie <paul@boddie.org.uk>
1.10 +
1.11 +This program is free software; you can redistribute it and/or modify it under
1.12 +the terms of the GNU General Public License as published by the Free Software
1.13 +Foundation; either version 3 of the License, or (at your option) any later
1.14 +version.
1.15 +
1.16 +This program is distributed in the hope that it will be useful, but WITHOUT
1.17 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.18 +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.19 +details.
1.20 +
1.21 +You should have received a copy of the GNU General Public License along with
1.22 +this program. If not, see <http://www.gnu.org/licenses/>.
1.23 +"""
1.24 +
1.25 +from imiptools.imports import get_extensions
1.26 +from os.path import split
1.27 +
1.28 +reserved = ["__init__", "common", "manifest"]
1.29 +
1.30 +# Obtain details of this module's package.
1.31 +
1.32 +dirname = split(__file__)[0]
1.33 +package = __name__.rsplit(".", 1)[0]
1.34 +
1.35 +# Define an attribute mapping names to modules.
1.36 +
1.37 +modules = {}
1.38 +get_extensions(dirname, package, modules, reserved)
1.39 +
1.40 +# Define attributes mapping names to functions.
1.41 +
1.42 confirmation_functions = {}
1.43 locking_functions = {}
1.44 retraction_functions = {}
1.45 scheduling_functions = {}
1.46 unlocking_functions = {}
1.47
1.48 -from imiptools.handlers.scheduling.access import (
1.49 - confirmation_functions as c,
1.50 - locking_functions as l,
1.51 - retraction_functions as r,
1.52 - scheduling_functions as s,
1.53 - unlocking_functions as u)
1.54 -
1.55 -confirmation_functions.update(c)
1.56 -locking_functions.update(l)
1.57 -retraction_functions.update(r)
1.58 -scheduling_functions.update(s)
1.59 -unlocking_functions.update(u)
1.60 -
1.61 -from imiptools.handlers.scheduling.freebusy import (
1.62 - confirmation_functions as c,
1.63 - locking_functions as l,
1.64 - retraction_functions as r,
1.65 - scheduling_functions as s,
1.66 - unlocking_functions as u)
1.67 +for module in modules.values():
1.68 + confirmation_functions.update(module.confirmation_functions)
1.69 + locking_functions.update(module.locking_functions)
1.70 + retraction_functions.update(module.retraction_functions)
1.71 + scheduling_functions.update(module.scheduling_functions)
1.72 + unlocking_functions.update(module.unlocking_functions)
1.73
1.74 -confirmation_functions.update(c)
1.75 -locking_functions.update(l)
1.76 -retraction_functions.update(r)
1.77 -scheduling_functions.update(s)
1.78 -unlocking_functions.update(u)
1.79 -
1.80 -from imiptools.handlers.scheduling.quota import (
1.81 - confirmation_functions as c,
1.82 - locking_functions as l,
1.83 - retraction_functions as r,
1.84 - scheduling_functions as s,
1.85 - unlocking_functions as u)
1.86 -
1.87 -confirmation_functions.update(c)
1.88 -locking_functions.update(l)
1.89 -retraction_functions.update(r)
1.90 -scheduling_functions.update(s)
1.91 -unlocking_functions.update(u)
1.92 -
1.93 +# vim: tabstop=4 expandtab shiftwidth=4