source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/gluon/contrib/pymysql/optionfile.py

main
Last change on this file was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 522 bytes
Line 
1from ._compat import PY2
2
3if PY2:
4    import ConfigParser as configparser
5else:
6    import configparser
7
8
9class Parser(configparser.RawConfigParser):
10
11    def __remove_quotes(self, value):
12        quotes = ["'", "\""]
13        for quote in quotes:
14            if len(value) >= 2 and value[0] == value[-1] == quote:
15                return value[1:-1]
16        return value
17
18    def get(self, section, option):
19        value = configparser.RawConfigParser.get(self, section, option)
20        return self.__remove_quotes(value)
Note: See TracBrowser for help on using the repository browser.