Commit 8c31d5a2 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Fixes deprecation

No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
...@@ -17,6 +17,7 @@ import numpy as np ...@@ -17,6 +17,7 @@ import numpy as np
import csv import csv
import time import time
import shutil import shutil
from inspect import getmembers, isfunction
from datetime import datetime from datetime import datetime
from termcolor import colored from termcolor import colored
import threading import threading
...@@ -152,13 +153,12 @@ class OhmPi(object): ...@@ -152,13 +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 __getattr__(self, name): def get_deprecated_methods(self):
if not hasattr(self, name): for i in getmembers(deprecated, isfunction):
if hasattr(deprecated, name): self.exec_logger.debug(f'Adding deprecated method {i[0]}.')
return getattr(deprecated, name) self.__setattr__(i[0], i[1])
else:
return getattr(self, name)
@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):
......
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