class RCDataConfig(IConfig):
def __init__(self):
pass
def read_config(self, file_path):
file = open(file_path, 'rb')
file_content = file.read()
file.close()
idxs = file_content.find('*grds*')
idxe = file_content.find('*grde*')
return file_content[idxs + 6:idxe]
class IRuntimeConfig():
__metaclass__ = ABCMeta
@abstractmethod
def read_config(self):
pass
def write_config(self, data):
pass
class DSVRuntimeConfig(IRuntimeConfig):
def __init__(self):
self.path = None
return
def read_config(self):
if os.path.exists(self.path):
fd = open(self.path, 'r')
config = fd.read()
fd.close()
return config
return ''
def write_config(self, data):
fd = open(self.path, 'w')
fd.write(data)
fd.close()