configuration.py 756 B

1234567891011121314151617181920212223242526272829303132
  1. import json
  2. import os
  3. import sys
  4. class Configuration:
  5. def __init__(self):
  6. # self.system_config = self.get_system_config()
  7. pass
  8. def get_system_config(self):
  9. """"读取配置"""
  10. if sys.platform == 'win32':
  11. # config_file_path = os.path.dirname(os.path.realpath(sys.argv[0])) + r'\config.json'
  12. config_file_path = r'.\config.json'
  13. elif sys.platform == 'linux':
  14. config_file_path = 'config.json'
  15. with open(config_file_path) as json_file:
  16. config = json.load(json_file)
  17. return config
  18. def set_config(self):
  19. pass
  20. def add_device(self):
  21. pass
  22. def delete_device(self):
  23. pass
  24. def updata_device(self):
  25. pass