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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from pygments.plugin import find_plugin_styles
  5. from pygments.util import ClassNotFound
  6. STYLE_MAP = {
  7.     'default': 'default::DefaultStyle',
  8.     'emacs': 'emacs::EmacsStyle',
  9.     'friendly': 'friendly::FriendlyStyle',
  10.     'colorful': 'colorful::ColorfulStyle',
  11.     'autumn': 'autumn::AutumnStyle',
  12.     'murphy': 'murphy::MurphyStyle',
  13.     'manni': 'manni::ManniStyle',
  14.     'monokai': 'monokai::MonokaiStyle',
  15.     'perldoc': 'perldoc::PerldocStyle',
  16.     'pastie': 'pastie::PastieStyle',
  17.     'borland': 'borland::BorlandStyle',
  18.     'trac': 'trac::TracStyle',
  19.     'native': 'native::NativeStyle',
  20.     'fruity': 'fruity::FruityStyle',
  21.     'bw': 'bw::BlackWhiteStyle',
  22.     'vs': 'vs::VisualStudioStyle',
  23.     'tango': 'tango::TangoStyle' }
  24.  
  25. def get_style_by_name(name):
  26.     
  27.     try:
  28.         mod = __import__('pygments.styles.' + mod, None, None, [
  29.             cls])
  30.     except ImportError:
  31.         None if name in STYLE_MAP else name == found_name
  32.         None if name in STYLE_MAP else name == found_name
  33.         if builtin:
  34.             pass
  35.         raise ClassNotFound('Could not find style module %r' % mod + ', though it should be builtin' + '.')
  36.     except:
  37.         None if name in STYLE_MAP else name == found_name
  38.  
  39.     
  40.     try:
  41.         return getattr(mod, cls)
  42.     except AttributeError:
  43.         None if name in STYLE_MAP else name == found_name
  44.         None if name in STYLE_MAP else name == found_name
  45.         raise ClassNotFound('Could not find style class %r in style module.' % cls)
  46.     except:
  47.         None if name in STYLE_MAP else name == found_name
  48.  
  49.  
  50.  
  51. def get_all_styles():
  52.     for name in STYLE_MAP:
  53.         yield name
  54.     
  55.     for name, _ in find_plugin_styles():
  56.         yield name
  57.     
  58.  
  59.