Small code clean ups
parent
7e45b2611d
commit
4ce3c7cb32
|
@ -108,7 +108,6 @@ morss will auto-detect what "mode" to use.
|
||||||
For this, you'll want to change a bit the architecture of the files, for example
|
For this, you'll want to change a bit the architecture of the files, for example
|
||||||
into something like this.
|
into something like this.
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
/
|
/
|
||||||
├── cgi
|
├── cgi
|
||||||
|
|
|
@ -72,7 +72,6 @@ def custom_handler(follow=None, delay=None, encoding=None):
|
||||||
handlers.append(HTTPRefreshHandler())
|
handlers.append(HTTPRefreshHandler())
|
||||||
handlers.append(UAHandler(DEFAULT_UA))
|
handlers.append(UAHandler(DEFAULT_UA))
|
||||||
handlers.append(BrowserlyHeaderHandler())
|
handlers.append(BrowserlyHeaderHandler())
|
||||||
|
|
||||||
handlers.append(EncodingFixHandler(encoding))
|
handlers.append(EncodingFixHandler(encoding))
|
||||||
|
|
||||||
if follow:
|
if follow:
|
||||||
|
|
|
@ -85,7 +85,7 @@ def parse(data, url=None, mimetype=None, encoding=None):
|
||||||
for path in ruleset['path']:
|
for path in ruleset['path']:
|
||||||
if fnmatch(url, path):
|
if fnmatch(url, path):
|
||||||
parser = [x for x in parsers if x.mode == ruleset['mode']][0]
|
parser = [x for x in parsers if x.mode == ruleset['mode']][0]
|
||||||
return parser(data, ruleset, encoding=encoding)
|
return parser(data, ruleset, encoding=encoding)
|
||||||
|
|
||||||
# 2) Try each and every parser
|
# 2) Try each and every parser
|
||||||
|
|
||||||
|
|
|
@ -550,7 +550,7 @@ def cgi_app(environ, start_response):
|
||||||
|
|
||||||
def middleware(func):
|
def middleware(func):
|
||||||
" Decorator to turn a function into a wsgi middleware "
|
" Decorator to turn a function into a wsgi middleware "
|
||||||
# This is called when parsing the code
|
# This is called when parsing the "@middleware" code
|
||||||
|
|
||||||
def app_builder(app):
|
def app_builder(app):
|
||||||
# This is called when doing app = cgi_wrapper(app)
|
# This is called when doing app = cgi_wrapper(app)
|
||||||
|
|
Loading…
Reference in New Issue