MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / UnicodeRawConfigParser

Class UnicodeRawConfigParser

lib/core/common.py:210–238  ·  view source on GitHub ↗

RawConfigParser with unicode writing support

Source from the content-addressed store, hash-verified

208from thirdparty.termcolor.termcolor import colored
209
210class UnicodeRawConfigParser(_configparser.RawConfigParser):
211 """
212 RawConfigParser with unicode writing support
213 """
214
215 def write(self, fp):
216 """
217 Write an .ini-format representation of the configuration state.
218 """
219
220 if self._defaults:
221 fp.write("[%s]\n" % _configparser.DEFAULTSECT)
222
223 for (key, value) in self._defaults.items():
224 fp.write("%s = %s" % (key, getUnicode(value, UNICODE_ENCODING)))
225
226 fp.write("\n")
227
228 for section in self._sections:
229 fp.write("[%s]\n" % section)
230
231 for (key, value) in self._sections[section].items():
232 if key != "__name__":
233 if value is None:
234 fp.write("%s\n" % (key))
235 elif not isListLike(value):
236 fp.write("%s = %s\n" % (key, getUnicode(value, UNICODE_ENCODING)))
237
238 fp.write("\n")
239
240class Format(object):
241 @staticmethod

Callers 2

configFileParserFunction · 0.90
saveConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…