diff options
-rw-r--r-- | cgi-bin/link.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cgi-bin/link.py b/cgi-bin/link.py index 6075ea2..2fe8973 100644 --- a/cgi-bin/link.py +++ b/cgi-bin/link.py @@ -1,5 +1,5 @@ # -*- coding: utf8 -*- -import os.path, datetime, config +import os, datetime, config class Link: def __init__(self, filename=""): @@ -54,6 +54,14 @@ class Link: else: #print os.path.realpath(filename) return False + + def first(self): + index=os.listdir(os.path.realpath(self.datadir)) + remove=('latest.jpeg', 'notfound.jpeg') + for r in remove: + index.remove(r) + index.sort() + return index[0] def link(self, target, link): #print target |