Common code for url/options handling
parent
89662ccbae
commit
1f4c219880
11
morss.py
11
morss.py
|
@ -457,27 +457,26 @@ def Gather(url, cachePath, mode='feed'):
|
|||
return root.tostring(xml_declaration=True, encoding='UTF-8')
|
||||
|
||||
if __name__ == "__main__":
|
||||
if 'REQUEST_URI' in os.environ:
|
||||
url, options = parseOptions(OPTIONS)
|
||||
|
||||
if 'REQUEST_URI' in os.environ:
|
||||
print 'Status: 200'
|
||||
|
||||
if options == 'progress':
|
||||
print 'Content-Type: application/octet-stream\n'
|
||||
print 'Content-Type: application/octet-stream'
|
||||
else:
|
||||
print 'Content-Type: text/html\n'
|
||||
print 'Content-Type: text/html'
|
||||
print
|
||||
|
||||
cache = os.getcwd() + '/cache'
|
||||
log(url)
|
||||
else:
|
||||
url, options = parseOptions(OPTIONS)
|
||||
cache = os.path.expanduser('~') + '/.cache/morss'
|
||||
|
||||
if url is None:
|
||||
print "Please provide url."
|
||||
sys.exit(1)
|
||||
|
||||
cache = os.path.expanduser('~') + '/.cache/morss'
|
||||
|
||||
if options == 'progress':
|
||||
MAX_TIME = -1
|
||||
if options == 'cache':
|
||||
|
|
Loading…
Reference in New Issue