format configparser.py

This commit is contained in:
lyon 2022-07-04 17:46:46 +08:00
parent 8e05c3ff0b
commit 26d59b09b0

View File

@ -5,10 +5,6 @@ class ConfigParser():
content = '' content = ''
config_dict = {} config_dict = {}
def read_string(self, content):
self.content = content
self._parse()
def _parse(self): def _parse(self):
content = String(self.content) content = String(self.content)
lines = content.split('\n') lines = content.split('\n')
@ -87,12 +83,18 @@ class ConfigParser():
return content return content
def write(self, file_name): def write(self, file_name):
self.content = self.__str__(self)
print('Error: write() method not implemented') print('Error: write() method not implemented')
print(self.content)
raise raise
self.content = self.__str__(self)
print(self.content)
def read_string(self, content):
self.content = content
self._parse()
def read(self, file_name): def read(self, file_name):
print('Error: read() method not implemented') print('Error: read() method not implemented')
raise raise
content = ''
self.content = content
self._parse() self._parse()