bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads:\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, error, backtrace + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtrace in errors))) self.errors = copy(errors)
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads '\ '(use --debug option to print backtraces):\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, error, backtrace + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtrace in errors))) self.e...
446,100
def home(self): """ Go to the home page. """ self.location('%s://%s' % (self.PROTOCOL, self.DOMAIN))
def home(self): """ Go to the home page. """ self.location('%s://%s' % (self.PROTOCOL, self.DOMAIN))
446,101
def __init__(self): Browser.__init__(self, '', parser=Parser)
def __init__(self): Browser.__init__(self, '', parser=Parser)
446,102
def test_new_messages(self): tot = 0 for thread in self.backend.iter_threads(): thread = self.backend.fillobj(thread, 'root') count = 0 for m in thread.iter_all_messages(): count += 1 debug('Count: %s' % count) tot += count
def test_new_messages(self): tot = 0 for thread in self.backend.iter_threads(): thread = self.backend.fillobj(thread, 'root') count = 0 for m in thread.iter_all_messages(): count += 1 debug('Count: %s' % count) tot += count
446,103
def test_new_messages(self): tot = 0 for thread in self.backend.iter_threads(): thread = self.backend.fillobj(thread, 'root') count = 0 for m in thread.iter_all_messages(): count += 1 debug('Count: %s' % count) tot += count
def test_new_messages(self): tot = 0 for thread in self.backend.iter_threads(): thread = self.backend.fillobj(thread, 'root') count = 0 for m in thread.iter_all_messages(): count += 1 debug('Count: %s' % count) tot += count
446,104
def process_incoming_mail(self, msg): to = self.get_email_address_ident(msg, 'To') reply_to = self.get_email_address_ident(msg, 'In-Reply-To') if not reply_to: print >>sys.stderr, 'This is not a reply (no Reply-To field)' return 1
def process_incoming_mail(self, msg): to = self.get_email_address_ident(msg, 'To') reply_to = self.get_email_address_ident(msg, 'In-Reply-To') if not reply_to: print >>sys.stderr, 'This is not a reply (no Reply-To field)' return 1
446,105
def process_incoming_mail(self, msg): to = self.get_email_address_ident(msg, 'To') reply_to = self.get_email_address_ident(msg, 'In-Reply-To') if not reply_to: print >>sys.stderr, 'This is not a reply (no Reply-To field)' return 1
def process_incoming_mail(self, msg): to = self.get_email_address_ident(msg, 'To') reply_to = self.get_email_address_ident(msg, 'In-Reply-To') if not reply_to: print >>sys.stderr, 'This is not a reply (no Reply-To field)' return 1
446,106
def iter_contacts(self, status=Contact.STATUS_ALL, ids=None): with self.browser: for contact in self.browser.iter_contacts(): s = 0 if contact['cat'] == 1: s = Contact.STATUS_ONLINE elif contact['cat'] == 3: s = Contact.STATUS_OFFLINE elif contact['cat'] == 2: s = Contact.STATUS_AWAY else: self.logger.warning('Unknown ...
def iter_contacts(self, status=Contact.STATUS_ALL, ids=None): with self.browser: for contact in self.browser.iter_contacts(): s = 0 if contact['cat'] == 1: s = Contact.STATUS_ONLINE elif contact['cat'] == 3: s = Contact.STATUS_OFFLINE elif contact['cat'] == 2: s = Contact.STATUS_AWAY else: self.logger.warning('Unknown ...
446,107
def label(self, value): self._label = str(value)
def label(self, value): self._label = str(value)
446,108
def format_dict(self, item): result = u'%sTitle:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['title']) result += u'%sDate:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['date']) result += u'%sFrom:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['sender']) result += u'%sTo:%s %s\n' %...
def format_dict(self, item): result = u'%sTitle:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['title']) result += u'%sDate:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['date']) result += u'%sFrom:%s %s\n' % (ReplApplication.BOLD, ReplApplication.NC, item['sender']) result += u'%sTo:%s %s\n' %...
446,109
def run(self): if self.app.options.smtpd: if ':' in self.app.options.smtpd: host, port = self.app.options.smtpd.split(':', 1) else: host = '127.0.0.1' port = self.app.options.smtpd FakeSMTPD(self.app, host, int(port))
def run(self): if self.app.options.smtpd: if ':' in self.app.options.smtpd: host, port = self.app.options.smtpd.split(':', 1) else: host = '127.0.0.1' port = self.app.options.smtpd FakeSMTPD(self.app, host, int(port))
446,110
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoLabel.setPixmap(None) self.ui.photoUrlLabel.setText('') return
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoUrlLabel.setText('') return
446,111
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoLabel.setPixmap(None) self.ui.photoUrlLabel.setText('') return
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoLabel.setPixmap(None) self.ui.photoUrlLabel.setText('') return
446,112
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoLabel.setPixmap(None) self.ui.photoUrlLabel.setText('') return
def display_photo(self): if self.displayed_photo_idx >= len(self.contact.photos): self.displayed_photo_idx = len(self.contact.photos) - 1 if self.displayed_photo_idx < 0: self.ui.photoLabel.setPixmap(None) self.ui.photoUrlLabel.setText('') return
446,113
def iter_torrents(self):
def iter_torrents(self):
446,114
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren()[5].te...
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren()[5].te...
446,115
def __init__(self, weboob, name, config, storage): self.weboob = weboob self.name = name self.lock = RLock()
def __init__(self, weboob, name, config, storage): self.weboob = weboob self.name = name self.lock = RLock()
446,116
def _handle_app_options(self): if self.options.formatter: formatter_name = self.options.formatter else: formatter_name = 'multiline' self.formatter = load_formatter(formatter_name)
def _handle_options(self): if self.options.formatter: formatter_name = self.options.formatter else: formatter_name = 'multiline' self.formatter = load_formatter(formatter_name)
446,117
def cancel(self, ev): with self.mutex: try: e = self.queue.pop(ev) except KeyError: return False e.cancel() self.logger.debug('scheduled function "%s" is canceled' % e.function) return True
def cancel(self, ev): with self.mutex: try: e = self.queue.pop(ev) except KeyError: return False e.cancel() self.logger.debug('scheduled function "%s" is canceled' % e.function.__name__) return True
446,118
def load_buildtin(): from .htmlparser import HTMLParser return HTMLParser
def load_builtin(): from .htmlparser import HTMLParser return HTMLParser
446,119
def get_my_name(self): if time.time() - self.last_update > 60: self.home() return self.page.get_my_name()
def get_my_name(self): if time.time() - self.last_update > 60: self.home() return self.page.get_my_name()
446,120
def post_reply(self, thread, reply_id, title, message): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
def post_reply(self, thread, reply_id, title, message): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
446,121
def main(self, argv): self.load_config() self.load_backends(ICapDating, storage=self.create_storage(self.STORAGE_FILENAME))
def main(self, argv): self.load_config() self.load_backends(ICapDating, storage=self.create_storage(self.STORAGE_FILENAME))
446,122
def optims(self, action, function, optims): for optim in optims: try: self.service('Starting %s' % optim, 'start_optimization', optim) except weboob.core.CallErrors, errors: for backend, error, backtrace in errors: if isinstance(error, OptimizationNotFound): logging.error(u'Optimization "%s" not found' % optim)
def optims(self, action, function, optims): for optim in optims: try: self.service('Starting "%s"' % optim, 'start_optimization', optim) except weboob.core.CallErrors, errors: for backend, error, backtrace in errors: if isinstance(error, OptimizationNotFound): logging.error(u'Optimization "%s" not found' % optim)
446,123
def get_id(self): tag = self.__get_element('thread_link')
def get_id(self): tag = self.__get_element('thread_link')
446,124
def load(self): import weboob.backends for path in weboob.backends.__path__: regexp = re.compile('^%s/([\w\d_]+)$' % path) for root, dirs, files in os.walk(path): m = regexp.match(root) if m and '__init__.py' in files: self.load_module('weboob.backends.%s' % m.group(1))
def load(self): import weboob.backends for path in weboob.backends.__path__: regexp = re.compile('^%s/([\w\d_]+)$' % path) for root, dirs, files in os.walk(path): m = regexp.match(root) if m and '__init__.py' in files: self.load_module('weboob.backends.%s' % m.group(1))
446,125
def onecmd(self, line): """ This REPL method is overrided to catch some particular exceptions. """ cmd, arg, ignored = self.parseline(line)
def onecmd(self, line): """ This REPL method is overrided to catch some particular exceptions. """ cmd, arg, ignored = self.parseline(line)
446,126
def save(self): self.storage.set('profiles_walker', 'viewed', self.visited_profiles) self.storage.save()
def save(self): self.storage.set('profiles_walker', 'viewed', list(self.visited_profiles)) self.storage.save()
446,127
def parseargs(self, line, nb, req_n=None): args = line.strip().split(' ', nb - 1) if req_n is not None and (len(args) < req_n or req_n < 2 and line == ''): raise NotEnoughArguments('Command needs %d arguments' % req_n)
def parseargs(self, line, nb, req_n=None): if line.strip() == '': args = [] else: args = line.strip().split(' ', nb - 1) if req_n is not None and (len(args) < req_n): raise NotEnoughArguments('Command needs %d arguments' % req_n)
446,128
def post_reply(self, thread_id, reply_id, title, message): with self.browser: self.browser.post(thread_id, message)
def post_reply(self, thread_id, reply_id, title, message): with self.browser: self.browser.post(thread_id, message)
446,129
def post_reply(self, thread, reply_id, title, message, is_html=False): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
def post_reply(self, thread, reply_id, title, message, is_html=False): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
446,130
def post_reply(self, thread, reply_id, title, message, is_html=False): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
def post_reply(self, thread, reply_id, title, message, is_html=False): content_type = id2contenttype(thread) thread_id = id2threadid(thread) reply_id = int(reply_id)
446,131
def _play_rtmp(self, media, player_name): """ Download data with rtmpdump and pipe them to a media player.
def _play_rtmp(self, media, player_name): """ Download data with rtmpdump and pipe them to a media player.
446,132
def _play_rtmp(self, media, player_name): """ Download data with rtmpdump and pipe them to a media player.
def _play_rtmp(self, media, player_name): """ Download data with rtmpdump and pipe them to a media player.
446,133
def _iter_messages_of(self, what, thread_wanted, only_new): if not what in self.storage.get('seen', default={}): self.storage.set('seen', what, {})
def _iter_messages_of(self, what, thread_wanted, only_new): if not what in self.storage.get('seen', default={}): self.storage.set('seen', what, {})
446,134
def _iter_messages_of(self, what, thread_wanted, only_new): if not what in self.storage.get('seen', default={}): self.storage.set('seen', what, {})
def _iter_messages_of(self, what, thread_wanted, only_new): if not what in self.storage.get('seen', default={}): self.storage.set('seen', what, {})
446,135
def _change_location(self, result): """ This function is called when we have moved to a page, to load a Page object. """
def _change_location(self, result): """ This function is called when we have moved to a page, to load a Page object. """
446,136
def load_backends(self, caps=None, names=None, modules=None, storage=None): loaded = {} if storage is None: storage = self.storage
def load_backends(self, caps=None, names=None, modules=None, storage=None): loaded = {} if storage is None: storage = self.storage
446,137
def __init__(self): Browser.__init__(self, '', parser=Parser)
def __init__(self): Browser.__init__(self, '', parser=Parser)
446,138
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads '\ '(use --debug option to print backtraces):\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, repr(error), backtrace + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtrace in errors))) ...
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads '\ '(use --debug option to print backtraces):\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, repr(error), backtrace.decode('utf-8') + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtra...
446,139
def confirm(self): self.browser.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/virementsafran/virementnational/4-virementNational.ea")
def confirm(self): self.browser.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/virementsafran/virementnational/4-virementNational.ea")
446,140
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
446,141
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
446,142
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
def get_transfer_id(self): p = self.document.xpath("//form/div/p")[0] text = to_unicode(p.text)
446,143
def __init__(self): gtk.Window.__init__(self) self.connect('destroy', gtk.main_quit) self.set_default_size(800, 600) self.web_view = webkit.WebView() sw = gtk.ScrolledWindow() sw.add(self.web_view) self.add(sw) self.show_all()
def __init__(self): gtk.Window.__init__(self) self.connect('destroy', gtk.main_quit) self.set_default_size(800, 600) self.web_view = webkit.WebView() sw = gtk.ScrolledWindow() sw.add(self.web_view) self.add(sw) self.show_all()
446,144
def __init__(self): TableFormatter.__init__(self, return_only=True, result_funcname='get_html_string')
def __init__(self): TableFormatter.__init__(self, return_only=True, result_funcname='get_html_string')
446,145
def flush(self): table_string = TableFormatter.flush(self) js_filepaths = [] js_filepaths.append(get_javascript('jquery')) js_filepaths.append(get_javascript('tablesorter')) scripts = ['<script type="text/javascript" src="%s"></script>' % js_filepath for js_filepath in js_filepaths] html_string_params = dict(table=tabl...
def flush(self): table_string = HTMLTableFormatter.flush(self) js_filepaths = [] js_filepaths.append(get_javascript('jquery')) js_filepaths.append(get_javascript('tablesorter')) scripts = ['<script type="text/javascript" src="%s"></script>' % js_filepath for js_filepath in js_filepaths] html_string_params = dict(table=...
446,146
def balance_set(self, value): self._balance = float(value)
def balance(self, value): self._balance = float(value)
446,147
def coming_set(self, value): self._coming = float(value)
def coming(self, value): self._coming = float(value)
446,148
def _get_video(self, _id): if self.interactive: try: video = self.videos[int(_id)] except (KeyError,ValueError): pass else: return video _id, backend_name = self.parse_id(_id) backend_names = (backend_name,) if backend_name is not None else self.enabled_backends for backend, video in self.do('get_video', _id, backends=...
def _get_video(self, _id): if self.interactive: try: video = self.videos[int(_id)] except (KeyError,ValueError): pass else: if video: return video _id, backend_name = self.parse_id(_id) backend_names = (backend_name,) if backend_name is not None else self.enabled_backends for backend, video in self.do('get_video', _id,...
446,149
def do_info(self, _id): """ info ID
def do_info(self, _id): """ info ID
446,150
def get_torrent(self, id): table = self.document.getroot().cssselect('div.thin') if not table: warning('No div.thin found') return None
def get_torrent(self, id): table = self.document.getroot().cssselect('div.thin') if not table: warning('No div.thin found') return None
446,151
def __init__(self, weboob, name, config, storage): self.weboob = weboob self.name = name self.lock = RLock()
def __init__(self, weboob, name, config, storage): self.weboob = weboob self.name = name self.lock = RLock()
446,152
def login(self, login, password): self.browser.select_form(nr=0) try: self.browser['numero'] = login self.browser['code'] = password except ControlNotFoundError: try: self.browser['userLogin'] = login self.browser['userPassword'] = password except ClientForm.ControlNotFoundError: self.browser.controls.append(ClientForm...
def login(self, login, password): self.browser.select_form(nr=0) try: self.browser['numero'] = login self.browser['code'] = password except ControlNotFoundError: try: self.browser['userLogin'] = login self.browser['userPassword'] = password except ControlNotFoundError: self.browser.controls.append(ClientForm.TextContro...
446,153
def do(self, function, *args, **kwargs): """ Call Weboob.do(), after having filled the yielded object, if selected fields are given by user. """
def do(self, function, *args, **kwargs): """ Call Weboob.do(), after having filled the yielded object, if selected fields are given by user. """
446,154
def unit(self, n, u): m = {'KB': 1024, 'MB': 1024*1024, 'GB': 1024*1024*1024, 'TB': 1024*1024*1024*1024, } return float(n*m[u])
def unit(self, n, u): m = {'bytes': 1, 'KB': 1024, 'MB': 1024*1024, 'GB': 1024*1024*1024, 'TB': 1024*1024*1024*1024, } return float(n*m[u])
446,155
def unit(self, n, u): m = {'KB': 1024, 'MB': 1024*1024, 'GB': 1024*1024*1024, 'TB': 1024*1024*1024*1024, } return float(n*m[u])
def unit(self, n, u): m = {'bytes': 1, 'KB': 1024, 'MB': 1024*1024, 'GB': 1024*1024*1024, 'TB': 1024*1024*1024*1024, } return float(n*m[u])
446,156
def post(self, content): if isinstance(content, unicode): content = content.encode('iso-8859-15', 'replace')
def post(self, content): if isinstance(content, unicode): content = content.encode('iso-8859-15', 'replace')
446,157
def website(self): if self.klass.BROWSER and self.klass.BROWSER.DOMAIN: return '%s://%s' % (self.klass.BROWSER.PROTOCOL, self.klass.BROWSER.DOMAIN) else: return None
def website(self): if self.klass.BROWSER and hasattr(self.klass.BROWSER, 'DOMAIN') and self.klass.BROWSER.DOMAIN: return '%s://%s' % (self.klass.BROWSER.PROTOCOL, self.klass.BROWSER.DOMAIN) else: return None
446,158
def do_list(self, line): """ list
def do_list(self, line): """ list
446,159
def __init__(self, option_parser=None): self.weboob = self.create_weboob() self.config = None self.options = None if option_parser is None: self._parser = OptionParser(self.SYNOPSIS, version=self._get_optparse_version()) else: self._parser = option_parser if self.DESCRIPTION: self._parser.description = self.DESCRIPTION...
def __init__(self, option_parser=None): self.weboob = self.create_weboob() self.config = None self.options = None if option_parser is None: self._parser = OptionParser(self.SYNOPSIS, version=self._get_optparse_version()) else: self._parser = option_parser if self.DESCRIPTION: self._parser.description = self.DESCRIPTION...
446,160
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
446,161
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
446,162
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
446,163
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
def _caller(self, b, function, args, kwargs): debug('Hello from timer %s' % b) with b: try: # Call method on backend try: if callable(function): r = function(b, *args, **kwargs) else: r = getattr(b, function)(*args, **kwargs) except Exception, e: with self.mutex: # TODO save backtrace and/or print it here (with debug) ...
446,164
def parse(self, data): self.feed(data.read()) return self
def parse(self, data, encoding): self.feed(data.read()) return self
446,165
def on_loaded(self): if self.document.docinfo.doctype == '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" ' '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">': self.browser.follow_link(url_regex="releve", tag="a")
def on_loaded(self): if self.document.docinfo.doctype == '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" ' \ '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">': self.browser.follow_link(url_regex="releve", tag="a")
446,166
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.we...
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: print 'Cannot start application: no configured backend was found.' try: from weboob.applications.weboobcfg import WeboobCfg except ImportError: pri...
446,167
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.we...
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.we...
446,168
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.we...
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.we...
446,169
def iter_torrents(self): for tr in self.document.getiterator('tr'): if tr.attrib.get('class', '') == 'hlRow': # TODO à corriger atitle = tr.getchildren()[2].getchildren()[1] title = atitle.text if not title: title = '' for bold in atitle.getchildren(): if bold.text: title += bold.text if bold.tail: title += bold.tail i...
def iter_torrents(self): for tr in self.document.getiterator('tr'): if tr.attrib.get('class', '') == 'hlRow': # TODO à corriger atitle = tr.getchildren()[2].getchildren()[1] title = atitle.text if not title: title = '' for bold in atitle.getchildren(): if bold.text: title += bold.text if bold.tail: title += bold.tail i...
446,170
def _play_rtmp(self, video): """ Download data with rtmpdump and pipe them to a video player.
def _play_rtmp(self, video): """ Download data with rtmpdump and pipe them to a video player.
446,171
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads:\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, error, backtrace + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtrace in self.errors))) self.errors = copy(errors)
def __init__(self, errors): Exception.__init__(self, u'These errors have been raised in backend threads:\n%s' % ( u'\n'.join((u' * %s: %s%s' % (backend, error, backtrace + '\n' if logging.root.level == logging.DEBUG else '')) for backend, error, backtrace in errors))) self.errors = copy(errors)
446,172
def _play_default(self, video): """ Play video.url with the video player. """ player_name = self.get_player_name() print 'Invoking "%s %s".' % (player_name, video.url) os.spawnlp(os.P_NOWAIT, player_name, video.url)
def _play_default(self, video): """ Play video.url with the video player. """ player_name = self.get_player_name() print 'Invoking "%s %s".' % (player_name, video.url) os.spawnlp(os.P_NOWAIT, player_name, video.url)
446,173
def set_details(self, v): div = self.document.getroot().cssselect('div[id=watch-description-body]') if not div: return
def set_details(self, v): div = self.document.getroot().cssselect('div[id=watch-description-body]') if not div: return
446,174
def do_post(self): """ post
def do_post(self, line): """ post
446,175
def do_run(self): """ run
def do_run(self, line): """ run
446,176
def onecmd(self, _cmd): """ This REPL method is overrided to catch some particular exceptions. """ cmd_name = _cmd.split()[0] if cmd_name in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd_name]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).onecmd(_...
def onecmd(self, line): """ This REPL method is overrided to catch some particular exceptions. """ cmd_name = _cmd.split()[0] if cmd_name in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd_name]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).onecmd(_...
446,177
def onecmd(self, _cmd): """ This REPL method is overrided to catch some particular exceptions. """ cmd_name = _cmd.split()[0] if cmd_name in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd_name]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).onecmd(_...
def onecmd(self, _cmd): """ This REPL method is overrided to catch some particular exceptions. """ cmd, arg, ignored = self.parseline(line) if cmd in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).on...
446,178
def onecmd(self, _cmd): """ This REPL method is overrided to catch some particular exceptions. """ cmd_name = _cmd.split()[0] if cmd_name in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd_name]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).onecmd(_...
def onecmd(self, _cmd): """ This REPL method is overrided to catch some particular exceptions. """ cmd_name = _cmd.split()[0] if cmd_name in self.commands_formatters: self.set_formatter(self.commands_formatters[cmd_name]) else: self.set_formatter(self.DEFAULT_FORMATTER) try: return super(ReplApplication, self).onecmd(...
446,179
def _iter_messages(self, thread, only_new): try: if only_new and not self.browser.nb_new_mails(): my_name = self.browser.get_my_name() contacts = self.browser.get_contact_list() contacts.reverse()
def _iter_messages(self, thread, only_new): try: if not only_new or self.browser.nb_new_mails(): my_name = self.browser.get_my_name() contacts = self.browser.get_contact_list() contacts.reverse()
446,180
def __init__(self, url): self.url = url self.data = None
def __init__(self, url): self.url = url.replace(' ', '%20') self.data = None
446,181
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren()[5].te...
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text.strip() elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren...
446,182
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren()[5].te...
def get_torrent(self, id): for div in self.document.getiterator('div'): if div.attrib.get('id','') == 'title': title = div.text elif div.attrib.get('class','') == 'download': url = div.getchildren()[0].attrib.get('href','') elif div.attrib.get('id','') == 'details': size = float(div.getchildren()[0].getchildren()[5].te...
446,183
def complete(self, backend, count, selected_fields, function, *args, **kwargs): assert count is None or count > 0 res = getattr(backend, function)(*args, **kwargs)
def complete(self, backend, count, selected_fields, function, *args, **kwargs): assert count is None or count > 0 res = getattr(backend, function)(*args, **kwargs)
446,184
def __init__(self, login, pwd):
def __init__(self, login, pwd):
446,185
def test_meteofrance(self): l = list(self.backend.iter_city_search('paris')) self.assertTrue(len(l) > 0)
def test_meteofrance(self): l = list(self.backend.iter_city_search('paris')) self.assertTrue(len(l) > 0)
446,186
def __init__(self, config, weboob, parent=None): QtMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self)
def __init__(self, config, weboob, parent=None): QtMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self)
446,187
def location(self, *args, **kwargs): """ Change location of browser on an URL.
def location(self, *args, **kwargs): """ Change location of browser on an URL.
446,188
def location(self, *args, **kwargs): """ Change location of browser on an URL.
def location(self, *args, **kwargs): """ Change location of browser on an URL.
446,189
def on_loaded(self): self.name = u'' self.description = u'' self.table = deepcopy(self.empty_table) self.id = 0 self.photos = [] self.status = '' self.stats = OrderedDict(( ('score', 0), ('visits', 0), ('charms', 0), ('baskets', 0), ('mails', 0), ))
def on_loaded(self): self.name = u'' self.description = u'' self.table = deepcopy(self.empty_table) self.id = 0 self.photos = [] self.status = '' self.stats = OrderedDict(( ('score', 0), ('visits', 0), ('charms', 0), ('baskets', 0), ('mails', 0), ))
446,190
def command_search(self, pattern): print ".--------------------------------.---------------------------------------------." print '| ID | Name |' print '+--------------------------------+---------------------------------------------+' count = 0 for back...
def command_search(self, pattern): print ".--------------------------------.---------------------------------------------." print '| ID | Name |' print '+--------------------------------+---------------------------------------------+' count = 0 for back...
446,191
def command_current(self, city): print ".-------------.----------------------------------------------------------------." print '| Temperature | Text |' print '+-------------+----------------------------------------------------------------+' found = 0 for backen...
def command_current(self, city): print ".-------------.----------------------------------------------------------------." print '| Temperature | Text |' print '+-------------+----------------------------------------------------------------+' found = 0 for backen...
446,192
def iter_videos(self): ul = select(self.document.getroot(), 'div.container-videos ul', 1) for li in ul.findall('li'): id = re.sub(r'/video/(.+)\.html', r'\1', li.find('a').attrib['href'])
def iter_videos(self): ul = select(self.document.getroot(), 'div.container-videos ul', 1) for li in ul.findall('li'): id = re.sub(r'/video/(.+)\.html', r'\1', li.find('a').attrib['href'])
446,193
def iter_videos(self): ul = select(self.document.getroot(), 'div.container-videos ul', 1) for li in ul.findall('li'): id = re.sub(r'/video/(.+)\.html', r'\1', li.find('a').attrib['href'])
def iter_videos(self): ul = select(self.document.getroot(), 'div.container-videos ul', 1) for li in ul.findall('li'): id = re.sub(r'/video/(.+)\.html', r'\1', li.find('a').attrib['href'])
446,194
def __init__(self, path): self.path = path self.values = {} self.config = SafeConfigParser()
def __init__(self, path): self.path = path self.values = {} self.config = SafeConfigParser()
446,195
def load_section(section): sections = section.split(':') if len(sections) > 1: result = {} for s in sections: result[s] = load_section(s) return result else: return {section: dict(self.config.items(section))}
def load_section(section): sections = section.split(':') if len(sections) > 1: result = {} for s in sections: result[s] = load_section(s) return result else: return {section: dict(self.config.items(section))}
446,196
def load_section(section): sections = section.split(':') if len(sections) > 1: result = {} for s in sections: result[s] = load_section(s) return result else: return {section: dict(self.config.items(section))}
def load_section(section): sections = section.split(':') if len(sections) > 1: result = {} for s in sections: result[s] = load_section(s) return result else: return {section: dict(self.config.items(section))}
446,197
def save_section(values, root_section=None): for k, v in values.iteritems(): if isinstance(v, (int, float, basestring)): if root_section is not None and not self.config.has_section(root_section): self.config.add_section(root_section) self.config.set(root_section, k, unicode(v)) elif isinstance(v, dict): new_section = '...
def save_section(values, root_section='ROOT'): for k, v in values.iteritems(): if isinstance(v, (int, float, basestring)): if root_section is not None and not self.config.has_section(root_section): self.config.add_section(root_section) self.config.set(root_section, k, unicode(v)) elif isinstance(v, dict): new_section =...
446,198
def save_section(values, root_section=None): for k, v in values.iteritems(): if isinstance(v, (int, float, basestring)): if root_section is not None and not self.config.has_section(root_section): self.config.add_section(root_section) self.config.set(root_section, k, unicode(v)) elif isinstance(v, dict): new_section = '...
def save_section(values, root_section=None): for k, v in values.iteritems(): if isinstance(v, (int, float, basestring)): if not self.config.has_section(root_section): self.config.add_section(root_section) self.config.set(root_section, k, unicode(v)) elif isinstance(v, dict): new_section = ':'.join((root_section, k)) if...
446,199