mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
format configparser.py
This commit is contained in:
parent
8e05c3ff0b
commit
26d59b09b0
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user