cgi.py: rename parseOptions to parse_options
parent
7a560181f7
commit
97ccc15db0
12
morss/cgi.py
12
morss/cgi.py
|
@ -19,7 +19,7 @@ from .morss import Options, log, DELAY, MorssException
|
|||
from . import cred
|
||||
|
||||
|
||||
def parseOptions(options):
|
||||
def parse_options(options):
|
||||
""" Turns ['md=True'] into {'md':True} """
|
||||
out = {}
|
||||
|
||||
|
@ -27,13 +27,6 @@ def parseOptions(options):
|
|||
split = option.split('=', 1)
|
||||
|
||||
if len(split) > 1:
|
||||
if split[0].lower() == 'true':
|
||||
out[split[0]] = True
|
||||
|
||||
elif split[0].lower() == 'false':
|
||||
out[split[0]] = False
|
||||
|
||||
else:
|
||||
out[split[0]] = split[1]
|
||||
|
||||
else:
|
||||
|
@ -62,6 +55,7 @@ def cgi_parse_environ(environ):
|
|||
|
||||
if len(split) > 1:
|
||||
url = split[1]
|
||||
|
||||
else:
|
||||
url = ''
|
||||
|
||||
|
@ -69,7 +63,7 @@ def cgi_parse_environ(environ):
|
|||
raw_options = []
|
||||
|
||||
# init
|
||||
options = Options(parseOptions(raw_options))
|
||||
options = Options(parse_options(raw_options))
|
||||
|
||||
return (url, options)
|
||||
|
||||
|
|
Loading…
Reference in New Issue