X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAPI.py;h=55a034921d36cd5e7a0d4d46411e4554a2e38313;hb=1cda98c34563ed3e90a9d2219730ae81f9705dc6;hp=9d61ed9b9dfadad340a44a8530da36930cdd20d7;hpb=1fe505c2263ccc9bcb9b9235984edec6fdd23b55;p=plcapi.git diff --git a/PLC/API.py b/PLC/API.py index 9d61ed9..55a0349 100644 --- a/PLC/API.py +++ b/PLC/API.py @@ -126,10 +126,16 @@ class PLCAPI: if self.config.PLC_DB_TYPE == "postgresql": from PLC.PostgreSQL import PostgreSQL self.db = PostgreSQL(self) - else: raise PLCAPIError, "Unsupported database type " + self.config.PLC_DB_TYPE + # Aspects modify the API injecting code before/after method + # calls. As of now we only have aspects for OMF integration, + # that's why we enable aspects only if PLC_OMF is set to true. + if self.config.PLC_OMF: + from aspects import apply_aspects; apply_aspects() + + def callable(self, method): """ Return a new instance of the specified method.