bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def generate_annotation_paths(ids, db, device): # Generate path templates # Individual storage mount points scanned/resolved in driver.get_annotations() path_map = {} for id in ids: mi = db.get_metadata(id, index_is_id=True) a_path = device.create_upload_path(os.path.abspath('/<storage>'), mi, 'x.bookmark', create_dirs... | def generate_annotation_paths(ids, db, device): # Generate path templates # Individual storage mount points scanned/resolved in driver.get_annotations() path_map = {} for id in ids: mi = db.get_metadata(id, index_is_id=True) a_path = device.create_upload_path(os.path.abspath('/<storage>'), mi, 'x.bookmark', create_dirs... | 451,200 |
def generate_annotation_paths(ids, db, device): # Generate path templates # Individual storage mount points scanned/resolved in driver.get_annotations() path_map = {} for id in ids: mi = db.get_metadata(id, index_is_id=True) a_path = device.create_upload_path(os.path.abspath('/<storage>'), mi, 'x.bookmark', create_dirs... | def generate_annotation_paths(ids, db, device): # Generate path templates # Individual storage mount points scanned/resolved in driver.get_annotations() path_map = {} for id in ids: mi = db.get_metadata(id, index_is_id=True) a_path = device.create_upload_path(os.path.abspath('/<storage>'), mi, 'x.bookmark', create_dirs... | 451,201 |
def annotations_fetched(self, job): | def annotations_fetched(self, job): | 451,202 |
def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | 451,203 |
def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | 451,204 |
def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | def __init__(self, parent, db, annotation_map, done_callback): QThread.__init__(self, parent) self.db = db self.pd = ProgressDialog(_('Merging user annotations into database'), '', 0, len(job.result), parent=parent) | 451,205 |
def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | 451,206 |
def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | 451,207 |
def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | def generate_annotation_html(self, bookmark): # Returns <div class="user_annotations"> ... </div> last_read_location = bookmark.last_read_location timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read | 451,208 |
def catalog_generated(self, job): if job.result: # Search terms nulled catalog results return error_dialog(self, _('No books found'), _("No books to catalog\nCheck exclude tags"), show=True) if job.failed: return self.job_exception(job) id = self.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title... | def catalog_generated(self, job): if job.result: # Search terms nulled catalog results return error_dialog(self, _('No books found'), _("No books to catalog\nCheck exclude tags"), show=True) if job.failed: return self.job_exception(job) id = self.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title... | 451,209 |
def catalog_generated(self, job): if job.result: # Search terms nulled catalog results return error_dialog(self, _('No books found'), _("No books to catalog\nCheck exclude tags"), show=True) if job.failed: return self.job_exception(job) id = self.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title... | def catalog_generated(self, job): if job.result: # Search terms nulled catalog results return error_dialog(self, _('No books found'), _("No books to catalog\nCheck exclude tags"), show=True) if job.failed: return self.job_exception(job) id = self.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title... | 451,210 |
def __init__(self, db, opts, embedded=False, show_tracebacks=True): self.db = db for item in self.db: item break self.opts = opts self.embedded = embedded self.max_cover_width, self.max_cover_height = \ map(int, self.opts.max_cover.split('x')) self.max_stanza_items = opts.max_opds_items path = P('content_server') self.... | def__init__(self,db,opts,embedded=False,show_tracebacks=True):self.db=dbforiteminself.db:itembreakself.opts=optsself.embedded=embeddedself.max_cover_width,self.max_cover_height=\map(int,self.opts.max_cover.split('x'))self.max_stanza_items=opts.max_opds_itemspath=P('content_server')self.build_time=fromtimestamp(os.stat(... | 451,211 |
def __init__(self, db, opts, embedded=False, show_tracebacks=True): self.db = db for item in self.db: item break self.opts = opts self.embedded = embedded self.max_cover_width, self.max_cover_height = \ map(int, self.opts.max_cover.split('x')) self.max_stanza_items = opts.max_opds_items path = P('content_server') self.... | def __init__(self, db, opts, embedded=False, show_tracebacks=True): self.db = db for item in self.db: item break self.opts = opts self.embedded = embedded self.max_cover_width, self.max_cover_height = \ map(int, self.opts.max_cover.split('x')) self.max_stanza_items = opts.max_opds_items path = P('content_server') self.... | 451,212 |
def exit(self): cherrypy.engine.exit() | def exit(self): cherrypy.engine.exit() | 451,213 |
def get_mx(host, verbose=0): import dns.resolver if verbose: print 'Find mail exchanger for', host answers = list(dns.resolver.query(host, 'MX')) answers.sort(cmp=lambda x, y: cmp(int(x.preference), int(y.preference))) return [str(x.exchange) for x in answers] | def get_mx(host, verbose=0): import dns.resolver if verbose: print 'Find mail exchanger for', host answers = list(dns.resolver.query(host, 'MX')) answers.sort(cmp=lambda x, y: cmp(int(getattr(x, 'preference', sys.maxint)), int(getattr(y, 'preference', sys.maxint)))) return [str(x.exchange) for x in answers if hasattr(x... | 451,214 |
def set_path(self, index, index_is_id=False, commit=True): ''' Set the path to the directory containing this books files based on its current title and author. If there was a previous directory, its contents are copied and it is deleted. ''' id = index if index_is_id else self.id(index) path = self.construct_path_name... | def set_path(self, index, index_is_id=False, commit=True): ''' Set the path to the directory containing this books files based on its current title and author. If there was a previous directory, its contents are copied and it is deleted. ''' id = index if index_is_id else self.id(index) path = self.construct_path_name... | 451,215 |
def fb2mlize_images(self): ''' This function uses the self.image_hrefs dictionary mapping. It is populated by the dump_text function. ''' images = [] for item in self.oeb_book.manifest: # Don't write the image if it's not referenced in the document's text. if item.href not in self.image_hrefs: continue if item.media_ty... | def fb2mlize_images(self): ''' This function uses the self.image_hrefs dictionary mapping. It is populated by the dump_text function. ''' images = [] for item in self.oeb_book.manifest: # Don't write the image if it's not referenced in the document's text. if item.href not in self.image_hrefs: continue if item.media_ty... | 451,216 |
def key_pressed(self, event): self.normalize_state() if self._in_a_search: self.emit(SIGNAL('changed()')) self._in_a_search = False if event.key() in (Qt.Key_Return, Qt.Key_Enter): self.do_search() self.timer.start(1500) | def key_pressed(self, event): self.normalize_state() if self._in_a_search: self.emit(SIGNAL('changed()')) self._in_a_search = False if event.key() in (Qt.Key_Return, Qt.Key_Enter): self.do_search() self.timer.start(1500) | 451,217 |
def shutdown(self, write_settings=True): self.db.clean() for action in self.iactions.values(): if not action.shutting_down(): return if write_settings: self.write_settings() self.check_messages_timer.stop() self.update_checker.terminate() self.listener.close() self.job_manager.server.close() while self.spare_servers: s... | def shutdown(self, write_settings=True): l = getattr(self, 'library_view', None) if l: l = getattr(l, 'model', None); if l: l = l().db if l: l.clean() for action in self.iactions.values(): if not action.shutting_down(): return if write_settings: self.write_settings() self.check_messages_timer.stop() self.update_checker... | 451,218 |
def set_books_in_library(self, booklists, reset=False): if reset: # First build a cache of the library, so the search isn't On**2 self.db_book_title_cache = {} self.db_book_uuid_cache = set() db = self.library_view.model().db for id in db.data.iterallids(): mi = db.get_metadata(id, index_is_id=True) title = re.sub('(?u... | def set_books_in_library(self, booklists, reset=False): if reset: # First build a cache of the library, so the search isn't On**2 self.db_book_title_cache = {} self.db_book_uuid_cache = set() db = self.library_view.model().db for id in db.data.iterallids(): mi = db.get_metadata(id, index_is_id=True) title = re.sub('(?u... | 451,219 |
def __init__(self, db, book_id, regex, *args): QDialog.__init__(self, *args) self.setupUi(self) | def __init__(self, db, book_id, regex, *args): QDialog.__init__(self, *args) self.setupUi(self) | 451,220 |
def select_format(self, db, book_id): format = None formats = db.formats(book_id, index_is_id=True).upper().split(',') if len(formats) == 1: format = formats[0] elif len(formats) > 1: d = ChooseFormatDialog(self, _('Choose the format to view'), formats) d.exec_() if d.result() == QDialog.Accepted: format = d.format() | def select_format(self, db, book_id): format = None formats = db.formats(book_id, index_is_id=True).upper().split(',') if len(formats) == 1: format = formats[0] elif len(formats) > 1: d = ChooseFormatDialog(self, _('Choose the format to view'), formats) d.exec_() if d.result() == QDialog.Accepted: format = d.format() | 451,221 |
def set_search_restriction(self, s): self.db.data.set_search_restriction(s) | def set_search_restriction(self, s): self.db.data.set_search_restriction(s) | 451,222 |
def _fetch(self): try: self.fetch() if self.results: c = self.config_store().get(self.name, {}) res = self.results if hasattr(res, 'authors'): res = [res] for mi in res: if not c.get('rating', True): mi.rating = None if not c.get('comments', True): mi.comments = None if c.get('textconvert', True) and mi.comments is not... | def _fetch(self): try: self.fetch() if self.results: c = self.config_store().get(self.name, {}) res = self.results if hasattr(res, 'authors'): res = [res] for mi in res: if not c.get('rating', True): mi.rating = None if not c.get('comments', True): mi.comments = None if not c.get('tags', True): mi.tags = [] if self.has... | 451,223 |
def config_widget(self): from PyQt4.Qt import QWidget, QVBoxLayout, QLabel, Qt, QLineEdit, \ QCheckBox from calibre.customize.ui import config w = QWidget() w._layout = QVBoxLayout(w) w.setLayout(w._layout) if self.string_customization_help is not None: w._sc_label = QLabel(self.string_customization_help, w) w._layout.... | def config_widget(self): from PyQt4.Qt import QWidget, QVBoxLayout, QLabel, Qt, QLineEdit, \ QCheckBox from calibre.customize.ui import config w = QWidget() w._layout = QVBoxLayout(w) w.setLayout(w._layout) if self.string_customization_help is not None: w._sc_label = QLabel(self.string_customization_help, w) w._layout.... | 451,224 |
def save_settings(self, w): dl_settings = {} for x in ('rating', 'tags', 'comments', 'textcomments'): dl_settings[x] = getattr(w, '_'+x).isChecked() c = self.config_store() c.set(self.name, dl_settings) if hasattr(w, '_sc'): sc = unicode(w._sc.text()).strip() from calibre.customize.ui import customize_plugin customize_... | def save_settings(self, w): dl_settings = {} for x in ('rating', 'tags', 'comments'): dl_settings[x] = getattr(w, '_'+x).isChecked() c = self.config_store() c.set(self.name, dl_settings) if hasattr(w, '_sc'): sc = unicode(w._sc.text()).strip() from calibre.customize.ui import customize_plugin customize_plugin(self, sc) | 451,225 |
def paste(self, *args): if self.parent().help_state: self.parent().normalize_state() return QLineEdit.paste(self) | def paste(self, *args): if self.parent().help_state: self.parent().normalize_state() return QLineEdit.paste(self) | 451,226 |
def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | 451,227 |
def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | 451,228 |
def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | 451,229 |
def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | def force_int(raw): return int(re.search(r'([0-9+-]+)', raw).group(1)) | 451,230 |
def email_news(self, id): opts = email_config().parse() accounts = [(account, [x.strip().lower() for x in x[0].split(',')]) for account, x in opts.accounts.items() if x[1]] sent_mails = [] for account, fmts in accounts: files, auto = self.library_view.model().\ get_preferred_formats_from_ids([id], fmts) files = [f for ... | def email_news(self, id): opts = email_config().parse() accounts = [(account, [x.strip().lower() for x in x[0].split(',')]) for account, x in opts.accounts.items() if x[1]] sent_mails = [] for account, fmts in accounts: files, auto = self.library_view.model().\ get_preferred_formats_from_ids([id], fmts) files = [f for ... | 451,231 |
def get_matches(self, location, query): location = location.lower().strip() if location == 'authors': location = 'author' | def get_matches(self, location, query): location = location.lower().strip() if location == 'authors': location = 'author' | 451,232 |
def add_books_to_metadata(self, locations, metadata, booklists): ''' Add locations to the booklists. This function must not communicate with the device. @param locations: Result of a call to L{upload_books} @param metadata: List of MetaInformation objects, same as for :method:`upload_books`. @param booklists: A tuple c... | def add_books_to_metadata(self, locations, metadata, booklists): ''' Add locations to the booklists. This function must not communicate with the device. @param locations: Result of a call to L{upload_books} @param metadata: List of MetaInformation objects, same as for :method:`upload_books`. @param booklists: A tuple c... | 451,233 |
def books(self, oncard=None, end_session=True): """ Return a list of ebooks on the device. @param oncard: If 'carda' or 'cardb' return a list of ebooks on the specific storage card, otherwise return list of ebooks in main memory of device. If a card is specified and no books are on the card return empty list. @return:... | def books(self, oncard=None, end_session=True): """ Return a list of ebooks on the device. @param oncard: If 'carda' or 'cardb' return a list of ebooks on the specific storage card, otherwise return list of ebooks in main memory of device. If a card is specified and no books are on the card return empty list. @return:... | 451,234 |
def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | 451,235 |
def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | 451,236 |
def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | 451,237 |
def upload_books(self, files, names, on_card=None, end_session=True, metadata=None): ''' Upload a list of books to the device. If a file already exists on the device, it should be replaced. This method should raise a L{FreeSpaceError} if there is not enough free space on the device. The text of the FreeSpaceError must ... | def upload_books(self, files, names, on_card=None, end_session=True, metadata=None): ''' Upload a list of books to the device. If a file already exists on the device, it should be replaced. This method should raise a L{FreeSpaceError} if there is not enough free space on the device. The text of the FreeSpaceError must ... | 451,238 |
def upload_books(self, files, names, on_card=None, end_session=True, metadata=None): ''' Upload a list of books to the device. If a file already exists on the device, it should be replaced. This method should raise a L{FreeSpaceError} if there is not enough free space on the device. The text of the FreeSpaceError must ... | def if DEBUG: self.log.info("ITUNES.upload_books()") self.log.info(" adding '%s' by '%s' uuid:%s to self.cached_books" % ( metadata[i].title, metadata[i].author, metadata[i].uuid)) upload_books(self, if DEBUG: self.log.info("ITUNES.upload_books()") self.log.info(" adding '%s' by '%s' uuid:%s to self.cached_books" % ( m... | 451,239 |
def _dump_booklist(self, booklist, header=None,indent=0): ''' ''' if header: msg = '\n%sbooklist %s:' % (' '*indent,header) self.log.info(msg) self.log.info('%s%s' % (' '*indent,'-' * len(msg))) | def _dump_booklist(self, booklist, header=None,indent=0): ''' ''' if header: msg = '\n%sbooklist %s:' % (' '*indent,header) self.log.info(msg) self.log.info('%s%s' % (' '*indent,'-' * len(msg))) | 451,240 |
def _dump_update_list(self,header=None,indent=0): if header: msg = '\n%sself.update_list %s' % (' '*indent,header) self.log.info(msg) self.log.info( "%s%s" % (' '*indent,'-' * len(msg))) | def _dump_update_list(self,header=None,indent=0): if header: msg = '\n%sself.update_list %s' % (' '*indent,header) self.log.info(msg) self.log.info( "%s%s" % (' '*indent,'-' * len(msg))) | 451,241 |
def _dump_update_list(self,header=None,indent=0): if header: msg = '\n%sself.update_list %s' % (' '*indent,header) self.log.info(msg) self.log.info( "%s%s" % (' '*indent,'-' * len(msg))) | def _dump_update_list(self,header=None,indent=0): if header: msg = '\n%sself.update_list %s' % (' '*indent,header) self.log.info(msg) self.log.info( "%s%s" % (' '*indent,'-' * len(msg))) | 451,242 |
def books(self, oncard=None, end_session=True): """ Return a list of ebooks on the device. @param oncard: If 'carda' or 'cardb' return a list of ebooks on the specific storage card, otherwise return list of ebooks in main memory of device. If a card is specified and no books are on the card return empty list. @return:... | def books(self, oncard=None, end_session=True): """ Return a list of ebooks on the device. @param oncard: If 'carda' or 'cardb' return a list of ebooks on the specific storage card, otherwise return list of ebooks in main memory of device. If a card is specified and no books are on the card return empty list. @return:... | 451,243 |
def mobimlize_content(self, tag, text, bstate, istates): 'Convert text content' if text or tag != 'br': bstate.content = True istate = istates[-1] para = bstate.para if tag in SPECIAL_TAGS and not text: para = para if para is not None else bstate.body elif para is None or tag in ('td', 'th'): body = bstate.body if bsta... | def mobimlize_content(self, tag, text, bstate, istates): 'Convert text content' if text or tag != 'br': bstate.content = True istate = istates[-1] para = bstate.para if tag in SPECIAL_TAGS and not text: para = para if para is not None else bstate.body elif para is None or tag in ('td', 'th'): body = bstate.body if bsta... | 451,244 |
def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | def remove_books_from_metadata(self, paths, booklists): ''' Remove books from the metadata list. This function must not communicate with the device. @param paths: paths to books on the device. @param booklists: A tuple containing the result of calls to (L{books}(oncard=None), L{books}(oncard='carda'), L{books}(oncard=... | 451,245 |
def static(self, name): 'Serves static content' name = name.lower() cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', '' : 'application/octet-stream', }[name.rpartition('.')[-1].lower()] cherrypy.response... | def static(self, name): 'Serves static content' name = name.lower() fname = posixpath.basename(name) try: cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', '' : 'application/octet-stream', }[name.rpartiti... | 451,246 |
def static(self, name): 'Serves static content' name = name.lower() cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', '' : 'application/octet-stream', }[name.rpartition('.')[-1].lower()] cherrypy.response... | def static(self, name): 'Serves static content' name = name.lower() cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', }[fname.rpartition('.')[-1].lower()] except KeyError: raise cherrypy.HTTPError(404, '%r not... | 451,247 |
def static(self, name): 'Serves static content' name = name.lower() cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', '' : 'application/octet-stream', }[name.rpartition('.')[-1].lower()] cherrypy.response... | def static(self, name): 'Serves static content' name = name.lower() cherrypy.response.headers['Content-Type'] = { 'js' : 'text/javascript', 'css' : 'text/css', 'png' : 'image/png', 'gif' : 'image/gif', 'html' : 'text/html', '' : 'application/octet-stream', }[name.rpartition('.')[-1].lower()] cherrypy.response... | 451,248 |
def _generate(self, bottom, feed, art, number_of_articles_in_feed, two_levels, url, __appname__, prefix='', center=True, extra_css=None, style=None): head = HEAD(TITLE('navbar')) if style: head.append(STYLE(style, type='text/css')) if extra_css: head.append(STYLE(extra_css, type='text/css')) | def _generate(self, bottom, feed, art, number_of_articles_in_feed, two_levels, url, __appname__, prefix='', center=True, extra_css=None, style=None): head = HEAD(TITLE('navbar')) if style: head.append(STYLE(style, type='text/css')) if extra_css: head.append(STYLE(extra_css, type='text/css')) | 451,249 |
def open_book_path(self, path): if os.sep in unicode(path): open_local_file(path) else: format = unicode(path) path = self.view.model().db.format_abspath(self.current_row, format) if path is not None: open_local_file(path) | def open_book_path(self, path): path = unicode(path) if os.sep in path: open_local_file(path) else: format = unicode(path) path = self.view.model().db.format_abspath(self.current_row, format) if path is not None: open_local_file(path) | 451,250 |
def open_book_path(self, path): if os.sep in unicode(path): open_local_file(path) else: format = unicode(path) path = self.view.model().db.format_abspath(self.current_row, format) if path is not None: open_local_file(path) | def open_book_path(self, path): if os.sep in unicode(path): open_local_file(path) else: path = self.view.model().db.format_abspath(self.current_row, path) if path is not None: open_local_file(path) | 451,251 |
def __init__(self, stream): self.stream = stream self.data = StreamSlicer(stream) | def __init__(self, stream): self.stream = stream self.data = StreamSlicer(stream) | 451,252 |
def get_headers(self, offset): # Build a dict of topaz_header records topaz_headers = {} for x in range(self.header_records): offset += 1 taglen, consumed = self.decode_vwi(self.data[offset:offset+4]) offset += consumed tag = self.data[offset:offset+taglen] offset += taglen num_vals, consumed = self.decode_vwi(self.dat... | def get_headers(self, offset): # Build a dict of topaz_header records topaz_headers = {} for x in range(self.header_records): offset += 1 taglen, consumed = self.decode_vwi(self.data[offset:offset+4]) offset += consumed tag = self.data[offset:offset+taglen] offset += taglen num_vals, consumed = self.decode_vwi(self.dat... | 451,253 |
def get_headers(self, offset): # Build a dict of topaz_header records topaz_headers = {} for x in range(self.header_records): offset += 1 taglen, consumed = self.decode_vwi(self.data[offset:offset+4]) offset += consumed tag = self.data[offset:offset+taglen] offset += taglen num_vals, consumed = self.decode_vwi(self.dat... | def get_headers(self, offset): # Build a dict of topaz_header records topaz_headers = {} for x in range(self.header_records): offset += 1 taglen, consumed = self.decode_vwi(self.data[offset:offset+4]) offset += consumed tag = self.data[offset:offset+taglen] offset += taglen num_vals, consumed = self.decode_vwi(self.dat... | 451,254 |
def generate_metadata_stream(self): ms = StringIO.StringIO() ms.write(self.encode_vwi(len(self.md_header['tag'])).encode('iso-8859-1')) ms.write(self.md_header['tag']) ms.write(chr(self.md_header['flags'])) ms.write(chr(len(self.metadata))) | def generate_metadata_stream(self): ms = StringIO.StringIO() ms.write(self.encode_vwi(len(self.md_header['tag'])).encode('iso-8859-1')) ms.write(self.md_header['tag']) ms.write(chr(self.md_header['flags'])) ms.write(chr(len(self.metadata))) | 451,255 |
def regenerate_headers(self, updated_md_len): | def regenerate_headers(self, updated_md_len): | 451,256 |
def regenerate_headers(self, updated_md_len): | def regenerate_headers(self, updated_md_len): | 451,257 |
def update(self,mi): # Collect the original metadata self.get_original_metadata() | def update(self,mi): # Collect the original metadata self.get_original_metadata() | 451,258 |
def update(self,mi): # Collect the original metadata self.get_original_metadata() | def update(self,mi): # Collect the original metadata self.get_original_metadata() | 451,259 |
def set_metadata(stream, mi): mu = MetadataUpdater(stream) mu.update(mi) return | def set_metadata(stream, mi): mu = MetadataUpdater(stream) mu.update(mi) return | 451,260 |
def toggle_cover_browser(self): cbd = getattr(self, 'cb_dialog', None) if cbd is not None: self.hide_cover_browser() else: self.show_cover_browser() | def toggle_cover_browser(self, *args): cbd = getattr(self, 'cb_dialog', None) if cbd is not None: self.hide_cover_browser() else: self.show_cover_browser() | 451,261 |
def show_cover_browser(self): d = QDialog(self) ah, aw = available_height(), available_width() d.resize(int(aw/1.5), ah-60) d._layout = QStackedLayout() d.setLayout(d._layout) d.setWindowTitle(_('Browse by covers')) d.layout().addWidget(self.cover_flow) self.cover_flow.setVisible(True) self.cover_flow.setFocus(Qt.Other... | def show_cover_browser(self): d = QDialog(self) ah, aw = available_height(), available_width() d.resize(int(aw/1.5), ah-60) d._layout = QStackedLayout() d.setLayout(d._layout) d.setWindowTitle(_('Browse by covers')) d.layout().addWidget(self.cover_flow) self.cover_flow.setVisible(True) self.cover_flow.setFocus(Qt.Other... | 451,262 |
def show_cover_browser(self): d = QDialog(self) ah, aw = available_height(), available_width() d.resize(int(aw/1.5), ah-60) d._layout = QStackedLayout() d.setLayout(d._layout) d.setWindowTitle(_('Browse by covers')) d.layout().addWidget(self.cover_flow) self.cover_flow.setVisible(True) self.cover_flow.setFocus(Qt.Other... | def show_cover_browser(self): d = QDialog(self) ah, aw = available_height(), available_width() d.resize(int(aw/1.5), ah-60) d._layout = QStackedLayout() d.setLayout(d._layout) d.setWindowTitle(_('Browse by covers')) d.layout().addWidget(self.cover_flow) self.cover_flow.setVisible(True) self.cover_flow.setFocus(Qt.Other... | 451,263 |
def read_config(self): self.use_roman_numbers = config['use_roman_numerals_for_series_number'] self.column_map = config['column_map'][:] # force a copy self.headers = {} for i in self.column_map: # take out any columns no longer in the db if not i in self.orig_headers and not i in self.custom_columns: self.column_map.r... | def read_config(self): self.use_roman_numbers = config['use_roman_numerals_for_series_number'] cmap = config['column_map'][:] # force a copy self.headers = {} for i in self.column_map: # take out any columns no longer in the db if not i in self.orig_headers and not i in self.custom_columns: self.column_map.remove(i) fo... | 451,264 |
def read_config(self): self.use_roman_numbers = config['use_roman_numerals_for_series_number'] self.column_map = config['column_map'][:] # force a copy self.headers = {} for i in self.column_map: # take out any columns no longer in the db if not i in self.orig_headers and not i in self.custom_columns: self.column_map.r... | def read_config(self): self.use_roman_numbers = config['use_roman_numerals_for_series_number'] self.column_map = config['column_map'][:] # force a copy self.headers = {} for i in self.column_map: # take out any columns no longer in the db if not i in self.orig_headers and not i in self.custom_columns: self.column_map.r... | 451,265 |
def process_encryption(self, encfile, opf, log): key = None for item in opf.identifier_iter(): scheme = None for xkey in item.attrib.keys(): if xkey.endswith('scheme'): scheme = item.get(xkey) if (scheme and scheme.lower() == 'uuid') or \ (item.text and item.text.startswith('urn:uuid:')): key = str(item.text).rpartitio... | def process_encryption(self, encfile, opf, log): key = None for item in opf.identifier_iter(): scheme = None for xkey in item.attrib.keys(): if xkey.endswith('scheme'): scheme = item.get(xkey) if (scheme and scheme.lower() == 'uuid') or \ (item.text and item.text.startswith('urn:uuid:')): key = str(item.text).rpartitio... | 451,266 |
def process_encryption(self, encfile, opf, log): key = None for item in opf.identifier_iter(): scheme = None for xkey in item.attrib.keys(): if xkey.endswith('scheme'): scheme = item.get(xkey) if (scheme and scheme.lower() == 'uuid') or \ (item.text and item.text.startswith('urn:uuid:')): key = str(item.text).rpartitio... | def process_encryption(self, encfile, opf, log): key = None for item in opf.identifier_iter(): scheme = None for xkey in item.attrib.keys(): if xkey.endswith('scheme'): scheme = item.get(xkey) if (scheme and scheme.lower() == 'uuid') or \ (item.text and item.text.startswith('urn:uuid:')): key = str(item.text).rpartitio... | 451,267 |
def buildSources(self): if self.booksByTitle is None: self.fetchBooksByTitle() if self.booksByTitle is None: return False self.fetchBooksByAuthor() self.generateHTMLDescriptions() self.generateHTMLByAuthor() if self.opts.generate_titles: self.generateHTMLByTitle() if self.opts.generate_recently_added: self.generateHTML... | def buildSources(self): if not len(self.booksByTitle): self.fetchBooksByTitle() if not len(self.booksByTitle): return False self.fetchBooksByAuthor() self.generateHTMLDescriptions() self.generateHTMLByAuthor() if self.opts.generate_titles: self.generateHTMLByTitle() if self.opts.generate_recently_added: self.generateHT... | 451,268 |
def encrypt_fonts(self, uris, tdir, uuid): # {{{ from binascii import unhexlify | def encrypt_fonts(self, uris, tdir, uuid): # {{{ from binascii import unhexlify | 451,269 |
def update_booklist(prefix, path, title, authors, mime, date, ContentType, ImageID): changed = False # if path_to_ext(path) in self.FORMATS: try: lpath = path.partition(self.normalize_path(prefix))[2] if lpath.startswith(os.sep): lpath = lpath[len(os.sep):] lpath = lpath.replace('\\', '/') | def update_booklist(prefix, path, title, authors, mime, date, ContentType, ImageID): changed = False # if path_to_ext(path) in self.FORMATS: try: lpath = path.partition(self.normalize_path(prefix))[2] if lpath.startswith(os.sep): lpath = lpath[len(os.sep):] lpath = lpath.replace('\\', '/') | 451,270 |
def fetch(self): try: self.results = search(self.title, self.book_author, self.publisher, self.isbn, max_results=5, verbose=self.verbose, lang='all') except Exception, e: self.exception = e self.tb = traceback.format_exc() | def fetch(self): if not self.isbn: return try: self.results = get_social_metadata(self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all')[0] except Exception, e: self.exception = e self.tb = traceback.format_exc() | 451,271 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()).strip() self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.... | 451,272 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()).strip() if au: self.... | 451,273 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | 451,274 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | 451,275 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | 451,276 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()) self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()) if au: self.db.set_a... | 451,277 |
def CAL_ELEM(name, content): return M.meta(name=name, content=content) | def CAL_ELEM(name, content): return M.meta(name=name, content=content) | 451,278 |
def BambookConnect(ip = DEFAULT_BAMBOOK_IP, timeout = 0): if isinstance(ip, unicode): ip = ip.encode('ascii') handle = ctypes.c_int(0) if lib_handle == None: raise Exception(_('Bambook SDK has not been installed.')) ret = lib_handle.BambookConnect(ip, timeout, ctypes.byref(handle)) if ret == BR_SUCC: return handle else... | def BambookConnect(ip = DEFAULT_BAMBOOK_IP, timeout = 0): if isinstance(ip, unicode): ip = ip.encode('ascii') handle = ctypes.c_void_p(0) if lib_handle == None: raise Exception(_('Bambook SDK has not been installed.')) ret = lib_handle.BambookConnect(ip, timeout, ctypes.byref(handle)) if ret == BR_SUCC: return handle e... | 451,279 |
def get_numeric_matches(self, location, query): matches = set([]) if len(query) == 0: return matches if query == 'false': query = '0' elif query == 'true': query = '!=0' relop = None for k in self.numeric_search_relops.keys(): if query.startswith(k): (p, relop) = self.numeric_search_relops[k] query = query[p:] if relop... | def get_numeric_matches(self, location, query): matches = set([]) if len(query) == 0: return matches if query == 'false': query = '0' elif query == 'true': query = '!=0' relop = None for k in self.numeric_search_relops.keys(): if query.startswith(k): (p, relop) = self.numeric_search_relops[k] query = query[p:] if relop... | 451,280 |
def get_numeric_matches(self, location, query): matches = set([]) if len(query) == 0: return matches if query == 'false': query = '0' elif query == 'true': query = '!=0' relop = None for k in self.numeric_search_relops.keys(): if query.startswith(k): (p, relop) = self.numeric_search_relops[k] query = query[p:] if relop... | def get_numeric_matches(self, location, query): matches = set([]) if len(query) == 0: return matches if query == 'false': query = '0' elif query == 'true': query = '!=0' relop = None for k in self.numeric_search_relops.keys(): if query.startswith(k): (p, relop) = self.numeric_search_relops[k] query = query[p:] if relop... | 451,281 |
def flags(self, index): if self.map[index.row()] in self.indices_to_be_deleted(): return Qt.ItemIsUserCheckable # Can't figure out how to get the disabled flag in python flags = QAbstractTableModel.flags(self, index) if index.isValid() and self.editable: cname = self.column_map[index.column()] if cname in ('title', 'a... | def flags(self, index): if self.map[index.row()] in self.indices_to_be_deleted(): return Qt.ItemIsUserCheckable # Can't figure out how to get the disabled flag in python flags = QAbstractTableModel.flags(self, index) if index.isValid() and self.editable: cname = self.column_map[index.column()] if cname in ('title', 'a... | 451,282 |
def show_data(self, data): rows = render_rows(data) rows = u'\n'.join([u'<tr><td valign="top"><b>%s:</b></td><td valign="top">%s</td></tr>'%(k,t) for k, t in rows]) comments = data.get(_('Comments'), '') if comments and comments != u'None': self.renderer.queue.put((rows, comments)) self._show_data(rows, '') | def show_data(self, data): rows = render_rows(data) rows = u'\n'.join([u'<tr><td valign="top"><b>%s:</b></td><td valign="top">%s</td></tr>'%(k,t) for k, t in rows]) comments = data.get(_('Comments'), '') if not comments or comments == u'None': comments = '' self.renderer.queue.put((rows, comments)) self._show_data(rows... | 451,283 |
def main(args=sys.argv): from calibre.library.database2 import LibraryDatabase2 parser = option_parser() opts, args = parser.parse_args(args) if opts.daemonize and not iswindows: from cherrypy.process.plugins import Daemonizer d = Daemonizer(cherrypy.engine) d.subscribe() if opts.pidfile is not None: from cherrypy.proc... | def main(args=sys.argv): from calibre.library.database2 import LibraryDatabase2 parser = option_parser() opts, args = parser.parse_args(args) if opts.daemonize and not iswindows: daemonize() if opts.pidfile is not None: from cherrypy.process.plugins import PIDFile PIDFile(cherrypy.engine, opts.pidfile).subscribe() cher... | 451,284 |
def catalog_generated(self, job): | def catalog_generated(self, job): | 451,285 |
def __init__(self, window, row, db, accepted_callback=None, cancel_all=False): ResizableDialog.__init__(self, window) self.bc_box.layout().setAlignment(self.cover, Qt.AlignCenter|Qt.AlignHCenter) self.cancel_all = False base = unicode(self.author_sort.toolTip()) self.ok_aus_tooltip = '<p>' + textwrap.fill(base+'<br><br... | def __init__(self, window, row, db, accepted_callback=None, cancel_all=False): ResizableDialog.__init__(self, window) self.bc_box.layout().setAlignment(self.cover, Qt.AlignCenter|Qt.AlignHCenter) self.cancel_all = False base = unicode(self.author_sort.toolTip()) self.ok_aus_tooltip = '<p>' + textwrap.fill(base+'<br><br... | 451,286 |
def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()).strip() self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()).strip() if a... | def accept(self): cf = getattr(self, 'cover_fetcher', None) if cf is not None and hasattr(cf, 'terminate'): cf.terminate() cf.wait() try: if self.formats_changed: self.sync_formats() title = unicode(self.title.text()).strip() self.db.set_title(self.id, title, notify=False) au = unicode(self.authors.text()).strip() if a... | 451,287 |
def get_dates_matches(self, location, query): matches = set([]) if len(query) < 2: return matches | def get_dates_matches(self, location, query): matches = set([]) if len(query) < 2: return matches | 451,288 |
def process_dir(self, dirpath, filenames, book_id): formats = filter(self.is_ebook_file, filenames) fmts = [os.path.splitext(x)[1][1:].upper() for x in formats] sizes = [os.path.getsize(os.path.join(dirpath, x)) for x in formats] names = [os.path.splitext(x)[0] for x in formats] opf = os.path.join(dirpath, 'meta... | def process_dir(self, dirpath, filenames, book_id): formats = filter(self.is_ebook_file, filenames) fmts = [os.path.splitext(x)[1][1:].upper() for x in formats] sizes = [os.path.getsize(os.path.join(dirpath, x)) for x in formats] names = [os.path.splitext(x)[0] for x in formats] opf = os.path.join(dirpath, 'meta... | 451,289 |
def create_cc_metadata(self): self.books.sort(key=itemgetter('timestamp')) m = {} fields = ('label', 'name', 'datatype', 'is_multiple', 'editable', 'display') for b in self.books: args = [] for x in fields: if x in b: args.append(b[x]) if len(args) == len(fields): # TODO: Do series type columns need special handling? l... | def create_cc_metadata(self): self.books.sort(key=itemgetter('timestamp')) m = {} fields = ('label', 'name', 'datatype', 'is_multiple', 'editable', 'display') for b in self.books: args = [] for x in fields: if x in b: args.append(b[x]) if len(args) == len(fields): # TODO: Do series type columns need special handling? l... | 451,290 |
def get_categories(self, sort_on_count=False, ids=None, icon_map=None): self.books_list_filter.change([] if not ids else ids) | def get_categories(self, sort_on_count=False, ids=None, icon_map=None): self.books_list_filter.change([] if not ids else ids) | 451,291 |
def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'): occasion = {'import':_on_import, 'preprocess':_on_preprocess, 'postprocess':_on_postprocess}[occasion] customization = config['plugin_customization'] if ft is None: ft = os.path.splitext(path_to_file)[-1].lower().replace('.', '') nfp = path_to_fil... | def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'): occasion_plugins = {'import':_on_import, 'preprocess':_on_preprocess, 'postprocess':_on_postprocess}[occasion] customization = config['plugin_customization'] if ft is None: ft = os.path.splitext(path_to_file)[-1].lower().replace('.', '') nfp = pat... | 451,292 |
def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'): occasion = {'import':_on_import, 'preprocess':_on_preprocess, 'postprocess':_on_postprocess}[occasion] customization = config['plugin_customization'] if ft is None: ft = os.path.splitext(path_to_file)[-1].lower().replace('.', '') nfp = path_to_fil... | def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'): occasion = {'import':_on_import, 'preprocess':_on_preprocess, 'postprocess':_on_postprocess}[occasion] customization = config['plugin_customization'] if ft is None: ft = os.path.splitext(path_to_file)[-1].lower().replace('.', '') nfp = path_to_fil... | 451,293 |
def update_text_record(self, record, book, path, bl_index): timestamp = os.path.getctime(path) date = strftime(timestamp) if date != record.get('date', None): if DEBUG: prints('Changing date of', path, 'from', record.get('date', ''), 'to', date) prints('\tctime', strftime(os.path.getctime(path))) prints('\tmtime', strf... | def update_text_record(self, record, book, path, bl_index): timestamp = os.path.getctime(path) date = strftime(timestamp) if date != record.get('date', None): if DEBUG: prints('Changing date of', path, 'from', record.get('date', ''), 'to', date) prints('\tctime', strftime(os.path.getctime(path))) prints('\tmtime', strf... | 451,294 |
def update_text_record(self, record, book, path, bl_index): timestamp = os.path.getctime(path) date = strftime(timestamp) if date != record.get('date', None): if DEBUG: prints('Changing date of', path, 'from', record.get('date', ''), 'to', date) prints('\tctime', strftime(os.path.getctime(path))) prints('\tmtime', strf... | def update_text_record(self, record, book, path, bl_index): timestamp = os.path.getctime(path) date = strftime(timestamp) if date != record.get('date', None): if DEBUG: prints('Changing date of', path, 'from', record.get('date', ''), 'to', date) prints('\tctime', strftime(os.path.getctime(path))) prints('\tmtime', strf... | 451,295 |
def upshift_markup(self, root): self.log.debug('Converting style information to CSS...') size_map = { 'xx-small': '0.5', 'x-small': '1', 'small': '2', 'medium': '3', 'large': '4', 'x-large': '5', 'xx-large': '6', } mobi_version = self.book_header.mobi_version for x in root.xpath('//ncx'): x.getparent().remove(x) for i,... | def upshift_markup(self, root): self.log.debug('Converting style information to CSS...') size_map = { 'xx-small': '0.5', 'x-small': '1', 'small': '2', 'medium': '3', 'large': '4', 'x-large': '5', 'xx-large': '6', } mobi_version = self.book_header.mobi_version for x in root.xpath('//ncx'): x.getparent().remove(x) for i,... | 451,296 |
def opds_category_group(self, category=None, which=None, version=0, offset=0): try: offset = int(offset) version = int(version) except: raise cherrypy.HTTPError(404, 'Not found') | def opds_category_group(self, category=None, which=None, version=0, offset=0): try: offset = int(offset) version = int(version) except: raise cherrypy.HTTPError(404, 'Not found') | 451,297 |
def __init__(self, text, count): self.text, self.count = text, count | def __init__(self, text, count): self.text, self.count = text, count | 451,298 |
def randstr(length): return ''.join(random.choice(string.letters) for i in xrange(length)) | def randstr(length): return ''.join(random.choice(letters) for i in xrange(length)) | 451,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.