1.1 --- a/imiptools/handlers/resource.py Fri Jan 29 16:44:32 2016 +0100
1.2 +++ b/imiptools/handlers/resource.py Fri Jan 29 17:02:06 2016 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Handlers for a resource.
1.6
1.7 -Copyright (C) 2014, 2015 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -22,7 +22,8 @@
1.13 from imiptools.data import get_address, to_part, uri_dict
1.14 from imiptools.handlers import Handler
1.15 from imiptools.handlers.common import CommonFreebusy, CommonEvent
1.16 -from imiptools.handlers.scheduling import scheduling_functions
1.17 +from imiptools.handlers.scheduling import apply_scheduling_functions, \
1.18 + scheduling_functions
1.19
1.20 class ResourceHandler(CommonEvent, Handler):
1.21
1.22 @@ -162,15 +163,16 @@
1.23 invalid requests.
1.24 """
1.25
1.26 - scheduling_function = self.get_preferences().get("scheduling_function", "schedule_in_freebusy")
1.27 - fn = scheduling_functions.get(scheduling_function)
1.28 + # Obtain a list of scheduling functions.
1.29
1.30 - # NOTE: Should signal an error for incorrectly configured resources.
1.31 + functions = self.get_preferences().get("scheduling_function",
1.32 + "schedule_in_freebusy").split("\n")
1.33
1.34 - if not fn:
1.35 - return "DECLINED"
1.36 - else:
1.37 - return fn(self)
1.38 + # Obtain the actual scheduling functions.
1.39 +
1.40 + functions = map(scheduling_functions.get, functions)
1.41 +
1.42 + return apply_scheduling_functions(functions, self)
1.43
1.44 class Event(ResourceHandler):
1.45