X-Git-Url: https://codewiz.org/gitweb?p=geekigeeki.git;a=blobdiff_plain;f=geekigeeki.py;h=c5b51096a1fbecfe242b189b8d84625b152cdb65;hp=5b98397af612e174205412d723ed251dfa82ed39;hb=99fb949cf7923eaab08664706287c120b1a93d79;hpb=60a48cbc0a948ba2a1149239f8a53c4e2c73f4fc
diff --git a/geekigeeki.py b/geekigeeki.py
index 5b98397..c5b5109 100755
--- a/geekigeeki.py
+++ b/geekigeeki.py
@@ -18,9 +18,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-__version__ = '$Id$'[4:12]
+__version__ = '4.0-' + '$Id$'[4:11]
-from time import clock
+from time import clock, localtime, gmtime, strftime
start_time = clock()
title_done = False
@@ -105,7 +105,9 @@ def url_args(kvargs):
return ''
# Formatting stuff --------------------------------------------------
-def emit_header(mime_type="text/html"):
+def emit_header(mtime=None, mime_type="text/html"):
+ if mtime:
+ print("Last-Modified: " + strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime(mtime)))
print("Content-type: " + mime_type + "; charset=utf-8\n")
def send_guru(msg_text, msg_type):
@@ -119,12 +121,12 @@ def send_guru(msg_text, msg_type):
print('' \
% relative_url('sys/GuruMeditation.js'))
-def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=False):
+def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=False, mtime=None):
global title_done
if title_done: return
# Head
- emit_header()
+ emit_header(mtime)
print('')
print('')
@@ -332,20 +334,21 @@ def page_list(dirname=None, re=None):
re = re.compile(r"^\b((([A-Z][a-z0-9]+){2,}/)*([A-Z][a-z0-9]+){2,})\b$")
return sorted(filter(re.match, os.listdir(dirname or data_dir)))
-def send_footer(mod_string=None):
+def send_footer(mtime=None):
if globals().get('debug_cgi', False):
cgi.print_arguments()
cgi.print_form(form)
cgi.print_environ()
+ #FIXME link_inline("sys/footer")
print('''