degal/image.py
author Tero Marttila <terom@fixme.fi>
Wed, 03 Jun 2009 19:23:10 +0300
branchuse-distutils
changeset 44 533b7e8b5d3b
parent 41 3b1579a7bffb
child 57 8d06e0283b88
permissions -rw-r--r--
strip copyright/license boilerplate from modules, except dexif and formatbytes
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
     1
import os, os.path
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
     2
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
     3
import PIL.Image
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
     4
33
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
     5
import dexif
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
     6
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
     7
import settings, utils, log
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
     8
from template import image as image_tpl
44
533b7e8b5d3b strip copyright/license boilerplate from modules, except dexif and formatbytes
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
     9
533b7e8b5d3b strip copyright/license boilerplate from modules, except dexif and formatbytes
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
    10
"""
533b7e8b5d3b strip copyright/license boilerplate from modules, except dexif and formatbytes
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
    11
    Handling induvidual Images
533b7e8b5d3b strip copyright/license boilerplate from modules, except dexif and formatbytes
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
    12
"""
533b7e8b5d3b strip copyright/license boilerplate from modules, except dexif and formatbytes
Tero Marttila <terom@fixme.fi>
parents: 41
diff changeset
    13
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    14
class Image (object) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    15
    def __init__ (self, dir, name) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    16
        # the image filename, e.g. DSC3948.JPG
27
301d738b1181 fix some unicode issues, and not-alive-dirs-in-subdirs-list issues
terom
parents: 14
diff changeset
    17
        self.name = unicode(name)
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    18
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    19
        # the Folder object that we are in
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    20
        self.dir = dir
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    21
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    22
        # the relative path from the root to us
27
301d738b1181 fix some unicode issues, and not-alive-dirs-in-subdirs-list issues
terom
parents: 14
diff changeset
    23
        self.path = dir.pathFor(self.name)
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    24
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    25
        # the basename+ext, e.g. DSCR3948, .JPG
27
301d738b1181 fix some unicode issues, and not-alive-dirs-in-subdirs-list issues
terom
parents: 14
diff changeset
    26
        self.base_name, self.ext = os.path.splitext(self.name)
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    27
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    28
        # our user-friendly title
27
301d738b1181 fix some unicode issues, and not-alive-dirs-in-subdirs-list issues
terom
parents: 14
diff changeset
    29
        self.title = self.name
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    30
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    31
        # our long-winded description
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    32
        self.descr = ''
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    33
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    34
        # the image before and after us, both may be None
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    35
        self.prev = self.next = None
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    36
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    37
        # the image-relative names for the html page, thumb and preview images
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    38
        self.html_name = self.name + ".html"
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    39
        self.thumb_name = utils.url_join(settings.THUMB_DIR, self.name)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    40
        self.preview_name = utils.url_join(settings.PREVIEW_DIR, self.name)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    41
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    42
        # the root-relative paths to the html page, thumb and preview images
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    43
        self.html_path = self.dir.pathFor(self.html_name)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    44
        self.thumb_path = self.dir.pathFor(settings.THUMB_DIR, self.name)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    45
        self.preview_path = self.dir.pathFor(settings.PREVIEW_DIR, self.name)        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    46
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    47
        #
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    48
        # Figured out after prepare
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    49
        #
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    50
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    51
        # (w, h) tuple
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    52
        self.img_size = None
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    53
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    54
        # the ShortURL code for this image
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    55
        self.shorturl_code = None
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    56
33
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
    57
	# EXIF data
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
    58
	self.exif_data = {}
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
    59
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    60
        # what to use in the rendered templates, intended to be overridden by subclasses
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    61
        self.series_act = "add"
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    62
        self.series_verb = "Add to"
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    63
    
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    64
    def getObjInfo (self) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    65
        """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    66
            Metadata for shorturl2.db
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    67
        """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    68
        return 'img', self.dir.path, self.name
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    69
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    70
    def breadcrumb (self) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    71
        """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    72
            Returns a [(fname, title)] list of this image's parents
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    73
       """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    74
        
13
c229bcb1de41 image breadcrumb links back to page that said image is on
terom
parents: 12
diff changeset
    75
        return self.dir.breadcrumb(forImg=self) + [(self.html_name, self.title)]
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    76
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    77
    def render (self) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    78
        """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    79
            Write out the .html file
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    80
        """
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    81
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    82
        # stat the image file to get the filesize and mtime
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    83
        st = os.stat(self.path)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    84
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    85
        self.filesize = st.st_size
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    86
        self.timestamp = st.st_mtime
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    87
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    88
        # open the image in PIL to get image attributes + generate thumbnails
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    89
        img = PIL.Image.open(self.path)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    90
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    91
        self.img_size = img.size
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    92
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    93
        for out_path, geom in ((self.thumb_path, settings.THUMB_GEOM), (self.preview_path, settings.PREVIEW_GEOM)) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    94
            # if it doesn't exist, or it's older than the image itself, generate
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
    95
            if utils.mtime(out_path) < self.timestamp :
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
    96
                log.info("render [%sx%s]", geom[0], geom[1], wait=True)
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    97
                
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    98
                # XXX: is this the most efficient way to do this? It seems slow
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
    99
                out_img = img.copy()
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   100
                out_img.thumbnail(geom, resample=True)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   101
                out_img.save(out_path)
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   102
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   103
                log.done()
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   104
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   105
        # look for the metadata file
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   106
        title_path = self.dir.pathFor(self.base_name + '.txt')
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   107
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   108
        self.title, self.descr = utils.readTitleDescr(title_path)
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   109
        
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   110
        if not self.title :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   111
            self.title = self.name
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   112
        
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   113
        if utils.mtime(self.html_path) < self.timestamp :
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   114
            log.info("render %s.html", self.name)
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   115
33
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   116
            # parse the exif data from the file
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   117
            try :
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   118
                    self.exif_data = dexif.parse_exif(self.path)
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   119
            except dexif.ExifError, message:
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   120
                    log.warning("Reading EXIF data for %s failed: %s" % (self.filename, message))
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   121
                    self.exif_data = {}
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   122
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   123
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   124
            image_tpl.render_to(self.html_path,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   125
                stylesheet_url             = self.dir.inRoot('style.css'),
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   126
                title                      = self.title,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   127
                breadcrumb                 = self.breadcrumb(),
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   128
                
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   129
                prev                       = self.prev,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   130
                next                       = self.next,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   131
                img                        = self,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   132
                
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   133
                description                = self.descr,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   134
                
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   135
                filename                   = self.name,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   136
                img_size                   = self.img_size,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   137
                file_size                  = self.filesize,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   138
                timestamp                  = self.timestamp,
33
4943047bfcb5 merged http://pajukanta.fi/temp/degal_exif_r33.tar.bz2 patch from Japsu
terom
parents: 28
diff changeset
   139
		exif_data		   = self.exif_data,
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   140
                
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   141
                shorturl                   = self.dir.inRoot('s', self.shorturl_code),
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   142
                shorturl_code              = self.shorturl_code,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   143
                
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   144
                series_url                 = self.dir.inRoot('series/%s/%s' % (self.series_act, self.shorturl_code)),
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   145
                series_verb                = self.series_verb,
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   146
            )   
12
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   147
    
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   148
    def __str__ (self) :
c2d8e9a754a1 Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
terom
parents:
diff changeset
   149
        return "Image `%s' in `%s'" % (self.name, self.dir.path)
28
70b6c13d084f fancy new log format
terom
parents: 27
diff changeset
   150