terom@51: """ terom@51: Configuration terom@51: """ terom@51: terom@51: class Configuration (object) : terom@51: """ terom@51: Various configuration settings terom@51: """ terom@51: terom@60: # the path to the gallery terom@60: gallery_path = "." terom@60: terom@51: # the name of the gallery terom@51: gallery_title = "Image Gallery" terom@51: terom@51: # recognized image extensions terom@51: image_exts = ('jpg', 'jpeg', 'png', 'gif', 'bmp') terom@51: terom@51: # subdirectory used for generated thumbnails/previews terom@51: thumb_dir = 'thumbs' terom@51: preview_dir = 'previews' terom@51: terom@51: # size of generated thumbnails/previews terom@51: thumb_size = (160, 120) terom@51: preview_size = (640, 480) terom@51: terom@57: # number of images displayed per folder page terom@57: images_per_page = 50 terom@57: terom@57: # exif tags used in output terom@57: # Copyright (C) 2008, Santtu Pajukanta terom@57: # XXX: import from dexif? terom@57: exif_tags = [ terom@57: # TODO Create date is in a useless format, needs some strptime love terom@57: ("CreateDate", "Create date" ), terom@57: ("Model", "Camera model" ), terom@57: ("Aperture", "Aperture" ), terom@57: ("ExposureMode", "Exposure mode" ), terom@57: ("ExposureCompensation", "Exposure compensation" ), terom@57: ("ExposureTime", "Exposure time" ), terom@57: ("Flash", "Flash mode" ), terom@57: ("ISO", "ISO" ), terom@57: ("ShootingMode", "Shooting mode" ), terom@57: ("LensType", "Lens type" ), terom@57: ("FocalLength", "Focal length" ) terom@57: ] terom@57: terom@60: ## runtime settings terom@60: terom@60: # do not modify anything terom@60: read_only = False terom@60: terom@60: terom@60: ### functions terom@57: def is_image (self, file) : terom@57: """ terom@57: Tests if the given File is an image, based on its file extension terom@57: """ terom@57: terom@57: return file.matchext(self.image_exts) terom@57: terom@57: # XXX: move elsewhere? terom@57: def get_renderer (self) : terom@57: return render.RenderMachine(self)