--- 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
+"""
--- 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")
--- 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
--- 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
--- 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
--- 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 = []
--- 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
--- 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'
--- 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) :
"""
--- 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,
--- 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?