morss: move url/options parsing to own function
For future re-use
This commit is contained in:
		@@ -508,8 +508,9 @@ def process(url, cache=None, options=None):
 | 
				
			|||||||
    return FeedFormat(rss, options)
 | 
					    return FeedFormat(rss, options)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def cgi_app(environ, start_response):
 | 
					def cgi_parse_environ(environ):
 | 
				
			||||||
    # get options
 | 
					    # get options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if 'REQUEST_URI' in environ:
 | 
					    if 'REQUEST_URI' in environ:
 | 
				
			||||||
        url = environ['REQUEST_URI'][1:]
 | 
					        url = environ['REQUEST_URI'][1:]
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
@@ -535,11 +536,18 @@ def cgi_app(environ, start_response):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # init
 | 
					    # init
 | 
				
			||||||
    options = Options(filterOptions(parseOptions(raw_options)))
 | 
					    options = Options(filterOptions(parseOptions(raw_options)))
 | 
				
			||||||
    headers = {}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    global DEBUG
 | 
					    global DEBUG
 | 
				
			||||||
    DEBUG = options.debug
 | 
					    DEBUG = options.debug
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return (url, options)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def cgi_app(environ, start_response):
 | 
				
			||||||
 | 
					    url, options = cgi_parse_environ(environ)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    headers = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # headers
 | 
					    # headers
 | 
				
			||||||
    headers['status'] = '200 OK'
 | 
					    headers['status'] = '200 OK'
 | 
				
			||||||
    headers['cache-control'] = 'max-age=%s' % DELAY
 | 
					    headers['cache-control'] = 'max-age=%s' % DELAY
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user