Advertisement
Guest User

Untitled

a guest
Jan 18th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import os
  2. from calibre.customize import CatalogPlugin
  3.  
  4. class VirtualShelf(CatalogPlugin):
  5.     name                = 'Virtual Shelf plugin'
  6.     description         = 'Generates an HTML like a traditional shelf'
  7.     supported_platforms = ['windows', 'osx', 'linux']
  8.     author              = 'Carles Pina i Estany'
  9.     version             = (0, 0, 1)
  10.     file_types          = set(['html'])
  11.     cli_options         = []
  12.     minimum_calibre_version = (0, 7, 53)
  13.  
  14.     def run(self, path_to_output, opts, db, Notification=None):
  15.         print "VirtualShelf"
  16.         print "db:",db
  17.         print "opts:",opts
  18.         file = open(path_to_output, 'w')
  19.  
  20.         opts.sort_by="author"
  21.  
  22.         data = self.search_sort_db(db, opts)
  23.  
  24.         for entry in data:
  25.             file.write("title:"+entry['title'] + "\n")
  26.  
  27.         return path_to_output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement