comparison MoinMoin/wikiutil.py @ 2607:2e6227a50d27

fix exception when there are no interwiki map files or page
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 05 Aug 2007 17:25:36 +0200
parents f4c371b00fec
children c6b5c2d813b6 6cb75379c073
comparison
equal deleted inserted replaced
2606:482f0a9e555c 2607:2e6227a50d27
528 page page. """ 528 page page. """
529 timestamps = [os.stat(filename).st_mtime for filename in file_list] 529 timestamps = [os.stat(filename).st_mtime for filename in file_list]
530 if page.exists(): 530 if page.exists():
531 # exists() is cached and thus cheaper than mtime_usecs() 531 # exists() is cached and thus cheaper than mtime_usecs()
532 timestamps.append(version2timestamp(page.mtime_usecs())) 532 timestamps.append(version2timestamp(page.mtime_usecs()))
533 return max(timestamps) 533 if timestamps:
534 534 return max(timestamps)
535 else:
536 return 0 # no files / pages there
535 537
536 def load_wikimap(request): 538 def load_wikimap(request):
537 """ load interwiki map (once, and only on demand) """ 539 """ load interwiki map (once, and only on demand) """
538 from MoinMoin.Page import Page 540 from MoinMoin.Page import Page
539 541