You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# import configparser
|
|
|
|
# import os
|
|
|
|
# from PyQt5.QtCore import *
|
|
|
|
# class SystemConfig(QObject):
|
|
|
|
# """系统配置参数"""
|
|
|
|
# config = configparser.ConfigParser()
|
|
|
|
# configPath=os.getcwd()+'/Config/system.conf'
|
|
|
|
# config.read(configPath)
|
|
|
|
# #获取配置文件值
|
|
|
|
# @classmethod
|
|
|
|
# def getConfig(cls,key):
|
|
|
|
# return cls.config.get('System',key)
|
|
|
|
|
|
|
|
# #设置配置文件值
|
|
|
|
# @classmethod
|
|
|
|
# def setConfig(cls,key,value):
|
|
|
|
# cls.config.set('System',key,value)
|
|
|
|
# cls.config.write(open(cls.configPath,'w'))
|
|
|
|
|
|
|
|
import os
|
|
|
|
import configparser
|
|
|
|
|
|
|
|
class SystemConfig:
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
configPath = os.getcwd() + '/config/system.conf'
|
|
|
|
config.read(configPath)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def getConfig(cls, key):
|
|
|
|
return cls.config.get('system', key)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setConfig(cls, key, value):
|
|
|
|
cls.config.set('system', key, value)
|
|
|
|
cls.config.write(open(cls.configPath, 'w'))
|
|
|
|
|