本文整理匯總了Python中photo.Photo.getFileType方法的典型用法代碼示例。如果您正苦於以下問題:Python Photo.getFileType方法的具體用法?Python Photo.getFileType怎麽用?Python Photo.getFileType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類photo.Photo
的用法示例。
在下文中一共展示了Photo.getFileType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _testPerPhotoPage
# 需要導入模塊: from photo import Photo [as 別名]
# 或者: from photo.Photo import getFileType [as 別名]
def _testPerPhotoPage(self, strip_originals):
'''
One test would be to have a page already generated, regenerate it with the
template and compare them.
'''
from photo import Photo
photo = Photo(join('data', 'fake_iphoto_library', '2005',
'03', '23','rotated_minus_90.jpg'))
prev = next = photo
dico = {}
dico['title'] = 'Youpi'
dico['width'] = str(photo.width)
dico['height'] = str(photo.height)
dico['size'] = str(photo.sizeKB)
class _datablob:
def __init__(self, **args):
self.__dict__.update(args)
infos = _datablob()
infos.model = 'le super appareil de la mort'
infos.date = 'premier janvier 2012'
infos.flash = 'flash avec les yeux rouges'
dico['exif_infos'] = infos
dico['preview'] = join('preview', 'pv_' + photo.id + photo.getFileType())
dico['preview_filename'] = basename(dico['preview'])
dico['prev'] = prev.id + '.html'
dico['prev_thumb'] = join('thumbs', 'th_' + prev.id + prev.getFileType())
dico['next'] = next.id + '.html'
dico['next_thumb'] = join('thumbs', 'th_' + next.id + next.getFileType())
original = join('photos', photo.id + photo.getFileType())
if strip_originals:
original = ''
dico['original'] = original
self._testTemplate(self.perpage, dico)