home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_782 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1001 b   |  28 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from __future__ import with_statement
  5. __license__ = 'GPL 3'
  6. __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
  7. __docformat__ = 'restructuredtext en'
  8. from calibre import guess_type
  9.  
  10. def _mt(path):
  11.     mt = guess_type(path)[0]
  12.     if not mt:
  13.         mt = 'application/octet-stream'
  14.     
  15.     return mt
  16.  
  17.  
  18. def mime_type_ext(ext):
  19.     if not ext.startswith('.'):
  20.         ext = '.' + ext
  21.     
  22.     return _mt('a' + ext)
  23.  
  24.  
  25. def mime_type_path(path):
  26.     return _mt(path)
  27.  
  28.