home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_769 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.6 KB  |  51 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, Timothy Legge <timlegge at gmail.com>'
  6. import os
  7. import time
  8. from calibre.devices.usbms.books import Book as Book_
  9.  
  10. class Book(Book_):
  11.     
  12.     def __init__(self, prefix, lpath, title, authors, mime, date, ContentType, thumbnail_name, size = None, other = None):
  13.         Book_.__init__(self, prefix, lpath)
  14.         self.title = title
  15.         if not authors:
  16.             self.authors = [
  17.                 '']
  18.         else:
  19.             self.authors = [
  20.                 authors]
  21.         if not title:
  22.             self.title = _('Unknown')
  23.         
  24.         self.mime = mime
  25.         self.size = size
  26.         if ContentType == '6':
  27.             self.datetime = time.strptime(date, '%Y-%m-%dT%H:%M:%S.%f')
  28.         else:
  29.             
  30.             try:
  31.                 self.datetime = time.gmtime(os.path.getctime(self.path))
  32.             except:
  33.                 self.datetime = time.gmtime()
  34.  
  35.         if thumbnail_name is not None:
  36.             self.thumbnail = ImageWrapper(thumbnail_name)
  37.         
  38.         self.tags = []
  39.         if other:
  40.             self.smart_update(other)
  41.         
  42.  
  43.  
  44.  
  45. class ImageWrapper(object):
  46.     
  47.     def __init__(self, image_path):
  48.         self.image_path = image_path
  49.  
  50.  
  51.