Set urlPath var earlier
parent
4ece739722
commit
e5fc9786f6
14
morss.py
14
morss.py
|
@ -525,14 +525,20 @@ if __name__ == '__main__':
|
||||||
if 'REQUEST_URI' in os.environ:
|
if 'REQUEST_URI' in os.environ:
|
||||||
HOLD = True
|
HOLD = True
|
||||||
|
|
||||||
if 'HTTP_IF_NONE_MATCH' in os.environ and not options.force:
|
if 'HTTP_IF_NONE_MATCH' in os.environ:
|
||||||
if time.time() - int(os.environ['HTTP_IF_NONE_MATCH'][1:-1]) < DELAY:
|
if not options.force and time.time() - int(os.environ['HTTP_IF_NONE_MATCH'][1:-1]) < DELAY:
|
||||||
print 'Status: 304'
|
print 'Status: 304'
|
||||||
print
|
print
|
||||||
log(url)
|
log(url)
|
||||||
log('etag good')
|
log('etag good')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
cachePath = os.getcwd() + '/cache'
|
||||||
|
|
||||||
|
else:
|
||||||
|
cachePath = os.path.expanduser('~') + '/.cache/morss'
|
||||||
|
|
||||||
|
if 'REQUEST_URI' in os.environ:
|
||||||
print 'Status: 200'
|
print 'Status: 200'
|
||||||
print 'ETag: "%s"' % int(time.time())
|
print 'ETag: "%s"' % int(time.time())
|
||||||
|
|
||||||
|
@ -548,10 +554,6 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
HOLD = False
|
HOLD = False
|
||||||
|
|
||||||
cachePath = os.getcwd() + '/cache'
|
|
||||||
else:
|
|
||||||
cachePath = os.path.expanduser('~') + '/.cache/morss'
|
|
||||||
|
|
||||||
if url is None:
|
if url is None:
|
||||||
print 'Please provide url.'
|
print 'Please provide url.'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in New Issue