rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
(id, type.encode('utf-8'), datetime2epoch(time), datetime2epoch(changetime), component.encode('utf-8'), severity.encode('utf-8'), priority.encode('utf-8'), owner, reporter, cc, version, milestone.encode('utf-8'), status.lower(), resolution, summary.encode('utf-8'), desc,
(id, type, datetime2epoch(time), datetime2epoch(changetime), component, severity, priority, owner, reporter, cc, version, milestone, status.lower(), resolution, summary, desc,
def addTicket(self, id, time, changetime, component, severity, priority, owner, reporter, cc, version, milestone, status, resolution, summary, description, keywords, customfields): c = self.db().cursor()
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
(ticket_id, field_name.encode('utf-8'), field_value.encode('utf-8')))
(ticket_id, field_name, field_value))
def addTicketCustomField(self, ticket_id, field_name, field_value): c = self.db().cursor()
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
comment = value.encode('utf-8')
comment = value
def addTicketComment(self, ticket, time, author, value): comment = value.encode('utf-8')
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
oldvalue.encode('utf-8'), newvalue.encode('utf-8')))
oldvalue, newvalue))
def addTicketChange(self, ticket, time, author, field, oldvalue, newvalue): c = self.db().cursor()
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
description = a['description'].encode('utf-8')
description = a['description']
def addAttachment(self, author, a): if a['filename'] != '': description = a['description'].encode('utf-8') id = a['bug_id'] filename = a['filename'].encode('utf-8') filedata = StringIO.StringIO(a['thedata']) filesize = len(filedata.getvalue()) time = a['creation_ts'] print " ->inserting attachment '%s' for ticket %s...
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
filename = a['filename'].encode('utf-8')
filename = a['filename']
def addAttachment(self, author, a): if a['filename'] != '': description = a['description'].encode('utf-8') id = a['bug_id'] filename = a['filename'].encode('utf-8') filedata = StringIO.StringIO(a['thedata']) filesize = len(filedata.getvalue()) time = a['creation_ts'] print " ->inserting attachment '%s' for ticket %s...
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
cursorclass=MySQLdb.cursors.DictCursor)
cursorclass=MySQLdb.cursors.DictCursor, charset='utf8')
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bug...
dcac9900ef68be5a1bfa423276a595d98b1050eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcac9900ef68be5a1bfa423276a595d98b1050eb/bugzilla2trac.py
if operation == 'del_owner':
elif operation == 'del_owner':
def get_ticket_changes(self, req, ticket, action): this_action = self.actions[action]
0600386ec45e4cfc957ab885eacaac0c9098a2fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/0600386ec45e4cfc957ab885eacaac0c9098a2fb/default_workflow.py
if operation == 'del_resolution':
elif operation == 'del_resolution':
def get_ticket_changes(self, req, ticket, action): this_action = self.actions[action]
0600386ec45e4cfc957ab885eacaac0c9098a2fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/0600386ec45e4cfc957ab885eacaac0c9098a2fb/default_workflow.py
old_changeset = None
old_cset = None
def sync_changeset(self, rev): cset = self.repos.get_changeset(rev) db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT time,author,message FROM revision " "WHERE repos=%s AND rev=%s", (self.id, str(cset.rev))) old_changeset = None for time, author, message in cursor: date = datetime.fromtimestamp(ti...
9cc54410e7f3860e94f61798015724abb62b497b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/9cc54410e7f3860e94f61798015724abb62b497b/cache.py
old_changeset = Changeset(cset.rev, message, author, date)
old_cset = Changeset(self.repos, cset.rev, message, author, date)
def sync_changeset(self, rev): cset = self.repos.get_changeset(rev) db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT time,author,message FROM revision " "WHERE repos=%s AND rev=%s", (self.id, str(cset.rev))) old_changeset = None for time, author, message in cursor: date = datetime.fromtimestamp(ti...
9cc54410e7f3860e94f61798015724abb62b497b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/9cc54410e7f3860e94f61798015724abb62b497b/cache.py
return old_changeset
return old_cset
def sync_changeset(self, rev): cset = self.repos.get_changeset(rev) db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT time,author,message FROM revision " "WHERE repos=%s AND rev=%s", (self.id, str(cset.rev))) old_changeset = None for time, author, message in cursor: date = datetime.fromtimestamp(ti...
9cc54410e7f3860e94f61798015724abb62b497b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/9cc54410e7f3860e94f61798015724abb62b497b/cache.py
with self.env.db_transaction as db:
with self.env.db_query as db:
def get(self, id, retriever, instance): """Get cached or fresh data for the given id.""" # Get cache metadata local_meta = self._local.meta local_cache = self._local.cache if local_meta is None: # First cache usage in this request, retrieve cache metadata # from the database and make a thread-local copy of the cache me...
e0f72a327aa21f9341b94c5121620551a26af6a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/e0f72a327aa21f9341b94c5121620551a26af6a1/cache.py
self._cache.pop(id, None) try: del self._local.cache[id] except (KeyError, TypeError): pass
self._cache.pop(id, None) try: del self._local.cache[id] except (KeyError, TypeError): pass
def invalidate(self, id): """Invalidate cached data for the given id.""" with self.env.db_transaction as db: with self._lock: # Invalidate in other processes
e0f72a327aa21f9341b94c5121620551a26af6a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/e0f72a327aa21f9341b94c5121620551a26af6a1/cache.py
"ticket exception_to_unicode(e))
"ticket exception_to_unicode(e))
def _notify(self, ticket, date): """Send a ticket update notification.""" if not self.notify: return try: tn = TicketNotifyEmail(self.env) tn.notify(ticket, newticket=False, modtime=date) except Exception, e: self.log.error("Failure sending notification on change to " "ticket #%s: %s", ticket.id, exception_to_unicode(e...
5fb76b79a41446a40c3de96a7b43cb5ee2416bed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/5fb76b79a41446a40c3de96a7b43cb5ee2416bed/commit_updater.py
if BZ_VERSION >= 2167:
if BZ_VERSION >= 2164:
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bug...
e1a567e5f0ccf05af8d157ff2d36b2fd28c42f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/e1a567e5f0ccf05af8d157ff2d36b2fd28c42f0c/bugzilla2trac.py
showall = req.args.get('show') == 'all'
show = req.args.getlist('show') if 'all' in show: show = ['completed']
def process_request(self, req): req.perm.require('MILESTONE_VIEW')
b7e4ab790e9735bcc5ab699114662cc9c0f7927f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b7e4ab790e9735bcc5ab699114662cc9c0f7927f/roadmap.py
milestones = [m for m in Milestone.select(self.env, showall, db)
milestones = Milestone.select(self.env, 'completed' in show, db) if 'noduedate' in show: milestones = [m for m in milestones if m.due is not None or m.completed] milestones = [m for m in milestones
def process_request(self, req): req.perm.require('MILESTONE_VIEW')
b7e4ab790e9735bcc5ab699114662cc9c0f7927f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b7e4ab790e9735bcc5ab699114662cc9c0f7927f/roadmap.py
icshref = req.href.roadmap(show=req.args.get('show'), user=username, format='ics')
icshref = req.href.roadmap(show=show, user=username, format='ics')
def process_request(self, req): req.perm.require('MILESTONE_VIEW')
b7e4ab790e9735bcc5ab699114662cc9c0f7927f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b7e4ab790e9735bcc5ab699114662cc9c0f7927f/roadmap.py
'showall': showall,
'show': show,
def process_request(self, req): req.perm.require('MILESTONE_VIEW')
b7e4ab790e9735bcc5ab699114662cc9c0f7927f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b7e4ab790e9735bcc5ab699114662cc9c0f7927f/roadmap.py
def write_utctime(name, value, params={}): write_prop(name, format_datetime(value, '%Y%m%dT%H%M%SZ', utc), params)
b7e4ab790e9735bcc5ab699114662cc9c0f7927f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b7e4ab790e9735bcc5ab699114662cc9c0f7927f/roadmap.py
etree.parse(StringIO(page), base_url=b.get_url())
url = b.get_url() if isinstance(url, str): url = unicode(url, 'latin1') etree.parse(StringIO(page), base_url=url)
def _validate_xhtml(func_name, *args, **kwargs): page = b.get_html() if "xhtml1-strict.dtd" not in page: return etree.clear_error_log() try: etree.parse(StringIO(page), base_url=b.get_url()) except etree.XMLSyntaxError, e: raise twill.errors.TwillAssertionError( _format_error_log(page, e.error_log))
9d7cb5221dd9fda9c8c354330e3b297e919787d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/9d7cb5221dd9fda9c8c354330e3b297e919787d1/better_twill.py
'been removed.', fields=label[0]))
'been removed.', field=label[0]))
def do_remove(db): for name in sel: enum = self._enum_cls(self.env, name, db=db) enum.delete()
3b4bc8094275e2555c18cfc1cf60feb25be27a2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/3b4bc8094275e2555c18cfc1cf60feb25be27a2b/admin.py
self._send_csv(req, ['report', 'title'], rows, mimetype='text/csv',
self._send_csv(req, ['report', 'title', 'description'], rows, mimetype='text/csv',
def _render_list(self, req): """Render the list of available reports.""" sort = req.args.get('sort', 'report') asc = bool(int(req.args.get('asc', 1))) format = req.args.get('format') rows = self.env.db_query(""" SELECT id, title, description FROM report ORDER BY %s %s """ % ('title' if sort == 'title' else 'id', '' if...
7fc63f101b0e09c3810c48287506c60b90f896d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/7fc63f101b0e09c3810c48287506c60b90f896d0/report.py
self._send_csv(req, ['report', 'title'], rows, '\t', mimetype='text/tab-separated-values',
self._send_csv(req, ['report', 'title', 'description'], rows, '\t', mimetype='text/tab-separated-values',
def _render_list(self, req): """Render the list of available reports.""" sort = req.args.get('sort', 'report') asc = bool(int(req.args.get('asc', 1))) format = req.args.get('format') rows = self.env.db_query(""" SELECT id, title, description FROM report ORDER BY %s %s """ % ('title' if sort == 'title' else 'id', '' if...
7fc63f101b0e09c3810c48287506c60b90f896d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/7fc63f101b0e09c3810c48287506c60b90f896d0/report.py
milestones = [m for m in milestones if 'MILESTONE_VIEW' in req.perm(m.resource)]
if req: milestones = [m for m in milestones if 'MILESTONE_VIEW' in req.perm(m.resource)]
def template_data(self, context, tickets, orig_list=None, orig_time=None, req=None): clauses = [] for clause in self.constraints: constraints = {} for k, v in clause.items(): constraint = {'values': [], 'mode': ''} for val in v: neg = val.startswith('!') if neg: val = val[1:] mode = '' if val[:1] in ('~', '^', '$') \ a...
cb4a777662f2a5e7e2f833a891854cd008ff342d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/cb4a777662f2a5e7e2f833a891854cd008ff342d/query.py
def id_is_valid(num): return 0 < int(num) <= 1L << 31
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def get_value_or_default(self, name): """Return the value of a field or the default value if it is undefined """ try: value = self.values[name] if value is not empty: return value field = [field for field in self.fields if field['name'] == name] if field: return field[0].get('value', '') except KeyError: pass
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, when=None, db=None): """Add ticket to database. The `db` argument is deprecated in favor of `with_transaction()`. """ assert not self.exists, 'Cannot insert an existing ticket'
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, when=None, db=None): """Add ticket to database. The `db` argument is deprecated in favor of `with_transaction()`. """ assert not self.exists, 'Cannot insert an existing ticket'
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def save_changes(self, author=None, comment=None, when=None, db=None, cnum=''): """ Store ticket changes in the database. The ticket must already exist in the database. Returns False if there were no changes to save, True otherwise. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exi...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_save(db): cursor = db.cursor()
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_save(db): cursor = db.cursor()
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
FROM ticket_change WHERE ticket=%s
FROM ticket_change WHERE ticket=%s
def get_changelog(self, when=None, db=None): """Return the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue, permanent).
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def delete(self, db=None): """Delete the ticket. The `db` argument is deprecated in favor of `with_transaction()`. """ @self.env.with_transaction(db) def do_delete(db): Attachment.delete_all(self.env, 'ticket', self.id, db) cursor = db.cursor() cursor.execute("DELETE FROM ticket WHERE id=%s", (self.id,)) cursor.execut...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_delete(db): cursor = db.cursor() row = self._find_change(cnum, db) if not row: return ts = row[0] custom_fields = set(f['name'] for f in self.fields if f.get('custom'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_delete(db): cursor = db.cursor() row = self._find_change(cnum, db) if not row: return ts = row[0] custom_fields = set(f['name'] for f in self.fields if f.get('custom'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_delete(db): cursor = db.cursor() row = self._find_change(cnum, db) if not row: return ts = row[0] custom_fields = set(f['name'] for f in self.fields if f.get('custom'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_delete(db): cursor = db.cursor() row = self._find_change(cnum, db) if not row: return ts = row[0] custom_fields = set(f['name'] for f in self.fields if f.get('custom'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def do_modify(db): cursor = db.cursor() # Find the current value of the comment cursor.execute(""" SELECT newvalue FROM ticket_change WHERE ticket=%s AND time=%s AND field='comment' """, (self.id, ts)) old_comment = False for old_comment, in cursor: break if comment == (old_comment or ''): return # Comment history is ...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def _find_change(self, cnum, db): """Find a comment by its number.""" scnum = str(cnum) cursor = db.cursor() cursor.execute(""" SELECT time,author,newvalue FROM ticket_change WHERE ticket=%%s AND field='comment' AND (oldvalue=%%s OR oldvalue %s) """ % db.like(), (self.id, scnum, '%' + db.like_escape('.' + scnum))) for ...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def _find_change(self, cnum, db): """Find a comment by its number.""" scnum = str(cnum) cursor = db.cursor() cursor.execute(""" SELECT time,author,newvalue FROM ticket_change WHERE ticket=%%s AND field='comment' AND (oldvalue=%%s OR oldvalue %s) """ % db.like(), (self.id, scnum, '%' + db.like_escape('.' + scnum))) for ...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def _find_change(self, cnum, db): """Find a comment by its number.""" scnum = str(cnum) cursor = db.cursor() cursor.execute(""" SELECT time,author,newvalue FROM ticket_change WHERE ticket=%%s AND field='comment' AND (oldvalue=%%s OR oldvalue %s) """ % db.like(), (self.id, scnum, '%' + db.like_escape('.' + scnum))) for ...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def delete(self, db=None): """Delete the enum value. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot delete non-existent %s' % self.type
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, db=None): """Add a new enum value. The `db` argument is deprecated in favor of `with_transaction()`. """ assert not self.exists, 'Cannot insert existing %s' % self.type self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid %(type)s name.', type=self.type))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def update(self, db=None): """Update the enum value. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot update non-existent %s' % self.type self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid %(type)s name.', type=self.type))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def select(cls, env, db=None): for state in TicketSystem(env).get_all_status(): status = cls(env) status.name = state yield status
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def delete(self, db=None): """Delete the component. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot delete non-existent component'
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, db=None): """Insert a new component. The `db` argument is deprecated in favor of `with_transaction()`. """ assert not self.exists, 'Cannot insert existing component' self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid component name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def update(self, db=None): """Update the component. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot update non-existent component' self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid component name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def select(cls, env, db=None): if not db: db = env.get_read_db() cursor = db.cursor() cursor.execute(""" SELECT name,owner,description FROM component ORDER BY name """) for name, owner, description in cursor: component = cls(env) component.name = component._old_name = name component.owner = owner or None component.desc...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def delete(self, retarget_to=None, author=None, db=None): """Delete the milestone. The `db` argument is deprecated in favor of `with_transaction()`. """ @self.env.with_transaction(db) def do_delete(db): cursor = db.cursor() self.env.log.info('Deleting milestone %s' % self.name) cursor.execute("DELETE FROM milestone WH...
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, db=None): """Insert a new milestone. The `db` argument is deprecated in favor of `with_transaction()`. """ self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid milestone name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def update(self, db=None): """Update the milestone. The `db` argument is deprecated in favor of `with_transaction()`. """ self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid milestone name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def category(m): return m.is_completed and 1 or m.due and 2 or 3
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def delete(self, db=None): """Delete the version. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot delete non-existent version'
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def insert(self, db=None): """Insert a new version. The `db` argument is deprecated in favor of `with_transaction()`. """ assert not self.exists, 'Cannot insert existing version' self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid version name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def update(self, db=None): """Update the version. The `db` argument is deprecated in favor of `with_transaction()`. """ assert self.exists, 'Cannot update non-existent version' self.name = simplify_whitespace(self.name) if not self.name: raise TracError(_('Invalid version name.'))
b66f6ba851d504957ad915a50b5908946a0e2177 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/b66f6ba851d504957ad915a50b5908946a0e2177/model.py
def get_admin_commands(self): yield ('config get', '<section> <option>', 'Get the value of the given option in "trac.ini"', self._complete_config, self._do_get) yield ('config remove', '<section> <option>', 'Remove the specified option from "trac.ini"', self._complete_config, self._do_remove) yield ('config set', '<sec...
902b3ca387620f63b3e97d27383cd1ba023d60b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/902b3ca387620f63b3e97d27383cd1ba023d60b4/config.py
def _do_get(self, section, option): printout(self.config.get(section, option))
902b3ca387620f63b3e97d27383cd1ba023d60b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/902b3ca387620f63b3e97d27383cd1ba023d60b4/config.py
def test_resource_doesnt_exists(self):
def test_resource_doesnt_exist(self):
def test_resource_doesnt_exists(self): r = Resource('wiki', 'WikiStart').child('attachment', 'file.txt') self.assertEqual(False, AttachmentModule(self.env).resource_exists(r))
fef2a15f3bb235344dba8bd689663115917b693b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/fef2a15f3bb235344dba8bd689663115917b693b/attachment.py
def test_resource_doesnt_exists(self):
def test_resource_exists(self):
def test_resource_doesnt_exists(self): att = Attachment(self.env, 'wiki', 'WikiStart') att.insert('file.txt', StringIO(''), 1) self.assertTrue(resource_exists(self.env, att.resource))
fef2a15f3bb235344dba8bd689663115917b693b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/fef2a15f3bb235344dba8bd689663115917b693b/attachment.py
def test_resource_doesnt_exists(self): att = Attachment(self.env, 'wiki', 'WikiStart') att.insert('file.txt', StringIO(''), 1) self.assertTrue(resource_exists(self.env, att.resource))
fef2a15f3bb235344dba8bd689663115917b693b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/fef2a15f3bb235344dba8bd689663115917b693b/attachment.py
if not line.startswith('Index: ') and line != '='*67:
if not line.startswith('Index: ') and line != '=' * 67:
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
ba5f558a2c2171fc495016ed4c78458928c8f528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ba5f558a2c2171fc495016ed4c78458928c8f528/patch.py
line = lines.next() while line and line != '': line = lines.next() comments.append(line)
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
ba5f558a2c2171fc495016ed4c78458928c8f528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ba5f558a2c2171fc495016ed4c78458928c8f528/patch.py
index_line = comments[1] oldrev, newrev = index_line.split()[-1].split('..') oldinfo = ['', oldpath, oldrev] newinfo = ['', newpath, newrev]
if any(c.startswith('new file') for c in comments): oldpath = '/dev/null' if any(c.startswith('deleted file') for c in comments): newpath = '/dev/null' oldinfo = ['', oldpath] newinfo = ['', newpath] index = [c for c in comments if c.startswith('index ')] if index: oldrev, newrev = index[0].split()[-1].split('..') oldi...
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
ba5f558a2c2171fc495016ed4c78458928c8f528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ba5f558a2c2171fc495016ed4c78458928c8f528/patch.py
self.log.debug('expected +++ after ---, got '+line)
self.log.debug('expected +++ after ---, got ' + line)
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
ba5f558a2c2171fc495016ed4c78458928c8f528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ba5f558a2c2171fc495016ed4c78458928c8f528/patch.py
precisedate = parse_date(req.args.get('from'), req.tz) fromdate = precisedate
reqfromdate = req.args['from'].strip() if reqfromdate: precisedate = parse_date(reqfromdate, req.tz) fromdate = precisedate
def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW')
3a8b7fb5c90ae2a6ed84a1984a8d460dc6c3f112 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/3a8b7fb5c90ae2a6ed84a1984a8d460dc6c3f112/web_ui.py
return _('%(kind)s %(id)%(at_version)s%(in_repo)s',
return _('%(kind)s %(id)s%(at_version)s%(in_repo)s',
def get_resource_description(self, resource, format=None, **kwargs): if resource.realm == 'changeset': reponame, id = resource.parent.id, resource.id if reponame: return _("Changeset %(rev)s in %(repo)s", rev=id, repo=reponame) else: return _("Changeset %(rev)s", rev=id) elif resource.realm == 'source': reponame, id = ...
6c2b99113960e4b9b985214cc1b54dc10e4c9b4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6c2b99113960e4b9b985214cc1b54dc10e4c9b4e/api.py
if len(f['label']) > width[idx]: width[idx] = len(f['label']) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval)
width[idx] = max(len(f['label']), width[idx]) width[idx + 1] = max(len(fval), width[idx + 1])
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc', 'time', 'changetime')] width = [0, 0, 0, 0] i = 0 for f in fields: if f['type'] == 'textarea': continue fname = f['name'] if not fname in tkt.values: continue fval = tkt[fname] or '' if fval.find('\n') != -1:...
bff8c5a056815ae3b4a070b4bcfba39b4915ebf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/bff8c5a056815ae3b4a070b4bcfba39b4915ebf5/notification.py
format = (u'%%%is: %%-%is | ' % (width[0], width[1]), u' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) l = (width[0] + width[1] + 5) sep = l * '-' + '+' + (self.COLS - l) * '-'
width_l = width[0] + width[1] + 5 width_r = width[2] + width[3] + 5 half_cols = (self.COLS - 1) / 2 if width_l + width_r + 1 > self.COLS: if ((width_l > half_cols and width_r > half_cols) or (width[0] > half_cols / 2 or width[2] > half_cols / 2)): width_l = half_cols width_r = half_cols elif width_l > width_r: width_l ...
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc', 'time', 'changetime')] width = [0, 0, 0, 0] i = 0 for f in fields: if f['type'] == 'textarea': continue fname = f['name'] if not fname in tkt.values: continue fval = tkt[fname] or '' if fval.find('\n') != -1:...
bff8c5a056815ae3b4a070b4bcfba39b4915ebf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/bff8c5a056815ae3b4a070b4bcfba39b4915ebf5/notification.py
txt += format[i % 2] % (f['label'], unicode(fval))
str_tmp = u'%s: %s' % (f['label'], unicode(fval)) idx = i % 2 cell_tmp[idx] += wrap(str_tmp, width_lr[idx] - 2 + 2 * idx, (width[2 * idx] - len(f['label']) + 2 * idx) * ' ', 2 * ' ', CRLF) cell_tmp[idx] += CRLF
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc', 'time', 'changetime')] width = [0, 0, 0, 0] i = 0 for f in fields: if f['type'] == 'textarea': continue fname = f['name'] if not fname in tkt.values: continue fval = tkt[fname] or '' if fval.find('\n') != -1:...
bff8c5a056815ae3b4a070b4bcfba39b4915ebf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/bff8c5a056815ae3b4a070b4bcfba39b4915ebf5/notification.py
if i % 2: txt += CRLF
cell_l = cell_tmp[0].splitlines() cell_r = cell_tmp[1].splitlines() format = u'%%-%is|%%s%%s' % width_l for i in range(max(len(cell_l), len(cell_r))): if i >= len(cell_l): cell_l.append(width_l * ' ') elif i >= len(cell_r): cell_r.append('') txt += format % (cell_l[i], cell_r[i], CRLF)
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc', 'time', 'changetime')] width = [0, 0, 0, 0] i = 0 for f in fields: if f['type'] == 'textarea': continue fname = f['name'] if not fname in tkt.values: continue fval = tkt[fname] or '' if fval.find('\n') != -1:...
bff8c5a056815ae3b4a070b4bcfba39b4915ebf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/bff8c5a056815ae3b4a070b4bcfba39b4915ebf5/notification.py
text = cursor.fetchone()[0]
for text, in cursor: break else: raise AdminCommandError(_("Page '%(page)s' not found", page=page))
def export_page(self, page, filename, cursor=None): if cursor is None: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT text FROM wiki WHERE name=%s " "ORDER BY version DESC LIMIT 1", (page,)) text = cursor.fetchone()[0] if not filename: printout(text) else: if os.path.isfile(filename): raise Admi...
f6010748792a117380102558d71db65a27e89e06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/f6010748792a117380102558d71db65a27e89e06/admin.py
'application/rtf',
'application/msword,application/rtf,',
def reset(self): if self.content is not None: self.content.seek(0)
6419b4f38cc6d1a0cf4c74766d2bd6f8aabfcf57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6419b4f38cc6d1a0cf4c74766d2bd6f8aabfcf57/api.py
cursor.execute("SELECT last_visit FROM session " "WHERE sid=%s AND authenticated=%s", (sid, int(authenticated)))
cursor.execute(""" SELECT last_visit FROM session WHERE sid=%s AND authenticated=%s """, (sid, int(authenticated)))
def get_session(self, sid, authenticated=False): self.env.log.debug('Retrieving session for ID %r', sid)
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("SELECT name,value FROM session_attribute " "WHERE sid=%s and authenticated=%s", (sid, int(authenticated)))
cursor.execute(""" SELECT name,value FROM session_attribute WHERE sid=%s and authenticated=%s """, (sid, int(authenticated)))
def get_session(self, sid, authenticated=False): self.env.log.debug('Retrieving session for ID %r', sid)
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%s,%s)", (self.sid, self.last_visit, authenticated))
cursor.execute(""" INSERT INTO session (sid,last_visit,authenticated) VALUES (%s,%s,%s) """, (self.sid, self.last_visit, authenticated))
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute WHERE sid=%s", (self.sid,))
cursor.execute(""" DELETE FROM session_attribute WHERE sid=%s """, (self.sid,))
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.executemany("INSERT INTO session_attribute " " (sid,authenticated,name,value) " " VALUES (%s,%s,%s,%s)", attrs)
cursor.executemany(""" INSERT INTO session_attribute (sid,authenticated,name,value) VALUES (%s,%s,%s,%s) """, attrs)
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session " "WHERE sid=%s AND authenticated=0", (self.sid,))
cursor.execute(""" DELETE FROM session WHERE sid=%s AND authenticated=0 """, (self.sid,))
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute('UPDATE session SET last_visit=%s ' 'WHERE sid=%s AND authenticated=%s', (self.last_visit, self.sid, authenticated))
cursor.execute(""" UPDATE session SET last_visit=%s WHERE sid=%s AND authenticated=%s """, (self.last_visit, self.sid, authenticated))
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute " "WHERE authenticated=0 AND sid " "IN (SELECT sid FROM session WHERE " "authenticated=0 AND last_visit < %s)", (mintime,)) cursor.execute("DELETE FROM session WHERE " "authenticated=0 AND last_visit < %s", (mintime,))
cursor.execute(""" DELETE FROM session_attribute WHERE authenticated=0 AND sid IN ( SELECT sid FROM session WHERE authenticated=0 AND last_visit < %s ) """, (mintime,)) cursor.execute(""" DELETE FROM session WHERE authenticated=0 AND last_visit < %s """, (mintime,))
def delete_session_cookie(db): cursor = db.cursor() if self._new: self.last_visit = now self._new = False # The session might already exist even if _new is True since # it could have been created by a concurrent request (#3563). try: cursor.execute("INSERT INTO session " " (sid,last_visit,authenticated)" " VALUES (%s,%...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
def get_session(self, sid, authenticated=False): refresh_cookie = False
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
raise TracError(Markup('Session "%s" already exists.<br />' 'Please choose a different session ID.') % new_sid, 'Error renaming session') self.env.log.debug('Changing session ID %s to %s', self.sid, new_sid) cursor.execute("UPDATE session SET sid=%s WHERE sid=%s " "AND authenticated=0", (new_sid, self.sid)) cursor.exe...
raise TracError(Markup( _("Session '%(id)s' already exists.<br />" "Please choose a different session ID.", id=new_sid), _("Error renaming session"))) self.env.log.debug('Changing session ID %s to %s', self.sid, new_sid) cursor.execute(""" UPDATE session SET sid=%s WHERE sid=%s AND authenticated=0 """, (new_sid, self.s...
def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT sid FROM session WHERE sid=%s", (new_sid,)) if cursor.fetchone(): raise TracError(Markup('Session "%s" already exists.<br />' 'Please choose a different session ID.') % new_sid, 'Error renaming session') self.env.log.debug('Changing session ID %s to...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname))
cursor.execute(""" SELECT authenticated FROM session WHERE sid=%s OR sid=%s """, (sid, self.req.authname))
def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname)) authenticated_flags = [row[0] for row in cursor.fetchall()] if len(authenticated_flags) == 2: # There's already an authenticated session for the user, # we simply del...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session WHERE sid=%s " "AND authenticated=0", (sid,)) cursor.execute("DELETE FROM session_attribute WHERE sid=%s " "AND authenticated=0", (sid,))
cursor.execute(""" DELETE FROM session WHERE sid=%s AND authenticated=0 """, (sid,)) cursor.execute(""" DELETE FROM session_attribute WHERE sid=%s AND authenticated=0 """, (sid,))
def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname)) authenticated_flags = [row[0] for row in cursor.fetchall()] if len(authenticated_flags) == 2: # There's already an authenticated session for the user, # we simply del...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("UPDATE session SET sid=%s,authenticated=1 " "WHERE sid=%s AND authenticated=0", (self.req.authname, sid)) cursor.execute("UPDATE session_attribute " "SET sid=%s,authenticated=1 WHERE sid=%s", (self.req.authname, sid))
cursor.execute(""" UPDATE session SET sid=%s,authenticated=1 WHERE sid=%s AND authenticated=0 """, (self.req.authname, sid)) cursor.execute(""" UPDATE session_attribute SET sid=%s,authenticated=1 WHERE sid=%s """, (self.req.authname, sid))
def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname)) authenticated_flags = [row[0] for row in cursor.fetchall()] if len(authenticated_flags) == 2: # There's already an authenticated session for the user, # we simply del...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("INSERT INTO session " "(sid,last_visit,authenticated)" " VALUES(%s,%s,1)", (self.req.authname, int(time.time())))
cursor.execute(""" INSERT INTO session (sid,last_visit,authenticated) VALUES (%s,%s,1) """, (self.req.authname, int(time.time())))
def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname)) authenticated_flags = [row[0] for row in cursor.fetchall()] if len(authenticated_flags) == 2: # There's already an authenticated session for the user, # we simply del...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
raise AdminCommandError(_('Session alread exists. Unable to add ' 'a duplicate session.'))
raise AdminCommandError(_("Session alread exists. Unable to add " "a duplicate session."))
def _do_add(self, sid, *args): if list(self._get_list(sid)): raise AdminCommandError(_('Session alread exists. Unable to add ' 'a duplicate session.')) self._add_session(sid, *args)
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
raise AdminCommandError(_('Unable to set session attribute on a ' 'non-existent SID'))
raise AdminCommandError(_("Unable to set session attribute on a " "non-existent SID"))
def _do_set(self, attr, sid, val): exists = [r for r in self._get_list(sid)] if not exists: raise AdminCommandError(_('Unable to set session attribute on a ' 'non-existent SID')) self._set_attr(sid, attr, val)
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'name', %s)", (sid, name))
cursor.execute(""" INSERT INTO session_attribute VALUES (%s, 1, 'name', %s) """, (sid, name))
def add_session(db): cursor = db.cursor() cursor.execute("INSERT INTO session VALUES (%s, 1, %s)", (sid, time.time())) if name is not None: cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'name', %s)", (sid, name)) if email is not None: cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'em...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'email', %s)", (sid, email))
cursor.execute(""" INSERT INTO session_attribute VALUES (%s, 1, 'email', %s) """, (sid, email))
def add_session(db): cursor = db.cursor() cursor.execute("INSERT INTO session VALUES (%s, 1, %s)", (sid, time.time())) if name is not None: cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'name', %s)", (sid, name)) if email is not None: cursor.execute("INSERT INTO session_attribute VALUES " "(%s, 1, 'em...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("SELECT authenticated FROM session WHERE " "sid = %s", (sid,))
cursor.execute(""" SELECT authenticated FROM session WHERE sid = %s """, (sid,))
def set_attr(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session WHERE " "sid = %s", (sid,)) for authenticated, in cursor: cursor.execute(""" SELECT name, value FROM session_attribute WHERE sid = %s AND authenticated = %s AND name = %s """, (sid, authenticated, attr)) for row in cursor: cursor.e...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
raise TracError(_('Session id %(sid)s not found', sid=sid))
raise TracError(_("Session id %(sid)s not found", sid=sid))
def set_attr(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session WHERE " "sid = %s", (sid,)) for authenticated, in cursor: cursor.execute(""" SELECT name, value FROM session_attribute WHERE sid = %s AND authenticated = %s AND name = %s """, (sid, authenticated, attr)) for row in cursor: cursor.e...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute " "WHERE authenticated = 0") cursor.execute("DELETE FROM session " "WHERE authenticated = 0")
cursor.execute(""" DELETE FROM session_attribute WHERE authenticated = 0 """) cursor.execute(""" DELETE FROM session WHERE authenticated = 0 """)
def delete_session(db): cursor = db.cursor() if sid.lower() == 'anonymous': cursor.execute("DELETE FROM session_attribute " "WHERE authenticated = 0") cursor.execute("DELETE FROM session " "WHERE authenticated = 0") elif sid == '*': cursor.execute("DELETE FROM session_attribute " "WHERE name <> 'password'") cursor.exec...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute " "WHERE name <> 'password'") cursor.execute("DELETE FROM session")
cursor.execute(""" DELETE FROM session_attribute WHERE name <> 'password' """) cursor.execute(""" DELETE FROM session """)
def delete_session(db): cursor = db.cursor() if sid.lower() == 'anonymous': cursor.execute("DELETE FROM session_attribute " "WHERE authenticated = 0") cursor.execute("DELETE FROM session " "WHERE authenticated = 0") elif sid == '*': cursor.execute("DELETE FROM session_attribute " "WHERE name <> 'password'") cursor.exec...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute " "WHERE sid = %s", (sid,)) cursor.execute("DELETE FROM session WHERE sid = %s", (sid,))
cursor.execute(""" DELETE FROM session_attribute WHERE sid = %s """, (sid,)) cursor.execute(""" DELETE FROM session WHERE sid = %s """, (sid,))
def delete_session(db): cursor = db.cursor() if sid.lower() == 'anonymous': cursor.execute("DELETE FROM session_attribute " "WHERE authenticated = 0") cursor.execute("DELETE FROM session " "WHERE authenticated = 0") elif sid == '*': cursor.execute("DELETE FROM session_attribute " "WHERE name <> 'password'") cursor.exec...
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
cursor.execute("DELETE FROM session_attribute " "WHERE authenticated=0") cursor.execute("DELETE FROM session WHERE authenticated=0")
cursor.execute(""" DELETE FROM session_attribute WHERE authenticated=0 """) cursor.execute(""" DELETE FROM session WHERE authenticated=0 """)
def purge_session(db): cursor = db.cursor() if age: cursor.execute(""" DELETE FROM session_attribute WHERE authenticated=0 AND sid IN (SELECT sid FROM session WHERE authenticated=0 AND last_visit < %s) """, (ts,)) cursor.execute(""" DELETE FROM session WHERE authenticated=0 AND last_visit < %s """, (ts,)) else: cursor....
c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py
else: return 'CANCELLED'
else: return 'CANCELLED'
def get_status(ticket): status = ticket['status'] if status == 'new' or status == 'reopened' and not ticket['owner']: return 'NEEDS-ACTION' elif status == 'assigned' or status == 'reopened': return 'IN-PROCESS' elif status == 'closed': if ticket['resolution'] == 'fixed': return 'COMPLETED' else: return 'CANCELLED' else...
11cebf8c30c614f5dd58a7421281b92d098aa1b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/11cebf8c30c614f5dd58a7421281b92d098aa1b9/roadmap.py