lib/image.py
changeset 27 301d738b1181
parent 14 4b5478da5850
child 28 70b6c13d084f
equal deleted inserted replaced
26:81d6679d50d0 27:301d738b1181
    27 from template import image as image_tpl
    27 from template import image as image_tpl
    28     
    28     
    29 class Image (object) :
    29 class Image (object) :
    30     def __init__ (self, dir, name) :
    30     def __init__ (self, dir, name) :
    31         # the image filename, e.g. DSC3948.JPG
    31         # the image filename, e.g. DSC3948.JPG
    32         self.name = name
    32         self.name = unicode(name)
    33 
    33 
    34         # the Folder object that we are in
    34         # the Folder object that we are in
    35         self.dir = dir
    35         self.dir = dir
    36         
    36         
    37         # the relative path from the root to us
    37         # the relative path from the root to us
    38         self.path = dir.pathFor(name)
    38         self.path = dir.pathFor(self.name)
    39 
    39 
    40         # the basename+ext, e.g. DSCR3948, .JPG
    40         # the basename+ext, e.g. DSCR3948, .JPG
    41         self.base_name, self.ext = os.path.splitext(name)
    41         self.base_name, self.ext = os.path.splitext(self.name)
    42         
    42         
    43         # our user-friendly title
    43         # our user-friendly title
    44         self.title = name
    44         self.title = self.name
    45 
    45 
    46         # our long-winded description
    46         # our long-winded description
    47         self.descr = ''
    47         self.descr = ''
    48 
    48 
    49         # the image before and after us, both may be None
    49         # the image before and after us, both may be None