Commit a2a77f98 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Fixes deprecation

No related merge requests found
Showing with 5 additions and 4 deletions
+5 -4
...@@ -153,12 +153,12 @@ class OhmPi(object): ...@@ -153,12 +153,12 @@ class OhmPi(object):
self.controller = None self.controller = None
self.exec_logger.warning('No connection to control broker.' self.exec_logger.warning('No connection to control broker.'
' Use python/ipython to interact with OhmPi object...') ' Use python/ipython to interact with OhmPi object...')
self.get_deprecated_methods()
def get_deprecated_methods(self): @classmethod
def get_deprecated_methods(cls):
for i in getmembers(deprecated, isfunction): for i in getmembers(deprecated, isfunction):
self.exec_logger.debug(f'Adding deprecated method {i[0]}.') print(f'Adding {i[0]} (deprecated)')
setattr(self, i[0], i[1]) setattr(cls, i[0], i[1])
@staticmethod @staticmethod
def append_and_save(filename: str, last_measurement: dict, cmd_id=None): def append_and_save(filename: str, last_measurement: dict, cmd_id=None):
...@@ -1243,6 +1243,7 @@ print(f'local date and time : {current_time.strftime("%Y-%m-%d %H:%M:%S")}') ...@@ -1243,6 +1243,7 @@ print(f'local date and time : {current_time.strftime("%Y-%m-%d %H:%M:%S")}')
# for testing # for testing
if __name__ == "__main__": if __name__ == "__main__":
OhmPi.get_deprecated_methods()
ohmpi = OhmPi(settings=OHMPI_CONFIG['settings']) ohmpi = OhmPi(settings=OHMPI_CONFIG['settings'])
if ohmpi.controller is not None: if ohmpi.controller is not None:
ohmpi.controller.loop_forever() ohmpi.controller.loop_forever()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment