bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}): if datatype not in self.CUSTOM_DATA_TYPES: raise ValueError('%r is not a supported data type'%datatype) normalized = datatype not in ('datetime', 'comments', 'int', 'bool', 'float') is_multiple = is_multiple and datatype in ...
def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}): if datatype not in self.CUSTOM_DATA_TYPES: raise ValueError('%r is not a supported data type'%datatype) normalized = datatype not in ('datetime', 'comments', 'int', 'bool', 'float') is_multiple = is_multiple and datatype in ...
452,100
def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}): if datatype not in self.CUSTOM_DATA_TYPES: raise ValueError('%r is not a supported data type'%datatype) normalized = datatype not in ('datetime', 'comments', 'int', 'bool', 'float') is_multiple = is_multiple and datatype in ...
def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}): if datatype not in self.CUSTOM_DATA_TYPES: raise ValueError('%r is not a supported data type'%datatype) normalized = datatype not in ('datetime', 'comments', 'int', 'bool', 'float') is_multiple = is_multiple and datatype in ...
452,101
def data(self, index, role): try: family = self.families[index.row()] except: traceback.print_exc() return NONE if role == Qt.DisplayRole: return QVariant(family) if role == Qt.FontRole: return QVariant(QFont(family)) return NONE
def data(self, index, role): try: family = self.families[index.row()] except: traceback.print_exc() return NONE if role == Qt.DisplayRole: return QVariant(family) if not isosx and role == Qt.FontRole: return QVariant(QFont(family)) return NONE
452,102
def browse_template(self, sort, category=True, initial_search=''):
def browse_template(self, sort, category=True, initial_search=''):
452,103
def workaround_ade_quirks(self): # {{{ ''' Perform various markup transforms to get the output to render correctly in the quirky ADE. ''' from calibre.ebooks.oeb.base import XPath, XHTML, OEB_STYLES, barename, urlunquote
def workaround_ade_quirks(self): # {{{ ''' Perform various markup transforms to get the output to render correctly in the quirky ADE. ''' from calibre.ebooks.oeb.base import XPath, XHTML, OEB_STYLES, barename, urlunquote
452,104
def set_normal_icon_size(self, w, h): self.normal_icon_size = QSize(w, h) self.setIconSize(self.normal_icon_size) self.setMinimumSize(self.sizeHint())
def set_normal_icon_size(self, w, h): self.normal_icon_size = QSize(w, h) self.setIconSize(self.normal_icon_size) self.setMinimumSize(self.sizeHint())
452,105
def _parse(self, raw, mimetype): mt = mimetype.lower() if mt.endswith('+xml'): parser = etree.XMLParser(no_network=True, huge_tree=not iswindows) return etree.fromstring(xml_to_unicode(raw, strip_encoding_pats=True, assume_utf8=True)[0], parser=parser) return raw
def _parse(self, raw, mimetype): mt = mimetype.lower() if mt.endswith('+xml'): parser = etree.XMLParser(no_network=True, huge_tree=not iswindows) raw = xml_to_unicode(raw, strip_encoding_pats=True, assume_utf8=True, resolve_entities=True)[0].strip() idx = raw.find('<html') if idx == -1: idx = raw.find('<HTML') if idx >...
452,106
def has_cover(self, mi, ans, timeout=5.): print "has_cover called" if not mi.isbn: return False br = browser() try: if self.get_cover_url(mi.isbn, br, timeout=timeout) != None: self.debug('cover for', mi.isbn, 'found') ans.set() except Exception, e: self.debug(e)
def has_cover(self, mi, ans, timeout=5.): if not mi.isbn: return False br = browser() try: if self.get_cover_url(mi.isbn, br, timeout=timeout) != None: self.debug('cover for', mi.isbn, 'found') ans.set() except Exception, e: self.debug(e)
452,107
def create_ext_text_record(self, root, bl_id, lpath, thumbnail): namespace = root.nsmap[None] attrib = { 'path': lpath } ans = root.makeelement('{%s}text'%namespace, attrib=attrib, nsmap=root.nsmap) ans.tail = '\n' root[-1].tail = '\n' + '\t' root.append(ans) if thumbnail and thumbnail[-1]: ans.text = '\n' + '\t\t' t =...
def create_ext_text_record(self, root, bl_id, lpath, thumbnail): namespace = root.nsmap[None] attrib = { 'path': lpath } ans = root.makeelement('{%s}text'%namespace, attrib=attrib, nsmap=root.nsmap) ans.tail = '\n' if len(root) > 0: root[-1].tail = '\n\t' else: root.text = '\n\t' root.append(ans) if thumbnail and thumb...
452,108
def setup_ui(self, parent): values = self.all_values = list(self.db.all_custom(num=self.col_id)) values.sort(cmp = lambda x,y: cmp(x.lower(), y.lower())) if self.col_metadata['is_multiple']: w = TagsLineEdit(parent, values) w.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) self.widgets = [QLabel('&'+self.col_...
def setup_ui(self, parent): values = self.all_values = list(self.db.all_custom(num=self.col_id)) values.sort(cmp = lambda x,y: cmp(x.lower(), y.lower())) if self.col_metadata['is_multiple']: w = RemoveTags(parent, values) self.widgets = [QLabel('&'+self.col_metadata['name']+': ' + _('tags to add'), parent), w] self.add...
452,109
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.text() == '*': ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).split(',')])...
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.checkbox.isChecked(): ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).split...
452,110
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.text() == '*': ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).split(',')])...
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.text() == '*': ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.tags_box.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).spl...
452,111
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.text() == '*': ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).split(',')])...
def getter(self, original_value = None): if self.col_metadata['is_multiple']: if self.removing_widget.text() == '*': ans = set() else: ans = set(original_value) ans -= set([v.strip() for v in unicode(self.removing_widget.text()).split(',')]) ans |= set([v.strip() for v in unicode(self.adding_widget.text()).split(',')])...
452,112
def __init__(self, parent, modelcls=BooksModel): QTableView.__init__(self, parent)
def __init__(self, parent, modelcls=BooksModel): QTableView.__init__(self, parent)
452,113
def restore_database_option_parser(): parser = get_parser(_( ''' %prog restore_database [options] Restore this database from the metadata stored in OPF files in each directory of the calibre library. This is useful if your metadata.db file has been corrupted. WARNING: This completely regenerates your datbase. You wil...
def restore_database_option_parser(): parser = get_parser(_( ''' %prog restore_database [options] Restore this database from the metadata stored in OPF files in each directory of the calibre library. This is useful if your metadata.db file has been corrupted. WARNING: This completely regenerates your database. You wi...
452,114
def command_restore_database(args, dbpath): from calibre.library.restore import Restore parser = saved_searches_option_parser() opts, args = parser.parse_args(args) if len(args) != 0: parser.print_help() return 1 if opts.library_path is not None: dbpath = opts.library_path if isbytestring(dbpath): dbpath = dbpath.dec...
def command_restore_database(args, dbpath): from calibre.library.restore import Restore parser = restore_database_option_parser() opts, args = parser.parse_args(args) if len(args) != 0: parser.print_help() return 1 if opts.library_path is not None: dbpath = opts.library_path if isbytestring(dbpath): dbpath = dbpath.d...
452,115
def opds_category(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(self, category=None, which=None, version=0, offset=0): try: offset = int(offset) version = int(version) except: raise cherrypy.HTTPError(404, 'Not found')
452,116
def opts_and_exts(name, op, exts): opts = ' '.join(options(op)) exts.extend([i.upper() for i in exts]) exts='|'.join(exts) return '_'+name+'()'+\
def opts_and_exts(name, op, exts): opts = ' '.join(options(op)) exts.extend([i.upper() for i in exts]) exts='|'.join(exts) return '_'+name+'()'+\
452,117
def opts_and_exts(name, op, exts): opts = ' '.join(options(op)) exts.extend([i.upper() for i in exts]) exts='|'.join(exts) return '_'+name+'()'+\
def opts_and_exts(name, op, exts): opts = ' '.join(options(op)) exts.extend([i.upper() for i in exts]) exts='|'.join(exts) return '_'+name+'()'+\
452,118
def has_cover(self, mi, ans, timeout=5.): if not mi.isbn: return False br = browser() try: entry = Query(isbn=mi.isbn, max_results=1)(br, False, timeout)[0] if Covers(isbn)(entry).check_cover(): self.debug('cover for', mi.isbn, 'found') ans.set() except Exception, e: self.debug(e)
def has_cover(self, mi, ans, timeout=5.): if not mi.isbn: return False br = browser() try: entry = Query(isbn=mi.isbn, max_results=1)(br, False, timeout)[0] if Covers(mi.isbn)(entry).check_cover(): self.debug('cover for', mi.isbn, 'found') ans.set() except Exception, e: self.debug(e)
452,119
def get_covers(self, mi, result_queue, abort, timeout=5.): if not mi.isbn: return br = browser() try: entry = Query(isbn=mi.isbn, max_results=1)(br, False, timeout)[0] cover_data, ext = Covers(isbn)(entry).get_cover(br, timeout) if not ext: ext = 'jpg' result_queue.put((True, cover_data, ext, self.name)) except Excepti...
def get_covers(self, mi, result_queue, abort, timeout=5.): if not mi.isbn: return br = browser() try: entry = Query(isbn=mi.isbn, max_results=1)(br, False, timeout)[0] cover_data, ext = Covers(mi.isbn)(entry).get_cover(br, timeout) if not ext: ext = 'jpg' result_queue.put((True, cover_data, ext, self.name)) except Exce...
452,120
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
452,121
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
452,122
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
def __init__(self, title=None, author=None, publisher=None, isbn=None, keywords=None, max_results=20): assert not(title is None and author is None and publisher is None \ and isbn is None and keywords is None) assert (max_results < 21)
452,123
def __init__(self): self.repub = re.compile(r'\s*.diteur\s*', re.I) self.reauteur = re.compile(r'\s*auteur.*', re.I) self.reautclean = re.compile(r'\s*\(.*\)\s*')
def __init__(self): self.repub = re.compile(r'\s*.diteur\s*', re.I) self.reauteur = re.compile(r'\s*auteur.*', re.I) self.reautclean = re.compile(r'\s*\(.*\)\s*')
452,124
def get_title(self, entry): title = deepcopy(entry.find("div[@id='book-info']")) title.remove(title.find("dl[@title='Informations sur le livre']")) title = ' '.join([i.text_content() for i in title.iterchildren()]) return title.replace('\n', '')
def get_title(self, entry): title = deepcopy(entry.find("div[@id='book-info']")) title.remove(title.find("dl[@title='Informations sur le livre']")) title = ' '.join([i.text_content() for i in title.iterchildren()]) return title.replace('\n', '')
452,125
def get_authors(self, entry): author = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") authortext = [] for x in author.getiterator('dt'): if self.reauteur.match(x.text): elt = x.getnext() i = 0 while elt.tag <> 'dt' and i < 20: authortext.append(elt.text_content()) elt = elt.getnext() i += 1 b...
def get_authors(self, entry): author = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") authortext = [] for x in author.getiterator('dt'): if self.reauteur.match(x.text): elt = x.getnext() i = 0 while elt.tag <> 'dt' and i < 20: authortext.append(unicode(elt.text_content())) elt = elt.getnext()...
452,126
def get_description(self, entry, verbose): try: return 'RESUME:\n' + entry.xpath("//p[@id='book-description']")[0].text except: report(verbose) return None
def get_description(self, entry, verbose): try: return 'RESUME:\n' + unicode(entry.xpath("//p[@id='book-description']")[0].text) except: report(verbose) return None
452,127
def get_publisher(self, entry): publisher = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") publitext = None for x in publisher.getiterator('dt'): if self.repub.match(x.text): publitext = x.getnext().text_content() break return publitext
def get_publisher(self, entry): publisher = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") publitext = None for x in publisher.getiterator('dt'): if self.repub.match(x.text): publitext = x.getnext().text_content() break return publitext
452,128
def get_date(self, entry, verbose): date = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") for x in date.getiterator('dt'): if x.text == 'Date de parution': d = x.getnext().text_content() break if not len(d): return None try: default = utcnow().replace(day=15) d = replace_monthsfr(d) d = parse...
def get_date(self, entry, verbose): date = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") for x in date.getiterator('dt'): if x.text == 'Date de parution': d = x.getnext().text_content() break if len(d) == 0: return None try: default = utcnow().replace(day=15) d = replace_monthsfr(d) d = pars...
452,129
def get_ISBN(self, entry): isbn = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") isbntext = None for x in isbn.getiterator('dt'): if x.text == 'ISBN': isbntext = x.getnext().text_content() if not check_isbn(isbntext): return None break return isbntext
def get_ISBN(self, entry): isbn = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") isbntext = None for x in isbn.getiterator('dt'): if x.text == 'ISBN': isbntext = x.getnext().text_content() if not check_isbn(isbntext): return None break return isbntext
452,130
def get_language(self, entry): language = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") langtext = None for x in language.getiterator('dt'): if x.text == 'Langue': langtext = x.getnext().text_content() break return langtext
def get_language(self, entry): language = entry.find("div[@id='book-info']/dl[@title='Informations sur le livre']") langtext = None for x in language.getiterator('dt'): if x.text == 'Langue': langtext = x.getnext().text_content() break return langtext
452,131
def search(title=None, author=None, publisher=None, isbn=None, verbose=False, max_results=5, keywords=None): br = browser() entries = Query(title=title, author=author, isbn=isbn, publisher=publisher, keywords=keywords, max_results=max_results)(br, verbose) if entries is None: return #List of entry ans = ResultList() ...
def search(title=None, author=None, publisher=None, isbn=None, max_results=5, verbose=False, keywords=None): br = browser() entries = Query(title=title, author=author, isbn=isbn, publisher=publisher, keywords=keywords, max_results=max_results)(br, verbose) if entries is None: return #List of entry ans = ResultList() ...
452,132
def search(title=None, author=None, publisher=None, isbn=None, verbose=False, max_results=5, keywords=None): br = browser() entries = Query(title=title, author=author, isbn=isbn, publisher=publisher, keywords=keywords, max_results=max_results)(br, verbose) if entries is None: return #List of entry ans = ResultList() ...
def search(title=None, author=None, publisher=None, isbn=None, verbose=False, max_results=5, keywords=None): br = browser() entries = Query(title=title, author=author, isbn=isbn, publisher=publisher, keywords=keywords, max_results=max_results)(br, verbose) if entries is None or len(entries) == 0: return #List of entr...
452,133
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find(name=re.compile(r'container$', re.I)) if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") r...
452,134
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find(...
452,135
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
452,136
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
def __init__(self, stream=None): if not stream: return soup = BeautifulStoneSoup(stream.read()) container = soup.find('container') if not container: raise OCFException("<container/> element missing") if container.get('version', None) != '1.0': raise EPubException("unsupported version of OCF") rootfiles = container.find...
452,137
def format_field_extended(self, key, series_with_index=True): from calibre.ebooks.metadata import authors_to_string ''' returns the tuple (field_name, formatted_value) '''
def format_field_extended(self, key, series_with_index=True): from calibre.ebooks.metadata import authors_to_string ''' returns the tuple (field_name, formatted_value) '''
452,138
def do_test(self): selections = [] if self.regex_valid(): text = qstring_to_unicode(self.preview.toPlainText()) regex = qstring_to_unicode(self.regex.text())
defcursor = QTextCursor(self.preview.document()) extsel = QTextEdit.ExtraSelection() extsel.cursor = cursor extsel.format.setBackground(QBrush(Qt.yellow)) do_test(self):cursor = QTextCursor(self.preview.document()) extsel = QTextEdit.ExtraSelection() extsel.cursor = cursor extsel.format.setBackground(QBrush(Qt.yellow))...
452,139
def do_test(self): selections = [] if self.regex_valid(): text = qstring_to_unicode(self.preview.toPlainText()) regex = qstring_to_unicode(self.regex.text())
def do_test(self): selections = [] if self.regex_valid(): text = qstring_to_unicode(self.preview.toPlainText()) regex = qstring_to_unicode(self.regex.text())
452,140
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
def chars = list(range(8)) + [0x0B, 0x0E, 0x0F] + list(range(0x10, 0x19)) illegal_chars = re.compile(u'|'.join(map(unichr, chars))) txt = illegal_chars.sub('', txt) convert_basic(txt, chars = list(range(8)) + [0x0B, 0x0E, 0x0F] + list(range(0x10, 0x19)) illegal_chars = re.compile(u'|'.join(map(unichr, chars))) txt = il...
452,141
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
452,142
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
452,143
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
452,144
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
def convert_basic(txt, title='', epub_split_size_kb=0): # Strip whitespace from the beginning and end of the line. Also replace # all line breaks with \n. txt = '\n'.join([line.strip() for line in txt.splitlines()]) # Condense redundant spaces txt = re.sub('[ ]{2,}', ' ', txt) # Remove blank lines from the beginning ...
452,145
def separate_paragraphs_single_line(txt): txt = txt.replace('\r\n', '\n') txt = txt.replace('\r', '\n') txt = re.sub(u'(?<=.)\n(?=.)', u'\n\n', txt) return txt
def separate_paragraphs_single_line(txt): txt = txt.replace('\r\n', '\n') txt = txt.replace('\r', '\n') txt = re.sub(u'(?<=.)\n(?=.)', '\n\n', txt) return txt
452,146
def separate_paragraphs_print_formatted(txt): txt = re.sub('(?miu)^(\t+|[ ]{2,})(?=.)', '\n\t', txt) return txt
def separate_paragraphs_print_formatted(txt): txt = re.sub(u'(?miu)^(\t+|[ ]{2,})(?=.)', '\n\t', txt) return txt
452,147
def initialize(self, opt_name, colorize=False, help_text=_('Search')): self.as_you_type = config['search_as_you_type'] self.opt_name = opt_name self.addItems(QStringList(list(set(config[opt_name])))) try: self.line_edit.setPlaceholderText(help_text) except: # Using Qt < 4.7 pass self.colorize = colorize self.clear()
def initialize(self, opt_name, colorize=False, help_text=_('Search')): self.as_you_type = config['search_as_you_type'] self.opt_name = opt_name items = [] for item in config[opt_name]: if item not in items: items.append(item) self.addItems(QStringList(items)) try: self.line_edit.setPlaceholderText(help_text) except: # ...
452,148
def _do_search(self, store_in_history=True): text = unicode(self.currentText()).strip() if not text: return self.clear() self.search.emit(text)
def _do_search(self, store_in_history=True): text = unicode(self.currentText()).strip() if not text: return self.clear() self.search.emit(text)
452,149
def markup_chapters(self, html, wordcount, blanks_between_paragraphs): # Typical chapters are between 2000 and 7000 words, use the larger number to decide the # minimum of chapters to search for self.min_chapters = 1 if wordcount > 7000: self.min_chapters = wordcount / 7000 print "minimum chapters required are: "+str(s...
def markup_chapters(self, html, wordcount, blanks_between_paragraphs): # Typical chapters are between 2000 and 7000 words, use the larger number to decide the # minimum of chapters to search for self.min_chapters = 1 if wordcount > 7000: self.min_chapters = wordcount / 7000 print "minimum chapters required are: "+str(s...
452,150
def img_plot(self, data, name=None, colormap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds image plots to this Plot object.
def img_plot(self, data, name=None, colormap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds image plots to this Plot object.
452,151
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,152
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,153
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,154
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,155
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,156
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,157
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,158
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,159
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,160
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,161
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object.
452,162
def configure_traits(self, *args, **kws): # Start up the timer! We should do this only when the demo actually # starts and not when the demo object is created. self.timer = Timer(20, self.controller.onTimer) return super(Demo, self).configure_traits(*args, **kws)
def configure_traits(self, *args, **kws): # Start up the timer! We should do this only when the demo actually # starts and not when the demo object is created. self.timer = Timer(20, self.controller.onTimer) return super(Demo, self).configure_traits(*args, **kws)
452,163
def _create_plot_component(obj): # Setup the spectrum plot frequencies = linspace(0.0, float(SAMPLING_RATE)/2, num=NUM_SAMPLES/2) obj.spectrum_data = ArrayPlotData(frequency=frequencies) empty_amplitude = zeros(NUM_SAMPLES/2) obj.spectrum_data.set_data('amplitude', empty_amplitude) obj.spectrum_plot = Plot(obj.spectru...
def_stream = None _create_plot_component(obj):_stream = None #_stream = None Setup_stream = None the_stream = None spectrum_stream = None plot_stream = None frequencies_stream = None =_stream = None linspace(0.0,_stream = None float(SAMPLING_RATE)/2,_stream = None num=NUM_SAMPLES/2)_stream = None obj.spectrum_data_stre...
452,164
def get_audio_data(): pa = pyaudio.PyAudio() stream = pa.open(format=pyaudio.paInt16, channels=1, rate=SAMPLING_RATE, input=True, frames_per_buffer=NUM_SAMPLES) audio_data = fromstring(stream.read(NUM_SAMPLES), dtype=short) stream.close() normalized_data = audio_data / 32768.0 return (abs(fft(normalized_data))[:NUM_SA...
def get_audio_data(): global _stream if _stream is None: pa = pyaudio.PyAudio() _stream = pa.open(format=pyaudio.paInt16, channels=1, rate=SAMPLING_RATE, input=True, frames_per_buffer=NUM_SAMPLES) audio_data = fromstring(stream.read(NUM_SAMPLES), dtype=short) stream.close() normalized_data = audio_data / 32768.0 retur...
452,165
def get_audio_data(): pa = pyaudio.PyAudio() stream = pa.open(format=pyaudio.paInt16, channels=1, rate=SAMPLING_RATE, input=True, frames_per_buffer=NUM_SAMPLES) audio_data = fromstring(stream.read(NUM_SAMPLES), dtype=short) stream.close() normalized_data = audio_data / 32768.0 return (abs(fft(normalized_data))[:NUM_SA...
def get_audio_data(): pa = pyaudio.PyAudio() stream = pa.open(format=pyaudio.paInt16, channels=1, rate=SAMPLING_RATE, input=True, frames_per_buffer=NUM_SAMPLES) audio_data = fromstring(_stream.read(NUM_SAMPLES), dtype=short) normalized_data = audio_data / 32768.0 return (abs(fft(normalized_data))[:NUM_SAMPLES/2], norm...
452,166
def closeEvent(self, event): # stop the timer if getattr(self, "timer", None): self.timer.stop() return super(PlotFrame, self).closeEvent(event)
def closeEvent(self, event): # stop the timer if getattr(self, "timer", None): self.timer.stop() return super(PlotFrame, self).closeEvent(event)
452,167
def _sources_changed(self, old, new): for source in old: source.on_trait_change(self.refresh, "data_changed", remove=True) for source in new: source.on_trait_change(self.refresh, "data_changed") # the _xdata and _ydata of the sources may be created anew on every # access, so we can't just add/delete from _xrange and _y...
def _sources_changed(self, old, new): for source in old: source.on_trait_change(self.refresh, "data_changed", remove=True) for source in new: source.on_trait_change(self.refresh, "data_changed") # the _xdata and _ydata of the sources may be created anew on every # access, so we can't just add/delete from _xrange and _y...
452,168
def __init__(self): # Create the data and the PlotData object. For a 2D plot, we need to # take the row of X points and Y points and create a grid from them # using meshgrid(). x = linspace(0, 10, 50) y = linspace(0, 5, 50) xgrid, ygrid = meshgrid(x, y) z = exp(-(xgrid*xgrid + ygrid*ygrid) / 100) plotdata = ArrayPlotD...
def __init__(self): # Create the data and the PlotData object. For a 2D plot, we need to # take the row of X points and Y points and create a grid from them # using meshgrid(). x = linspace(0, 10, 50) y = linspace(0, 5, 50) xgrid, ygrid = meshgrid(x, y) z = exp(-(xgrid*xgrid + ygrid*ygrid) / 100) plotdata = ArrayPlotD...
452,169
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
452,170
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
452,171
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
def _draw_plot(self, gc, view_bounds=None, mode="normal"): self._gather_points() if len(self._cached_data_pts) == 0: return index = self.index_mapper.map_screen(self._cached_data_pts[0]) vals = [] for v in self._cached_data_pts[1:]: if v is None: vals.append(None) else: vals.append(self.value_mapper.map_screen(v)) gc....
452,172
def set_grid(self, attr_name, new): """ Setter function used by GridProperty. """ if (attr_name,self.orientation) in [("index_grid","v"), ("value_grid","h")]: self.y_grid = new else: self.y_grid = new
def set_grid(self, attr_name, new): """ Setter function used by GridProperty. """ if (attr_name,self.orientation) in [("index_grid","v"), ("value_grid","h")]: self.y_grid = new else: self.y_grid = new
452,173
def set_grid(self, attr_name, new): """ Setter function used by GridProperty. """ if (attr_name,self.orientation) in [("index_grid","v"), ("value_grid","h")]: self.y_grid = new else: self.y_grid = new
def set_grid(self, attr_name, new): """ Setter function used by GridProperty. """ if (attr_name,self.orientation) in [("index_grid","v"), ("value_grid","h")]: self.y_grid = new else: self.y_grid = new
452,174
def normal_left_down(self, event): """ Handles the left mouse button being pressed when the tool is in the 'normal' state. If selecting is enabled and the cursor is within **threshold** of a data point, the method calls the subclass's _select" or _deselect methods to perform the appropriate action, given the current s...
def normal_left_down(self, event): """ Handles the left mouse button being pressed when the tool is in the 'normal' state. If selecting is enabled and the cursor is within **threshold** of a data point, the method calls the subclass's _select" or _deselect methods to perform the appropriate action, given the current s...
452,175
def normal_left_down(self, event): """ Handles the left mouse button being pressed when the tool is in the 'normal' state. If selecting is enabled and the cursor is within **threshold** of a data point, the method calls the subclass's _select" or _deselect methods to perform the appropriate action, given the current s...
def normal_left_down(self, event): """ Handles the left mouse button being pressed when the tool is in the 'normal' state. If selecting is enabled and the cursor is within **threshold** of a data point, the method calls the subclass's _select" or _deselect methods to perform the appropriate action, given the current s...
452,176
def _render(self, gc, pts): gc.save_state() gc.clip_to_rect(self.x, self.y, self.width, self.height) try: if not self.index: gc.restore_state() return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple ...
def _render(self, gc, pts): with gc: gc.clip_to_rect(self.x, self.y, self.width, self.height) if not self.index: gc.restore_state() return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple masks in the...
452,177
def _render(self, gc, pts): gc.save_state() gc.clip_to_rect(self.x, self.y, self.width, self.height) try: if not self.index: gc.restore_state() return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple ...
def _render(self, gc, pts): gc.save_state() gc.clip_to_rect(self.x, self.y, self.width, self.height) try: if not self.index: return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple masks in the list? ...
452,178
def _render(self, gc, pts): gc.save_state() gc.clip_to_rect(self.x, self.y, self.width, self.height) try: if not self.index: gc.restore_state() return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple ...
def _render(self, gc, pts): gc.save_state() gc.clip_to_rect(self.x, self.y, self.width, self.height) try: if not self.index: gc.restore_state() return name = self.selection_metadata_name md = self.index.metadata if name in md and md[name] is not None and len(md[name]) > 0: # FIXME: when will we ever encounter multiple ...
452,179
def zoom_in(self, factor=0): if factor == 0: factor = self.zoom_factor new_index_factor = self._index_factor * factor new_value_factor = self._value_factor * factor
def zoom_in(self, factor=0): if factor == 0: factor = self.zoom_factor new_index_factor = self._index_factor * factor new_value_factor = self._value_factor * factor
452,180
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
def _create_window(self): # Create the model self.model = model = Model() cmap = jet self._update_model(cmap)
452,181
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
452,182
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
452,183
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
def _create_window(self): # Create the model try: self.model = model = BrainModel() cmap = bone except SystemExit: sys.exit() except: print "Unable to load BrainModel, using generated data cube." self.model = model = Model() cmap = jet self._update_model(cmap)
452,184
def _do_plot_boilerplate(kwargs, image=False): """ Used by various plotting functions. Checks/handles hold state, returns a Plot object for the plotting function to use. """ if kwargs.has_key("hold"): hold(kwargs["hold"]) del kwargs["hold"] # Check for an active window; if none, open one. if len(session.windows) == ...
def _do_plot_boilerplate(kwargs, image=False): """ Used by various plotting functions. Checks/handles hold state, returns a Plot object for the plotting function to use. """ if kwargs.has_key("hold"): hold(kwargs["hold"]) del kwargs["hold"] # Check for an active window; if none, open one. if len(session.windows) == ...
452,185
def __init__(self, *args, **kw): super(BarPlot, self).__init__(*args, **kw) # update colors to use the correct alpha channel self.line_color_ = self.line_color_[0:3] + (self.alpha,) self.fill_color_ = self.fill_color_[0:3] + (self.alpha,)
def self.set(**postponed) __init__(self, self.set(**postponed) *args, self.set(**postponed) **kw): self.set(**postponed) super(BarPlot, self.set(**postponed) self).__init__(*args, self.set(**postponed) **kw) self.set(**postponed) self.set(**postponed) # self.set(**postponed) update self.set(**postpo...
452,186
def map_index(self, screen_pt, threshold=2.0, outside_returns_none=True, \ index_only=False): """ Maps a screen space point to an index into the plot's index array(s). Implements the AbstractPlotRenderer interface. """ data_pt = self.map_data(screen_pt) if ((data_pt < self.index_mapper.range.low) or \ (data_pt > self....
def map_index(self, screen_pt, threshold=2.0, outside_returns_none=True, index_only=False): """ Maps a screen space point to an index into the plot's index array(s). Implements the AbstractPlotRenderer interface. """ data_pt = self.map_data(screen_pt) if ((data_pt < self.index_mapper.range.low) or \ (data_pt > self.in...
452,187
def map_index(self, screen_pt, threshold=2.0, outside_returns_none=True, \ index_only=False): """ Maps a screen space point to an index into the plot's index array(s). Implements the AbstractPlotRenderer interface. """ data_pt = self.map_data(screen_pt) if ((data_pt < self.index_mapper.range.low) or \ (data_pt > self....
def map_index(self, screen_pt, threshold=2.0, outside_returns_none=True, \ index_only=False): """ Maps a screen space point to an index into the plot's index array(s). Implements the AbstractPlotRenderer interface. """ data_pt = self.map_data(screen_pt) if ((data_pt < self.index_mapper.range.low) or \ (data_pt > self....
452,188
def __init__(self): #The delegates views don't work unless we caller the superclass __init__ super(CursorTest, self).__init__() container = HPlotContainer(padding=0, spacing=20) self.plot = container #a subcontainer for the first plot. #I'm not sure why this is required. Without it, the layout doesn't work right. subc...
def __init__(self): #The delegates views don't work unless we caller the superclass __init__ super(CursorTest, self).__init__() container = HPlotContainer(padding=0, spacing=20) self.plot = container #a subcontainer for the first plot. #I'm not sure why this is required. Without it, the layout doesn't work right. subc...
452,189
def __init__(self): #The delegates views don't work unless we caller the superclass __init__ super(CursorTest, self).__init__() container = HPlotContainer(padding=0, spacing=20) self.plot = container #a subcontainer for the first plot. #I'm not sure why this is required. Without it, the layout doesn't work right. subc...
def __init__(self): #The delegates views don't work unless we caller the superclass __init__ super(CursorTest, self).__init__() container = HPlotContainer(padding=0, spacing=20) self.plot = container #a subcontainer for the first plot. #I'm not sure why this is required. Without it, the layout doesn't work right. subc...
452,190
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
def_render(self,gc,points):#Ifthereisnothingtorender,rendernothingiflen(points)==0:logger.warning("Nodatasourceforplot")returnifself.fill_direction=='down':ox,oy=self.map_screen([[0,0]])[0]else:ox,oy=self.map_screen([[self.x_mapper.range.high,self.y_mapper.range.high]])[0]gc.save_state()try:gc.clip_to_rect(self.x,self....
452,191
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_state() try: gc.clip_to_rect(self.x, self....
452,192
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
452,193
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
452,194
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
def _render(self, gc, points): # If there is nothing to render, render nothing if len(points) == 0: logger.warning("No datasource for plot") return if self.fill_direction == 'down': ox, oy = self.map_screen([[0,0]])[0] else: ox, oy = self.map_screen([[self.x_mapper.range.high, self.y_mapper.range.high]])[0] gc.save_st...
452,195
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
452,196
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
452,197
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
def _compute_tick_positions(self, gc, component=None): """ Calculates the positions for the tick marks. Overrides PlotAxis. """ if (self.mapper is None): self._reset_cache() self._cache_valid = True return datalow = self.mapper.range.low datahigh = self.mapper.range.high screenhigh = self.mapper.high_pos screenlow = ...
452,198
def _render(self, gc, points, selected_points=None): if len(points) == 0: return
def _render(self, gc, points, selected_points=None): if len(points) == 0: return
452,199