MCPcopy
hub / github.com/PyMySQL/PyMySQL / Parser

Class Parser

pymysql/optionfile.py:4–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4class Parser(configparser.RawConfigParser):
5 def __init__(self, **kwargs):
6 kwargs["allow_no_value"] = True
7 configparser.RawConfigParser.__init__(self, **kwargs)
8
9 def __remove_quotes(self, value):
10 quotes = ["'", '"']
11 for quote in quotes:
12 if len(value) >= 2 and value[0] == value[-1] == quote:
13 return value[1:-1]
14 return value
15
16 def optionxform(self, key):
17 return key.lower().replace("_", "-")
18
19 def get(self, section, option):
20 value = configparser.RawConfigParser.get(self, section, option)
21 return self.__remove_quotes(value)

Callers 2

test_stringMethod · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

test_stringMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…