# HG changeset patch # User Tero Marttila # Date 1244046190 -10800 # Node ID 533b7e8b5d3b2bc8a31f264da5114cf52bf7c54f # Parent d229f64aeb39f558cb1da2e94aee8b65a1e5a0cc strip copyright/license boilerplate from modules, except dexif and formatbytes diff -r d229f64aeb39 -r 533b7e8b5d3b degal/__init__.py --- a/degal/__init__.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/__init__.py Wed Jun 03 19:23:10 2009 +0300 @@ -0,0 +1,3 @@ +""" + Degal - an image gallery +""" diff -r d229f64aeb39 -r 533b7e8b5d3b degal/db.py --- a/degal/db.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/db.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,23 +1,3 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import sqlite3 conn = sqlite3.connect("db/degal.db") diff -r d229f64aeb39 -r 533b7e8b5d3b degal/folder.py --- a/degal/folder.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/folder.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,23 +1,3 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import os, os.path import settings, image, utils, helpers, log diff -r d229f64aeb39 -r 533b7e8b5d3b degal/helpers.py --- a/degal/helpers.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/helpers.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,28 +1,11 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -# template helper functions import urllib from formatbytes import formatbytes from datetime import datetime +""" + Helper functions for use in templates +""" + def iter_is_first (seq) : flag = True diff -r d229f64aeb39 -r 533b7e8b5d3b degal/image.py --- a/degal/image.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/image.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,23 +1,3 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import os, os.path import PIL.Image @@ -26,7 +6,11 @@ import settings, utils, log from template import image as image_tpl - + +""" + Handling induvidual Images +""" + class Image (object) : def __init__ (self, dir, name) : # the image filename, e.g. DSC3948.JPG diff -r d229f64aeb39 -r 533b7e8b5d3b degal/log.py --- a/degal/log.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/log.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,24 +1,8 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# +import logging, sys -import logging, sys +""" + Fancy tree-structured logging output +""" log_level = logging.INFO stack = [] diff -r d229f64aeb39 -r 533b7e8b5d3b degal/req.py --- a/degal/req.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/req.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,27 +1,11 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import cgi import Cookie import os +""" + XXX: legacy CGI crap +""" + vars = cgi.FieldStorage() # the cookie with the user's current series diff -r d229f64aeb39 -r 533b7e8b5d3b degal/settings.py --- a/degal/settings.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/settings.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,3 +1,8 @@ + +""" + XXX: settings, bad +""" + TEMPLATE_DIR = './templates' TEMPLATE_EXT = 'html' diff -r d229f64aeb39 -r 533b7e8b5d3b degal/shorturl.py --- a/degal/shorturl.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/shorturl.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,30 +1,13 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import struct import base64 import shelve import os.path +import utils, db, helpers, folder, image, log -import utils, db, helpers, folder, image, log +""" + Methods for generating/using ShortURLs +""" def int2key (id) : """ diff -r d229f64aeb39 -r 533b7e8b5d3b degal/template.py --- a/degal/template.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/template.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,23 +1,3 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - from mako import exceptions from mako.lookup import TemplateLookup @@ -25,6 +5,10 @@ import log +""" + Locating and rendering templates +""" + _lookup = TemplateLookup( directories=[settings.TEMPLATE_DIR], module_directory='%s/cache' % settings.TEMPLATE_DIR, diff -r d229f64aeb39 -r 533b7e8b5d3b degal/utils.py --- a/degal/utils.py Wed Jun 03 19:22:41 2009 +0300 +++ b/degal/utils.py Wed Jun 03 19:23:10 2009 +0300 @@ -1,27 +1,11 @@ -# DeGAL - A pretty simple web image gallery -# Copyright (C) 2007 Tero Marttila -# http://marttila.de/~terom/degal/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - import os, os.path import settings +""" + Miscellaneous utilities +""" + def isImage (fname) : """ Is the given filename likely to be an image file?