bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def unquote_any(typ, s): if typ == 'ident': ps = [skytools.unquote_ident(p) for p in s.split('.')] s = '.'.join(ps) elif typ == 'str' or typ == 'dolq': s = skytools.unquote_literal(s, stdstr = True) return s
def unquote_any(typ, s): if typ == 'ident': ps = [skytools.unquote_ident(p) for p in s.split('.')] s = '.'.join(ps) elif typ == 'str' or typ == 'dolq': s = skytools.unquote_literal(s, True) return s
445,000
def normalize_any(s): if s: c = s[0] if c == "'": s = skytools.unquote_literal(s, stdstr = True) else: s = skytools.unquote_fqident(s) return s
def normalize_any(typ, s): if typ == 'str': s = skytools.unquote_literal(s, stdstr = True) elif typ == 'ident': s = skytools.unquote_fqident(s) return s
445,001
def get_next(self, typ, word, params): for w in self.tok_list: n = w.get_next(typ, word, params) if n: if self.name: params[self.name] = word return n return None
def get_next(self, typ, word, params): for w in self.tok_list: n = w.get_next(typ, word, params) if n: self.set_param(word, params) return n return None
445,002
def get_next(self, typ, word, params): if typ not in self.tk_type: return None if self.word and word != self.word: return None if self.name: # and not self.name in params: params[self.name] = word return self.next
def get_next(self, typ, word, params): if typ not in self.tk_type: return None if self.word and word != self.word: return None if self.name: # and not self.name in params: params[self.name] = word return self.next
445,003
def get_next(self, typ, word, params): """Allow quoted queue names""" next = DynList.get_next(self, typ, word, params) if next and self.name: params[self.name] = normalize_any(word) return next
def get_next(self, typ, word, params): """Allow quoted queue names""" next = DynList.get_next(self, typ, word, params) if next: self.set_param(word, params) return next
445,004
def get_wlist(self): return []
def get_wlist(self): return []
445,005
def get_known_table_list(self): if not self.cur_queue: return [] qname = skytools.quote_literal(self.cur_queue) q = "select table_name from londiste.table_info"\ " where queue_name = %s order by 1" % qname return self._ccache('known_table_list', q, 'londiste')
def get_known_table_list(self): if not self.cur_queue: return [] qname = skytools.quote_literal(self.cur_queue) q = "select londiste.quote_fqname(table_name)"\ " from londiste.table_info"\ " where queue_name = %s order by 1" % qname return self._ccache('known_table_list', q, 'londiste')
445,006
def get_known_seq_list(self): if not self.cur_queue: return [] qname = skytools.quote_literal(self.cur_queue) q = "select seq_name from londiste.seq_info"\ " where queue_name = %s order by 1" % qname return self._ccache('known_seq_list', q, 'londiste')
def get_known_seq_list(self): if not self.cur_queue: return [] qname = skytools.quote_literal(self.cur_queue) q = "select londiste.quote_fqname(seq_name)"\ " from londiste.seq_info"\ " where queue_name = %s order by 1" % qname return self._ccache('known_seq_list', q, 'londiste')
445,007
def main_loop(self): readline.parse_and_bind('tab: complete') readline.set_completer(self.rl_completer_safe) print 'delims: ', repr(readline.get_completer_delims()) # remove " from delims readline.set_completer_delims(" \t\n`~!@#$%^&*()-=+[{]}\\|;:',<>/?")
def main_loop(self): readline.parse_and_bind('tab: complete') readline.set_completer(self.rl_completer_safe) # remove " from delims readline.set_completer_delims(" \t\n`~!@#$%^&*()-=+[{]}\\|;:',<>/?")
445,008
def main_loop(self): readline.parse_and_bind('tab: complete') readline.set_completer(self.rl_completer_safe) print 'delims: ', repr(readline.get_completer_delims()) # remove " from delims readline.set_completer_delims(" \t\n`~!@#$%^&*()-=+[{]}\\|;:',<>/?")
def main_loop(self): readline.parse_and_bind('tab: complete') readline.set_completer(self.rl_completer_safe) print 'delims: ', repr(readline.get_completer_delims()) # remove " from delims readline.set_completer_delims(" \t\n`~!@#$%^&*()-=+[{]}\\|;:',<>/?")
445,009
def find_suggestions(self, pfx, curword, params = {}):
def find_suggestions(self, pfx, curword, params = {}):
445,010
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): if typ == 'ident': w = normalize_any(w) node = node.get_next(typ, w, params) if not node: break
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): w = normalize_any(typ, w) node = node.get_next(typ, w, params) if not node: break
445,011
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): if typ == 'ident': w = normalize_any(w) node = node.get_next(typ, w, params) if not node: break
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): if typ == 'ident': w = normalize_any(w) node = node.get_next(typ, w, params) if not node: break
445,012
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): if typ == 'ident': w = normalize_any(w) node = node.get_next(typ, w, params) if not node: break
def find_suggestions_real(self, pfx, params): # find level node = top_level pos = 0 for typ, w, pos in self.sql_words(pfx): if typ == 'ident': w = normalize_any(w) node = node.get_next(typ, w, params) if not node: break
445,013
def exec_string(self, ln, eof = False): node = top_level params = {} for typ, w, pos in self.sql_words(ln): if typ == 'ident': w = normalize_any(w) #print repr(typ), repr(w) if typ == 'error': print 'syntax error 1:', repr(ln) return onode = node node = node.get_next(typ, w, params) if not node: print "syntax error 2:"...
def exec_string(self, ln, eof = False): node = top_level params = {} for typ, w, pos in self.sql_words(ln): w = normalize_any(typ, w) #print repr(typ), repr(w) if typ == 'error': print 'syntax error 1:', repr(ln) return onode = node node = node.get_next(typ, w, params) if not node: print "syntax error 2:", repr(ln), re...
445,014
def cmd_londiste_add_table(self, params): """Add table."""
def cmd_londiste_add_table(self, params): """Add table."""
445,015
def cmd_londiste_remove_table(self, params): """Remove table."""
def cmd_londiste_remove_table(self, params): """Remove table."""
445,016
def cmd_londiste_add_seq(self, params): """Add seq."""
def cmd_londiste_add_seq(self, params): """Add seq."""
445,017
def cmd_londiste_remove_seq(self, params): """Remove seq."""
def cmd_londiste_remove_seq(self, params): """Remove seq."""
445,018
def init_optparse(self, parser = None): """Initialize a OptionParser() instance that will be used to parse command line arguments.
def init_optparse(self, parser = None): """Initialize a OptionParser() instance that will be used to parse command line arguments.
445,019
def work(self): """Here should user's processing happen.
def work(self): """Here should user's processing happen.
445,020
def process_remote_event(self, src_curs, dst_curs, ev): """handle one event""" self.log.debug("New event: id=%s / type=%s / data=%s / extra1=%s" % (ev.id, ev.type, ev.data, ev.extra1)) if ev.type in ('I', 'U', 'D'): self.handle_data_event(ev, dst_curs) elif ev.type[:2] in ('I:', 'U:', 'D:'): self.handle_data_event(ev, ...
def process_remote_event(self, src_curs, dst_curs, ev): """handle one event""" self.log.debug("New event: id=%s / type=%s / data=%s / extra1=%s" % (ev.id, ev.type, ev.data, ev.extra1)) if ev.type in ('I', 'U', 'D'): self.handle_data_event(ev, dst_curs) elif ev.type[:2] in ('I:', 'U:', 'D:'): self.handle_data_event(ev, ...
445,021
def interesting(self, ev): """See if event is interesting.""" if ev.type not in ('I', 'U', 'D'): raise Exception('bug - bad event type in .interesting') t = self.get_table_by_name(ev.extra1) if not t: return 0 if not t.interesting(ev, self.cur_tick, self.copy_thread): return 0 return 1
def interesting(self, ev): """See if event is interesting.""" if ev.type not in ('I', 'U', 'D', 'R'): raise Exception('bug - bad event type in .interesting') t = self.get_table_by_name(ev.extra1) if not t: return 0 if not t.interesting(ev, self.cur_tick, self.copy_thread): return 0 return 1
445,022
def do_repair(self, src_db, dst_db, where, pfx = 'repair', apply_fixes = False): """Actual comparision."""
def do_repair(self, src_db, dst_db, where, pfx = 'repair', apply_fixes = False): """Actual comparision."""
445,023
def dump_table(self, copy_cmd, curs, fn): """Dump table to disk.""" f = open(fn, "w", 64*1024) curs.copy_expert(f, copy_cmd) self.log.info('%s: Got %d bytes' % (self.table_name, f.tell())) f.close()
def dump_table(self, copy_cmd, curs, fn): """Dump table to disk.""" f = open(fn, "w", 64*1024) curs.copy_expert(copy_cmd, f) self.log.info('%s: Got %d bytes' % (self.table_name, f.tell())) f.close()
445,024
def force_tick(self, curs, queue_name): """ Force tick into source queue so that consumer can move on faster """ q = "select pgq.force_tick(%s)" curs.execute(q, [queue_name]) res = curs.fetchone() cur_pos = res[0]
def force_tick(self, curs, queue_name): """ Force tick into source queue so that consumer can move on faster """ q = "select pgq.force_tick(%s)" curs.execute(q, [queue_name]) res = curs.fetchone() cur_pos = res[0]
445,025
def work(self): """Syncer main function."""
def work(self): """Syncer main function."""
445,026
def work(self): """Syncer main function."""
def work(self): """Syncer main function."""
445,027
def work(self): """Syncer main function."""
def work(self): """Syncer main function."""
445,028
def work(self): """Syncer main function."""
def work(self): """Syncer main function."""
445,029
def get_load_sql(cls, pgver): """Return SQL statement for finding objects.""" return self.SQL
def get_load_sql(cls, pgver): """Return SQL statement for finding objects.""" return self.SQL
445,030
def __init__(self, args): """Replication init.""" CascadedWorker.__init__(self, 'londiste3', 'db', args)
def __init__(self, args): """Replication init.""" CascadedWorker.__init__(self, 'londiste3', 'db', args)
445,031
def process_remote_batch(self, src_db, tick_id, ev_list, dst_db): "All work for a batch. Entry point from SetConsumer."
def process_remote_batch(self, src_db, tick_id, ev_list, dst_db): "All work for a batch. Entry point from SetConsumer."
445,032
def process_remote_batch(self, src_db, tick_id, ev_list, dst_db): "All work for a batch. Entry point from SetConsumer."
def process_remote_batch(self, src_db, tick_id, ev_list, dst_db): "All work for a batch. Entry point from SetConsumer."
445,033
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,034
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,035
def handle_execute_event(self, ev, dst_curs): """handle one EXECUTE event"""
def handle_execute_event(self, ev, dst_curs): """handle one EXECUTE event"""
445,036
def handle_execute_event(self, ev, dst_curs): """handle one EXECUTE event"""
def handle_execute_event(self, ev, dst_curs): """handle one EXECUTE event"""
445,037
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,038
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,039
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,040
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,041
def dst_reset(self): self.log.info("Resetting queue tracking on dst side")
def dst_reset(self): self.log.info("Resetting queue tracking on dst side")
445,042
def parse_pgarray(array): r"""Parse Postgres array and return list of items inside it. Examples: >>> parse_pgarray('{}') [] >>> parse_pgarray('{a,b,null,"null"}') ['a', 'b', None, 'null'] >>> parse_pgarray(r'{"a,a","b\"b","c\\c"}') ['a,a', 'b"b', 'c\\c'] """ if not array or array[0] != "{" or array[-1] != '}': raise E...
def parse_pgarray(array): r"""Parse Postgres array and return list of items inside it. Examples: >>> parse_pgarray('{}') [] >>> parse_pgarray('{a,b,null,"null"}') ['a', 'b', None, 'null'] >>> parse_pgarray(r'{"a,a","b\"b","c\\c"}') ['a,a', 'b"b', 'c\\c'] >>> parse_pgarray("[0,3]={1,2,3}") ['1', '2', '3'] """ if not ar...
445,043
def get_drop_sql(self, curs): """Return SQL statement for dropping or None of not supported.""" return None
def get_drop_sql(self, curs): """Return SQL statement for dropping or None of not supported.""" return None
445,044
def get_drop_sql(self, curs): """Generate removal sql.""" fmt = "ALTER TABLE ONLY %s DROP CONSTRAINT %s;" sql = fmt % (quote_fqident(self.table_name), quote_ident(self.name)) return sql
def get_drop_sql(self, curs): """Generate removal sql.""" fmt = "ALTER TABLE ONLY %s DROP CONSTRAINT %s;" sql = fmt % (quote_fqident(self.table_name), quote_ident(self.name)) return sql
445,045
def get_create_sql(self, curs, new_table_name = None): """Generate creation SQL.""" if not new_table_name: return self.defn # fixme: seems broken name = find_new_name(curs, self.name) pnew = "INDEX %s ON %s " % (quote_ident(name), quote_fqident(new_table_name)) rx = r"\bINDEX[ ][a-z0-9._]+[ ]ON[ ][a-z0-9._]+[ ]" sql = ...
def get_create_sql(self, curs, new_table_name = None): """Generate creation SQL.""" if not new_table_name: return self.defn # fixme: seems broken name = find_new_name(curs, self.name) pnew = "INDEX %s ON %s " % (quote_ident(name), quote_fqident(new_table_name)) rx = r"\bINDEX[ ][a-z0-9._]+[ ]ON[ ][a-z0-9._]+[ ]" sql = ...
445,046
def slave_cleanup(self, last_applied): completed_wals = self.cf.get("completed_wals") partial_wals = self.cf.get("partial_wals")
def slave_cleanup(self, last_applied): completed_wals = self.cf.get("completed_wals") partial_wals = self.cf.get("partial_wals")
445,047
def cmd_add_table(self, *args): """Attach table(s) to local node."""
def cmd_add_table(self, *args): """Attach table(s) to local node."""
445,048
def cmd_add_table(self, *args): """Attach table(s) to local node."""
def cmd_add_table(self, *args): """Attach table(s) to local node."""
445,049
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
445,050
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
445,051
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
def process_sync(self, tbl, src_db, dst_db): """Actual comparision."""
445,052
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,053
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,054
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,055
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,056
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,057
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
def __init__(self, main_section, filename, sane_config = 1, user_defs = {}): """Initialize Config and read from file.
445,058
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,059
def restore_database(self): """Restore the database from backup
def restore_database(self): """Restore the database from backup
445,060
def import_options (obj, prefix=''): s = [] if obj.impl_dir () is not None: s.append (prepend_symbols ('--import-impl=', impl_import (obj, prefix))) if obj.sidl_file () is not None: s.append (prepend_symbols ('--import-sidl=', sidl_import (obj, prefix))) return ' '.join (s)
def import_options (obj, prefix=''): s = [] if obj.impl_dir () is not None: if os.path.isdir (obj.impl_dir (prefix)): s.append (prepend_symbols ('--import-impl=', impl_import (obj, prefix))) if obj.sidl_file () is not None: s.append (prepend_symbols ('--import-sidl=', sidl_import (obj, prefix))) return ' '.join (s)
445,061
def import_options (obj, prefix=''): s = [] if obj.impl_dir () is not None: s.append (prepend_symbols ('--import-impl=', impl_import (obj, prefix))) if obj.sidl_file () is not None: s.append (prepend_symbols ('--import-sidl=', sidl_import (obj, prefix))) return ' '.join (s)
def import_options (obj, prefix=''): s = [] if obj.impl_dir () is not None: s.append (prepend_symbols ('--import-impl=', impl_import (obj, prefix))) if obj.sidl_file () is not None: if os.path.isfile (obj.sidl_file (prefix)): s.append (prepend_symbols ('--import-sidl=', sidl_import (obj, prefix))) return ' '.join (s)
445,062
def __call__(self, request, *args, **kwargs): """ NB: Sends a `Vary` header so we don't cache requests that are different (OAuth stuff in `Authorization` header.) """ rm = request.method.upper()
def __call__(self, request, *args, **kwargs): """ NB: Sends a `Vary` header so we don't cache requests that are different (OAuth stuff in `Authorization` header.) """ rm = request.method.upper()
445,063
def __unicode__(self): return u"Nonce %s for %s" % (self.key, self.consumer_key)
def __unicode__(self): return u"Nonce %s for %s" % (self.key, self.consumer_key)
445,064
def generate_random_codes(self): """ Used to generate random key/secret pairings. Use this after you've added the other data in place of save().
def generate_random_codes(self): """ Used to generate random key/secret pairings. Use this after you've added the other data in place of save().
445,065
def set_callback(self, callback): if callback != "oob": # out of band, says "we can't do this!" self.callback = callback self.callback_confirmed = True self.save()
def set_callback(self, callback): if callback != "oob": # out of band, says "we can't do this!" self.callback = callback self.callback_confirmed = True self.save()
445,066
def content_type(self): """ Returns the content type of the request in all cases where it is different than a submitted form - application/x-www-form-urlencoded """ type_formencoded = "application/x-www-form-urlencoded"
def content_type(self): """ Returns the content type of the request in all cases where it is different than a submitted form - application/x-www-form-urlencoded """ type_formencoded = "application/x-www-form-urlencoded"
445,067
def _model(data, fields=()): """ Models. Will respect the `fields` and/or `exclude` on the handler (see `typemapper`.) """ ret = { } handler = self.in_typemapper(type(data), self.anonymous) get_absolute_uri = False if handler or fields: v = lambda f: getattr(data, f.attname)
def _model(data, fields=()): """ Models. Will respect the `fields` and/or `exclude` on the handler (see `typemapper`.) """ ret = { } handler = self.in_typemapper(type(data), self.anonymous) get_absolute_uri = False if handler or fields: v = lambda f: getattr(data, f.attname)
445,068
def _model(data, fields=()): """ Models. Will respect the `fields` and/or `exclude` on the handler (see `typemapper`.) """ ret = { } handler = self.in_typemapper(type(data), self.anonymous) get_absolute_uri = False
def _model(data, fields=()): """ Models. Will respect the `fields` and/or `exclude` on the handler (see `typemapper`.) """ ret = { } handler = self.in_typemapper(type(data), self.anonymous) get_absolute_uri = False
445,069
def render(self, request): cb = request.GET.get('callback') seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
def render(self, request): cb = request.GET.get('callback', None) seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
445,070
def render(self, request): cb = request.GET.get('callback') seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
def render(self, request): cb = request.GET.get('callback') seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
445,071
def error_handler(self, error, request): # if the exception is our exeption then generate a # custom response with embedded content that will be # formatted as json if isinstance(error, GoAwayError): response = rc.FORBIDDEN response.content = dict(error=dict( name=error.name, message="Get out of here and dont come back...
def error_handler(self, error, request, meth): # if the exception is our exeption then generate a # custom response with embedded content that will be # formatted as json if isinstance(error, GoAwayError): response = rc.FORBIDDEN response.content = dict(error=dict( name=error.name, message="Get out of here and dont com...
445,072
def error_handler(self, error, request): # if the exception is our exeption then generate a # custom response with embedded content that will be # formatted as json if isinstance(error, GoAwayError): response = rc.FORBIDDEN response.content = dict(error=dict( name=error.name, message="Get out of here and dont come back...
def error_handler(self, error, request): # if the exception is our exeption then generate a # custom response with embedded content that will be # formatted as json if isinstance(error, GoAwayError): response = rc.FORBIDDEN response.content = dict(error=dict( name=error.name, message="Get out of here and dont come back...
445,073
def test_create_pending(self): """ Ensure creating a pending Consumer sends proper emails """ # If it's pending we should have two messages in the outbox; one # to the consumer and one to the site admins. if len(settings.ADMINS): self.assertEquals(len(mail.outbox), 2) else: self.assertEquals(len(mail.outbox), 1)
def if not self._pre_test_email(): return test_create_pending(self): if not self._pre_test_email(): return """ if not self._pre_test_email(): return Ensure if not self._pre_test_email(): return creating if not self._pre_test_email(): return a if not self._pre_test_email(): return pending if not self._pre_te...
445,074
def test_delete_consumer(self): """ Ensure deleting a Consumer sends a cancel email """
def test_delete_consumer(self): """ Ensure deleting a Consumer sends a cancel email """
445,075
def test_delete_consumer(self): """ Ensure deleting a Consumer sends a cancel email """
deftest_delete_consumer(self):"""EnsuredeletingaConsumersendsacancelemail"""
445,076
def is_anonymous(self): return handler.is_anonymous
def is_anonymous(self): return handler.is_anonymous
445,077
def _wrap_label(self, min, max, width): mid = (min + max) / 2 self.label.set_text(self.text[:mid-6] + '…' + self.text[len(self.text)-6:]) if mid == min or self.label.get_preferred_size()[2] == width: return if self.label.get_preferred_size()[2] > width: self._wrap_label(min, mid, width) else: self._wrap_label(mid, max,...
def _wrap_label(self, min, max, width): mid = (min + max) / 2 if mid-6 < 0: self.label.set_text(self.text) return self.label.set_text('%s…%s' %(self.text[:mid-6], self.text[len(self.text)-6:])) if mid == min or self.label.get_preferred_size()[2] == width: return if self.label.get_preferred_size()[2] > width: self._wrap...
445,078
def _show_tooltip(self): if self.tooltip_actor and not self._tooltip_displayed: self._tooltip_displayed = True self.tooltip_actor.set_opacity(0) self.tooltip_actor.show() self.tooltip_pointer.set_opacity(0) self.tooltip_pointer.show() self.tooltip_show_timeline.start() if self.tooltip_duration > 0: gobject.timeout_add(...
def _show_tooltip(self): if self.tooltip_actor and not self._tooltip_displayed: self._tooltip_displayed = True self.tooltip_actor.set_opacity(0) self.tooltip_actor.show() self.tooltip_pointer.set_opacity(0) self.tooltip_pointer.show() self.tooltip_show_timeline.start() if self.tooltip_duration > 0: if self._hide_timeou...
445,079
def _hide_tooltip(self): if self.tooltip_actor and self._tooltip_displayed: self.tooltip_hide_timeline.start() gobject.timeout_add(self.animation_duration, self._hide_tooltip_finish) return False
def _hide_tooltip(self): if self.tooltip_actor and self._tooltip_displayed: self.tooltip_hide_timeline.start() if self._animation_timeout_id is not None: gobject.source_remove(self._animation_timeout_id) self._animation_timeout_id = gobject.timeout_add(self.animation_duration, self._hide_tooltip_finish) return False
445,080
def do_get_preferred_width(self, for_height): inner_height = for_height - 2*self.border preferred_width = 0 if self._horizontal is False: #find size available for resizable elements resizable_elements = list() resizable_height = inner_height for element in self.elements: if element.get('resizable', 0) != 0: if element[...
def do_get_preferred_width(self, for_height): inner_height = for_height - 2*self.border preferred_width = 0 if self._horizontal is False: #find size available for resizable elements resizable_elements = list() resizable_height = inner_height for element in self.elements: if element.get('resizable', 0) != 0: if element[...
445,081
def do_get_preferred_width(self, for_height): inner_height = for_height - 2*self.border preferred_width = 0 if self._horizontal is False: #find size available for resizable elements resizable_elements = list() resizable_height = inner_height for element in self.elements: if element.get('resizable', 0) != 0: if element[...
def do_get_preferred_width(self, for_height): inner_height = for_height - 2*self.border preferred_width = 0 if self._horizontal is False: #find size available for resizable elements resizable_elements = list() resizable_height = inner_height for element in self.elements: if element.get('resizable', 0) != 0: if element[...
445,082
def do_get_preferred_height(self, for_width): inner_width = for_width - 2*self.border preferred_height = 0 if self._horizontal is True: #find size available for resizable elements resizable_elements = list() resizable_width = inner_width for element in self.elements: if element.get('resizable', 0) != 0: if element['res...
def do_get_preferred_height(self, for_width): inner_width = for_width - 2*self.border preferred_height = 0 if self._horizontal is True: #find size available for resizable elements resizable_elements = list() resizable_width = inner_width for element in self.elements: if element.get('resizable', 0) != 0: if element['res...
445,083
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
445,084
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
445,085
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
445,086
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
def do_allocate(self, box, flags): main_width = box.x2 - box.x1 main_height = box.y2 - box.y1 inner_width = main_width - 2*self.border inner_height = main_height - 2*self.border #find size available for resizable elements resizable_elements = list() resizable_width = inner_width resizable_height = inner_height for ele...
445,087
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
445,088
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
445,089
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
445,090
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
def do_pick(self, color): if self.pick_enabled: self.do_paint() else: clutter.Actor.do_pick(self, color)
445,091
def __init__(self, title=None, title_actor=None, content_actor=None, padding=10, title_padding=None, spacing=10, textures_package=None): clutter.Actor.__init__(self) self.padding = padding self.spacing = spacing self._highlighted = False self._highlight_color = clutter.color_from_string('#ffffff44') self._disabled = F...
def __init__(self, title=None, title_actor=None, content_actor=None, padding=10, title_padding=None, spacing=10, textures_package=None): clutter.Actor.__init__(self) self.padding = padding self.spacing = spacing self._highlighted = False self._highlight_color = clutter.color_from_string('#ffffff44') self._disabled = F...
445,092
def __init__(self, title=None, title_actor=None, content_actor=None, padding=10, title_padding=None, spacing=10, textures_package=None): clutter.Actor.__init__(self) self.padding = padding self.spacing = spacing self._highlighted = False self._highlight_color = clutter.color_from_string('#ffffff44') self._disabled = F...
def __init__(self, title=None, title_actor=None, content_actor=None, padding=10, title_padding=None, spacing=10, textures_package=None): clutter.Actor.__init__(self) self.padding = padding self.spacing = spacing self._highlighted = False self._highlight_color = clutter.color_from_string('#ffffff44') self._disabled = F...
445,093
def set_title(self, title): self.default_title_actor.set_text(title) self.queue_relayout()
def set_title(self, title): self.title_text = title self.check_title() if self.title_text is not None: self.default_title_actor.set_text(title) self.queue_relayout()
445,094
def get_title(self): return self.default_title_actor.get_text(title)
def get_title(self): return self.title_text
445,095
def do_get_preferred_width(self, for_height): if self.title_actor: max_width = self.title_actor.get_preferred_width(for_height)[1] else: max_width = self.default_title_actor.get_preferred_width(for_height)[1] if self.content_actor: max_width = max(max_width, self.content_actor.get_preferred_width(for_height)[1]) prefer...
def do_get_preferred_width(self, for_height): if self.title_actor: max_width = self.title_actor.get_preferred_width(for_height)[1] elif self._has_title: max_width = self.default_title_actor.get_preferred_width(for_height)[1] if self.content_actor: max_width = max(max_width, self.content_actor.get_preferred_width(for_he...
445,096
def do_get_preferred_height(self, for_width): preferred_height = 2*self.padding if self.title_actor: preferred_height += self.title_actor.get_preferred_height(for_width)[1] else: preferred_height += self.default_title_actor.get_preferred_height(for_width)[1] if self.content_actor: preferred_height += self.spacing + sel...
def do_get_preferred_height(self, for_width): preferred_height = 2*self.padding if self.title_actor: preferred_height += self.title_actor.get_preferred_height(for_width)[1] if self.content_actor: preferred_height += self.spacing elif self._has_title: preferred_height += self.default_title_actor.get_preferred_height(for...
445,097
def do_get_preferred_height(self, for_width): preferred_height = 2*self.padding if self.title_actor: preferred_height += self.title_actor.get_preferred_height(for_width)[1] else: preferred_height += self.default_title_actor.get_preferred_height(for_width)[1] if self.content_actor: preferred_height += self.spacing + sel...
def do_get_preferred_height(self, for_width): preferred_height = 2*self.padding if self.title_actor: preferred_height += self.title_actor.get_preferred_height(for_width)[1] else: preferred_height += self.default_title_actor.get_preferred_height(for_width)[1] if self.content_actor: preferred_height += self.spacing if se...
445,098
def do_destroy(self): self.unparent() if hasattr(self, 'scrollbar_background'): if self.scrollbar_background is not None: self.scrollbar_background.unparent() self.scrollbar_background.destroy() self.scrollbar_background = None if hasattr(self, 'label'): if self.label is not None: self.label.unparent() self.label.destr...
def do_destroy(self): self.unparent() if hasattr(self, 'scrollbar_background'): if self.scrollbar_background is not None: self.scrollbar_background.unparent() self.scrollbar_background.destroy() self.scrollbar_background = None if hasattr(self, 'label'): if self.label is not None: self.label.unparent() self.label.destr...
445,099