rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
c.execute("""DELETE FROM attachment""") os.system('rm -rf %s' % trac.env.get_attachments_dir()) os.mkdir(trac.env.get_attachments_dir()) | c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_di... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
print print "1. import severities..." severities = (('blocker', '1'), ('critical', '2'), ('major', '3'), ('normal', '4'), ('minor', '5'), ('trivial', '6'), ('enhancement', '7')) trac.setSeverityList(severities) print print "2. import components..." sql = "SELECT value, initialowner AS owner FROM components" if PRODU... | print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = produ... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
print print "5. import milestones..." mysql_cur.execute("SELECT value FROM milestones") | print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if milestones[0] == '---': trac.setMilestoneList(milestones, 'value') else: trac.setMilestoneList([], '') print print '6. retrieving bugs...' sql = "SELECT * FROM bugs " if PRODUCTS: sql += " WHERE %s" % productFilter('product', PRODUCTS) sql += " ORDER BY bug_id" | trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.i... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
print print "7. import bugs and bug activity..." | print "\n7. Import bugs and bug activity..." | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
ticket['component'] = bug['component'] | if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
ticket['priority'] = bug['priority'] | ticket['priority'] = bug['priority'].lower() | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s" % bugid) | mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if bug['target_milestone'] == '---': ticket['milestone'] = '' else: ticket['milestone'] = bug['target_milestone'] | target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
keywords = string.split(bug['keywords'], ' ') | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | |
if ignore: continue | if ignore: continue | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
time=desc['bug_when'], | time = desc['bug_when'], | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
value=desc['thetext']) mysql_cur.execute("SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when" % bugid) | value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if field_name == 'resolution' or field_name == 'bug_status': | if field_name == "resolution" or field_name == "bug_status": | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if field_name == 'resolution': | if field_name == "resolution": | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
keywordChange = False oldKeywords = string.join(keywords, " ") | add_keywords = [] remove_keywords = [] | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if field_name == 'bug_severity': field_name = 'severity' elif field_name == 'assigned_to': field_name = 'owner' elif field_name == 'bug_status': field_name = 'status' | if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
kw = STATUS_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True | remove_keywords.append(STATUS_KEYWORDS[removed]) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
kw = STATUS_KEYWORDS[added] keywords.append(kw) keywordChange = True | add_keywords.append(STATUS_KEYWORDS[added]) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
elif field_name == 'short_desc': field_name = 'summary' elif field_name == 'product': if removed in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[add... | elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: k... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) | ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if keywordChange: newKeywords = string.join(keywords, " ") ticketChangeKw = ticketChange ticketChangeKw['field'] = 'keywords' ticketChangeKw['oldvalue'] = oldKeywords ticketChangeKw['newvalue'] = newKeywords ticketChanges.append(ticketChangeKw) | if add_keywords or remove_keywords: old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] keywords = [kw for kw in keywords if kw not in remove_keywords] keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChan... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | ||
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | ||
if (field_name == 'summary' | if (field_name == "summary" | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | ||
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py | ||
if not ticket['resolution'] and ticket['status'] == 'closed': | if not ticket['resolution'] and ticket['status'] == "closed": | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if bug['bug_status'] in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug['bug_status']] | bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if bug['product'] in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[bug['product']] if kw not in keywords: | product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
tracAttachment = Attachment(a['filename'], a['thedata']) trac.addAttachment(bugid, tracAttachment, a['description'], author) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) print "Success!" | print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['lo... | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "B... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
print "bugzilla2trac - Imports a bug database from Bugzilla into Trac." print print "Usage: bugzilla2trac.py [options]" print print "Available Options:" print " --db <MySQL dbname> - Bugzilla's database" print " --tracenv /path/to/trac/env - full path to Trac db environment" print " -h | --host <My... | print """bugzilla2trac - Imports a bug database from Bugzilla into Trac. Usage: bugzilla2trac.py [options] Available Options: --db <MySQL dbname> - Bugzilla's database name --tracenv /path/to/trac/env - Full path to Trac db environment -h | --host <MySQL hostname> - Bugzilla's DNS host name -u |... | def usage(): print "bugzilla2trac - Imports a bug database from Bugzilla into Trac." print print "Usage: bugzilla2trac.py [options]" print print "Available Options:" print " --db <MySQL dbname> - Bugzilla's database" print " --tracenv /path/to/trac/env - full path to Trac db environment" print " -h... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv): BZ_HOST = sys.argv[iter+1] iter = iter + 1 elif sy... | if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv): BZ_HOST = sys.argv[iter+1] iter = iter + 1 elif sy... | def main(): global BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN if len (sys.argv) > 1: if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4: usage() iter = 1 while iter < len(sys.argv): if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv): BZ_DB = sys.argv[iter+1] iter = iter + 1 elif sys.argv[ite... | 63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py |
def __init__(self, application, auths): | def __init__(self, application, auths, single_env_name=None): | def __init__(self, application, auths): self.application = application self.auths = auths | a5fd0203fa0c419cc17c9c2ee632262a696a064d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5fd0203fa0c419cc17c9c2ee632262a696a064d/standalone.py |
if len(path_parts) > 1 and path_parts[1] == 'login': env_name = path_parts[0] | if len(path_parts) > self.part and path_parts[self.part] == 'login': env_name = self.single_env_name or path_parts[0] | def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') path_parts = filter(None, path_info.split('/')) if len(path_parts) > 1 and path_parts[1] == 'login': env_name = path_parts[0] if env_name: auth = self.auths.get(env_name, self.auths.get('*')) if auth: remote_user = auth.do_auth(enviro... | a5fd0203fa0c419cc17c9c2ee632262a696a064d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5fd0203fa0c419cc17c9c2ee632262a696a064d/standalone.py |
def __init__(self, application, env_parent_dir, env_paths): | def __init__(self, application, env_parent_dir, env_paths, single_env): | def __init__(self, application, env_parent_dir, env_paths): self.application = application self.environ = {} self.environ['trac.env_path'] = None if env_parent_dir: self.environ['trac.env_parent_dir'] = env_parent_dir else: self.environ['trac.env_paths'] = env_paths | a5fd0203fa0c419cc17c9c2ee632262a696a064d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5fd0203fa0c419cc17c9c2ee632262a696a064d/standalone.py |
options.env_parent_dir, args) | options.env_parent_dir, args, options.single_env) | def _validate_callback(option, opt_str, value, parser, valid_values): if value not in valid_values: raise OptionValueError('%s must be one of: %s, not %s' % (opt_str, '|'.join(valid_values), value)) setattr(parser.values, option.dest, value) | a5fd0203fa0c419cc17c9c2ee632262a696a064d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5fd0203fa0c419cc17c9c2ee632262a696a064d/standalone.py |
wsgi_app = AuthenticationMiddleware(wsgi_app, auths) | if options.single_env: project_name = os.path.basename(os.path.normpath(args[0])) wsgi_app = AuthenticationMiddleware(wsgi_app, auths, project_name) else: wsgi_app = AuthenticationMiddleware(wsgi_app, auths) | def _validate_callback(option, opt_str, value, parser, valid_values): if value not in valid_values: raise OptionValueError('%s must be one of: %s, not %s' % (opt_str, '|'.join(valid_values), value)) setattr(parser.values, option.dest, value) | a5fd0203fa0c419cc17c9c2ee632262a696a064d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a5fd0203fa0c419cc17c9c2ee632262a696a064d/standalone.py |
cols.remove(col) | if col in cols: cols.remove(col) | def get_columns(self): if self.cols: return self.cols | e068c52b9de61272140fbaee94f2f03d828a9f05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e068c52b9de61272140fbaee94f2f03d828a9f05/Query.py |
r'(?P<%s><(?:font color="|span style="color: ) for c in colors.items() ] | r'(?P<%s><(?:font color="|span style="color: ) for c in colors.items() ] | def rules(cls): colors = dict(comment='FF8000', lang='0000BB', keyword='007700', string='DD0000') # rules check for <font> for PHP 4 or <span> for PHP 5 color_rules = [ r'(?P<%s><(?:font color="|span style="color: )#%s">)' % c for c in colors.items() ] return color_rules + [ r'(?P<font><font.*?>)', r'(?P<endfont></font... | f28513e36860a143a79379329c6d2b0b3ee48555 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f28513e36860a143a79379329c6d2b0b3ee48555/php.py |
odata = ''.join(np.out.splitlines()[1:-1]) | odata = ''.join(np.out.splitlines()[1:-2]) | def render(self, req, mimetype, content, filename=None, rev=None): cmdline = self.config.get('mimeviewer', 'php_path') # -n to ignore php.ini so we're using default colors cmdline += ' -sn' self.env.log.debug("PHP command line: %s" % cmdline) content = content_to_unicode(self.env, content, mimetype) content = content.... | f28513e36860a143a79379329c6d2b0b3ee48555 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f28513e36860a143a79379329c6d2b0b3ee48555/php.py |
if not old_path or not new_path: | if not self.prefix or not (old_path and new_path): | def apply_textdelta(self, file_baton, base_checksum): old_path, new_path, pool = file_baton if not old_path or not new_path: return old_root = self._old_root(new_path, pool) if not old_root: return | 366146b7ec5981582cfb730d7001571c1f2a66a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/366146b7ec5981582cfb730d7001571c1f2a66a8/Changeset.py |
resp = chosen_handler.process_request(req) if resp: chrome = Chrome(self.env) if len(resp) == 2: chrome.populate_hdf(req) template, content_type = \ self._post_process_request(req, *resp) req.display(template, content_type or 'text/html') else: template, data, content_type = resp output = chrome.render_template(req, te... | self._post_process_request(req) except Exception, e: self.log.exception(e) raise err[0], err[1], err[2] except PermissionError, e: raise HTTPForbidden(to_unicode(e)) except TracError, e: raise HTTPInternalError(e.message) | def dispatch(self, req): """Find a registered handler that matches the request and let it process it. In addition, this method initializes the HDF data set and adds the web site chrome. """ self.env.href = req.href # FIXME: remove later in 0.11 self.env.abs_href = Href(self.env.base_url) | 922f98c5cf5789b8680b05029486fc7c273475c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/922f98c5cf5789b8680b05029486fc7c273475c0/main.py |
req.args['path'] = match.group(2) | req.args['path'] = match.group(2).replace(':', '/') | def match_request(self, req): match = re.match(r'^/attachment/(ticket|wiki)(?:/(.*))?$', req.path_info) if match: req.args['type'] = match.group(1) req.args['path'] = match.group(2) return 1 | 886f1a765f6016de88b7881e8584fdf89adb290d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/886f1a765f6016de88b7881e8584fdf89adb290d/attachment.py |
VALUES('header_logo', 'width', '500'); INSERT INTO config (section, name, value) VALUES('header_logo', 'height', '70'); | VALUES('header_logo', 'width', '199'); INSERT INTO config (section, name, value) VALUES('header_logo', 'height', '38'); | def insert_default_values (cursor): cursor.execute (""" | 99c9f59fc8c46bc4cdc3c2bda8118f5ffd86d2c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/99c9f59fc8c46bc4cdc3c2bda8118f5ffd86d2c3/trac_admin.py |
req.hdf = HDFWrapper(loadpaths=[default_dir('templates'), tmpl_path]) | req.hdf = HDFWrapper(loadpaths=[tmpl_path, default_dir('templates')]) | def send_project_index(req, options, env_paths=None): from trac.web.clearsilver import HDFWrapper if 'TRAC_ENV_INDEX_TEMPLATE' in options: tmpl_path, template = os.path.split(options['TRAC_ENV_INDEX_TEMPLATE']) from trac.config import default_dir req.hdf = HDFWrapper(loadpaths=[default_dir('templates'), tmpl_path]) ... | c377ff9f59cd050eeb5638ab712aa74c643add18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c377ff9f59cd050eeb5638ab712aa74c643add18/main.py |
order = getattr(self, category + '_order') def navcmp(x, y): if x[0] not in order: return int(y[0] in order) if y[0] not in order: return -int(x[0] in order) return cmp(order.index(x[0]), order.index(y[0])) items.sort(navcmp) | category_order = category + '_order' if hasattr(self, category_order): order = getattr(self, category_order) def navcmp(x, y): if x[0] not in order: return int(y[0] in order) if y[0] not in order: return -int(x[0] in order) return cmp(order.index(x[0]), order.index(y[0])) items.sort(navcmp) | def populate_hdf(self, req, handler): """Add chrome-related data to the HDF.""" | 9d522a532a2a98b77cc3a1cc078f775b24a2d998 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/9d522a532a2a98b77cc3a1cc078f775b24a2d998/chrome.py |
this_summary = summary if (time,id,author) != previous_update: | if (time,id,author,summary) != previous_update: | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py |
updates.append((previous_update,field_changes,comment, this_summary)) | updates.append((previous_update,field_changes,comment)) | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py |
previous_update = (time,id,author) | previous_update = (time,id,author,summary) | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py |
updates.append((previous_update,field_changes,comment, this_summary)) | updates.append((previous_update,field_changes,comment)) | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py |
for (t,id,author),field_changes,comment,summary in updates: | for (t,id,author,summary),field_changes,comment in updates: | def get_timeline_events(self, req, start, stop, filters): if 'ticket_details' in filters: db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT tc.time,tc.ticket,tc.field, " " tc.oldvalue,tc.newvalue,tc.author,t.summary " "FROM ticket_change tc" " LEFT JOIN ticket t ON t.id = tc.ticket " "AND t... | 864c57e24bc80b542bc9f91a63c08830962b5d0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/864c57e24bc80b542bc9f91a63c08830962b5d0c/Ticket.py |
self.setup_log() | if sys.platform == "win32": import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) self.setup_log() | def __init__(self, path, create=0): self.path = path if create: self.create() self.verify() self.load_config() self.setup_log() | cdfce2064ba58fed5de58cc8bd21cad174e1afff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/cdfce2064ba58fed5de58cc8bd21cad174e1afff/Environment.py |
self.in_list_item = 0 | self.in_list_item = False | def format(self, text, out, escape_newlines=False): self.out = out self._open_tags = [] self._list_stack = [] | ca3e6fe28b925ebff68a40ceae5a908a871c2d34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ca3e6fe28b925ebff68a40ceae5a908a871c2d34/formatter.py |
if len(result) and not self.in_list_item and not self.in_table: | if len(result) and not self.in_list_item and not self.in_def_list \ and not self.in_table: | def format(self, text, out, escape_newlines=False): self.out = out self._open_tags = [] self._list_stack = [] | ca3e6fe28b925ebff68a40ceae5a908a871c2d34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ca3e6fe28b925ebff68a40ceae5a908a871c2d34/formatter.py |
open(infile, 'w').write(input) infile.close() | tmp = open(infile, 'w') tmp.write(input) tmp.close() | def __init__(self, command, input=None, capturestderr=None): outfile = tempfile.mktemp() command = '( %s ) > %s' % (command, outfile) if input: infile = tempfile.mktemp() open(infile, 'w').write(input) infile.close() command = command + ' <' + infile if capturestderr: errfile = tempfile.mktemp() command = command + ' 2... | 927a499d63d645d4e7161a531a4bb3e02af9957a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/927a499d63d645d4e7161a531a4bb3e02af9957a/util.py |
likes = [r"%s %s %%s ESCAPE '_'" % (i, db.like()) for i in columns] | likes = [r"%s %s %%s ESCAPE '/'" % (i, db.like()) for i in columns] | def search_to_sql(db, columns, terms): """ Convert a search query into a SQL condition string and corresponding parameters. The result is returned as a (string, params) tuple. """ if len(columns) < 1 or len(terms) < 1: raise TracError('Empty search attempt, this should really not happen.') likes = [r"%s %s %%s ESCAPE ... | 7ccf6de4043e208822aa6135f4edb581aac2a951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7ccf6de4043e208822aa6135f4edb581aac2a951/Search.py |
escape_re = re.compile(r'([_%])') | escape_re = re.compile(r'([/_%])') | def search_to_sql(db, columns, terms): """ Convert a search query into a SQL condition string and corresponding parameters. The result is returned as a (string, params) tuple. """ if len(columns) < 1 or len(terms) < 1: raise TracError('Empty search attempt, this should really not happen.') likes = [r"%s %s %%s ESCAPE ... | 7ccf6de4043e208822aa6135f4edb581aac2a951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7ccf6de4043e208822aa6135f4edb581aac2a951/Search.py |
t = escape_re.sub(r'_\1', t) | t = escape_re.sub(r'/\1', t) | def search_to_sql(db, columns, terms): """ Convert a search query into a SQL condition string and corresponding parameters. The result is returned as a (string, params) tuple. """ if len(columns) < 1 or len(terms) < 1: raise TracError('Empty search attempt, this should really not happen.') likes = [r"%s %s %%s ESCAPE ... | 7ccf6de4043e208822aa6135f4edb581aac2a951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/7ccf6de4043e208822aa6135f4edb581aac2a951/Search.py |
max_preview_size = self.max_preview_size() if len(content) >= max_preview_size: return {'max_file_size_reached': True, 'max_file_size': max_preview_size, 'preview': ''} else: return {'preview': self.render(req, mimetype, content, filename, detail, annotations)} | return {'preview': self.render(req, mimetype, content, filename, detail, annotations)} | def preview_to_hdf(self, req, mimetype, charset, content, filename, detail=None, annotations=None): if not is_binary(content): content = to_utf8(content, charset or self.preview_charset(content)) max_preview_size = self.max_preview_size() if len(content) >= max_preview_size: return {'max_file_size_reached': True, 'max_... | d35aa86eb0e2864637da9bb9990f000696a82a6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d35aa86eb0e2864637da9bb9990f000696a82a6d/api.py |
idx = 0 | changes = [] | def insert_ticket_data(self, req, id, ticket, reporter_id): """Insert ticket data into the hdf""" evals = util.mydict(zip(ticket.keys(), map(lambda x: util.escape(x), ticket.values()))) util.add_to_hdf(evals, req.hdf, 'ticket') | 5af93da622cd2c46b60f11ea1671d6da1dbfaf15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5af93da622cd2c46b60f11ea1671d6da1dbfaf15/Ticket.py |
req.hdf.setValue('ticket.changes.%d.date' % idx, time.strftime('%c', time.localtime(date))) req.hdf.setValue('ticket.changes.%d.time' % idx, str(date)) req.hdf.setValue('ticket.changes.%d.author' % idx, util.escape(author)) req.hdf.setValue('ticket.changes.%d.field' % idx, field) req.hdf.setValue('ticket.changes.%d.old... | if date != curr_date or author != curr_author: changes.append({ 'date': time.strftime('%c', time.localtime(date)), 'author': util.escape(author), 'fields': {} }) curr_date = date curr_author = author | def insert_ticket_data(self, req, id, ticket, reporter_id): """Insert ticket data into the hdf""" evals = util.mydict(zip(ticket.keys(), map(lambda x: util.escape(x), ticket.values()))) util.add_to_hdf(evals, req.hdf, 'ticket') | 5af93da622cd2c46b60f11ea1671d6da1dbfaf15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5af93da622cd2c46b60f11ea1671d6da1dbfaf15/Ticket.py |
req.hdf.setValue('ticket.changes.%d.new' % idx, wiki_to_html(new, req.hdf, self.env, self.db)) | changes[-1]['comment'] = wiki_to_html(new, req.hdf, self.env, self.db) elif field == 'description': changes[-1]['fields'][field] = {} | def insert_ticket_data(self, req, id, ticket, reporter_id): """Insert ticket data into the hdf""" evals = util.mydict(zip(ticket.keys(), map(lambda x: util.escape(x), ticket.values()))) util.add_to_hdf(evals, req.hdf, 'ticket') | 5af93da622cd2c46b60f11ea1671d6da1dbfaf15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5af93da622cd2c46b60f11ea1671d6da1dbfaf15/Ticket.py |
req.hdf.setValue('ticket.changes.%d.new' % idx, util.escape(new)) idx = idx + 1 | changes[-1]['fields'][field] = {'old': old, 'new': new} util.add_to_hdf(changes, req.hdf, 'ticket.changes') | def insert_ticket_data(self, req, id, ticket, reporter_id): """Insert ticket data into the hdf""" evals = util.mydict(zip(ticket.keys(), map(lambda x: util.escape(x), ticket.values()))) util.add_to_hdf(evals, req.hdf, 'ticket') | 5af93da622cd2c46b60f11ea1671d6da1dbfaf15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5af93da622cd2c46b60f11ea1671d6da1dbfaf15/Ticket.py |
'report': {'id': id, 'title': title, 'description': wiki_to_html(description, self.env, req, db, absurls=(format == 'rss')), 'can': perms, 'args': args}} | 'report': {'id': id, 'title': title, 'description': description, 'can': perms, 'args': args}} | def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} perms = {} for action in [k for k,v in actions.items() if v in req.perm]... | fcf2045a8b3c09a70c53cad7de68853fe7c50e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/fcf2045a8b3c09a70c53cad7de68853fe7c50e90/report.py |
if col == 'description': cell['parsed'] = wiki_to_html(value, self.env, req, db, absurls=(format == 'rss')) elif col == 'reporter': | if col == 'reporter': | def sortkey(row): val = row[idx] if isinstance(val, basestring): val = val.lower() return val | fcf2045a8b3c09a70c53cad7de68853fe7c50e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/fcf2045a8b3c09a70c53cad7de68853fe7c50e90/report.py |
if '.' in key: prefix, attribute = key.split('.', 1) | idx = key.rfind('.') if idx > 0: prefix, attribute = key[:idx], key[idx+1:] | def render_macro(self, req, name, content): intertracs = {} for key, value in self.config.options('intertrac'): if '.' in key: prefix, attribute = key.split('.', 1) intertrac = intertracs.setdefault(prefix, {}) intertrac[attribute] = value else: intertracs[key] = value # alias | b3f35b02e461a6c8231b8f294eb060948ac30dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/b3f35b02e461a6c8231b8f294eb060948ac30dc3/intertrac.py |
message = wiki_to_html(description or '--', self.env, db, absurls=True) | message = wiki_to_html(description or '--', self.env, req, db, absurls=True) | def get_timeline_events(self, req, start, stop, filters): if 'milestone' in filters: format = req.args.get('format') db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute("SELECT completed,name,description FROM milestone " "WHERE completed>=%s AND completed<=%s", (start, stop,)) for completed,name,description ... | bedae146c860518a3ee0d7361c7f0528ffede165 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/bedae146c860518a3ee0d7361c7f0528ffede165/roadmap.py |
if not fs.has_key(name): | if value and not fs.has_key(name): | def set_if_missing(fs, name, value): if not fs.has_key(name): fs.list.append(cgi.MiniFieldStorage(name, value)) | c725fc7f50bfeea9a158b393313aa2e12644f6ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c725fc7f50bfeea9a158b393313aa2e12644f6ea/core.py |
cursor.execute("UPDATE ticket_custom SET value=%s", (self[name],)) | cursor.execute("UPDATE ticket_custom SET value=%s " "WHERE ticket=%s AND name=%s", (self[name], id, fname)) | def save_changes(self, db, author, comment, when = 0): """Store ticket changes in the database. The ticket must already exist in the database.""" assert self.has_key('id') cursor = db.cursor() if not when: when = int(time.time()) id = self['id'] | 104e1a42bc2b44ef74bbcb236235a87d76a0ee47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/104e1a42bc2b44ef74bbcb236235a87d76a0ee47/Ticket.py |
self.req.check_modified(self.last_modified) | self.req.check_modified(stat[8]) | def render(self): FileCommon.render(self) self.view_form = 0 self.attachment_type = self.args.get('type', None) self.attachment_id = self.args.get('id', None) self.filename = self.args.get('filename', None) if self.filename: self.filename = os.path.basename(self.filename) | ec02e797b7cb041f1d854f98e0f9a23745f13e0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ec02e797b7cb041f1d854f98e0f9a23745f13e0a/File.py |
tabwidth = self.config['diff'].getint('tab_width', self.config['mimeviewer'].getint('tab_width')) | tabwidth = self.config['diff'].getint('tab_width') or \ self.config['mimeviewer'].getint('tab_width', 8) | def _content_changes(old_node, new_node): """Returns the list of differences. | 5ee3189defb5f99dab2e8e196a3eafb934a48fa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5ee3189defb5f99dab2e8e196a3eafb934a48fa7/changeset.py |
text = unicode(text) | if not isinstance(text, basestring): text = unicode(text) elif not isinstance(text, unicode): text = text.decode('utf-8') | def escape(cls, text, quotes=True): """Create a Markup instance from a string and escape special characters it may contain (<, >, & and "). If the `quotes` parameter is set to `False`, the " character is left as is. Escaping quotes is generally only required for strings that are to be used in attribute values. """ if ... | 5f5870a5d76e9ceeb03902739bc2719a02866df9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5f5870a5d76e9ceeb03902739bc2719a02866df9/markup.py |
heading = match[depth+1:-depth-1-len(anchor)] heading = wiki_to_oneliner(heading, self.env, self.db, shorten, | heading_text = match[depth+1:-depth-1-len(anchor)] heading = wiki_to_oneliner(heading_text, self.env, self.db, False, | def _parse_heading(self, match, fullmatch, shorten): match = match.strip() | 412ec2aa5cc38a1ad033dac0385aafd5ea1bb35b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/412ec2aa5cc38a1ad033dac0385aafd5ea1bb35b/formatter.py |
log_mode = req.args.get('log_mode', 'stop_on_copy') full_messages = req.args.get('full_messages', '') limit = int(req.args.get('limit') or self.config.get('log', 'limit', '100')) repos = self.env.get_repository(req.authname) normpath = repos.normalize_path(path) rev = str(repos.normalize_rev(rev)) | verbose = req.args.get('verbose') limit = int(req.args.get('limit') or 100) | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
req.hdf['log.path'] = path req.hdf['log.rev'] = rev req.hdf['log.limit'] = limit req.hdf['log.mode'] = log_mode req.hdf['log.full_messages'] = full_messages if stop_rev: req.hdf['log.stop_rev'] = stop_rev req.hdf['log.browser_href'] = self.env.href.browser(path, rev=rev) req.hdf['log.log_href'] = self.env.href.log(path... | req.hdf['log'] = { 'path': path, 'rev': rev, 'mode': mode, 'verbose': verbose, 'stop_rev': stop_rev, 'browser_href': self.env.href.browser(path, rev=rev), 'log_href': self.env.href.log(path, rev=rev) } | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if log_mode != 'path_history': | if mode != 'path_history': | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
except util.TracError: | except TracError: | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
log_mode = 'path_history' | mode = 'path_history' | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if log_mode == 'path_history': | if mode == 'path_history': | def process_request(self, req): req.perm.assert_permission(perm.LOG_VIEW) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if not (log_mode == 'path_history' and old_chg == Changeset.EDIT): | if not (mode == 'path_history' and old_chg == Changeset.EDIT): | def history(limit): for h in repos.get_path_history(path, rev, limit): yield h | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
and not (log_mode == 'path_history' and old_path == normpath): | and not (mode == 'path_history' and old_path == normpath): | def history(limit): for h in repos.get_path_history(path, rev, limit): yield h | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if log_mode == 'stop_on_copy': | if mode == 'stop_on_copy': | def history(limit): for h in repos.get_path_history(path, rev, limit): yield h | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
raise util.TracError("The file or directory '%s' doesn't exist " "at revision %s or at any previous revision." % (path, rev), 'Nonexistent path') | raise TracError("The file or directory '%s' doesn't exist " "at revision %s or at any previous revision." % (path, rev), 'Nonexistent path') | def history(limit): for h in repos.get_path_history(path, rev, limit): yield h | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } | params = {'rev': rev, 'mode': mode, 'limit': limit} | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if full_messages: params['full_messages'] = full_messages | if verbose: params['verbose'] = verbose | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
'Revision Log (restarting at %s, rev. %s)' % (next_path, next_rev)) | 'Revision Log (restarting at %s, rev. %s)' % (next_path, next_rev)) | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
full_messages, req, format) | verbose, req, format) | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
return 'log_changelog.cs', 'application/rss+xml' | return 'log_changelog.cs', 'text/plain' | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
changelog_href = make_log_href(path, format='changelog', stop_rev=stop_rev) | changelog_href = make_log_href(path, format='changelog', stop_rev=stop_rev) | def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params) | 234d1cbd40911d7fa7755656880ea911f8f1d19a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/234d1cbd40911d7fa7755656880ea911f8f1d19a/Browser.py |
if os.path.dirname(egg_path) == os.path.realpath(plugins_dir): | if paths_equal(os.path.dirname(egg_path), os.path.realpath(plugins_dir)): | def enable_modules(egg_path, modules): """Automatically enable any components provided by plugins loaded from the environment plugins directory.""" if os.path.dirname(egg_path) == os.path.realpath(plugins_dir): for module in modules: env.config.setdefault('components', module + '.*', 'enabled') | 6a085a2e84b978b0f9d68029c10079602befcf56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6a085a2e84b978b0f9d68029c10079602befcf56/loader.py |
def add_options(field, constraints, prefix, options): | def add_options(field, constraints, prefix, cursor, sql): options = [] | def add_options(field, constraints, prefix, options): check = constraints.has_key(field) for option in options: if check and (option['name'] in constraints[field]): option['selected'] = 1 util.add_to_hdf(options, self.req.hdf, prefix + field) if check: del constraints[field] | 17dcec05342a59b826eb656f267c946a5551f2e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/17dcec05342a59b826eb656f267c946a5551f2e6/Query.py |
for option in options: if check and (option['name'] in constraints[field]): | cursor.execute(sql) while 1: row = cursor.fetchone() if not row: break option = {'name': row[0]} if check and (row[0] in constraints[field]): | def add_options(field, constraints, prefix, options): check = constraints.has_key(field) for option in options: if check and (option['name'] in constraints[field]): option['selected'] = 1 util.add_to_hdf(options, self.req.hdf, prefix + field) if check: del constraints[field] | 17dcec05342a59b826eb656f267c946a5551f2e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/17dcec05342a59b826eb656f267c946a5551f2e6/Query.py |
def add_db_options(field, constraints, prefix, cursor, sql): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, constraints, prefix, options) add_options('status', constraints, 'query.options.', [{'name': 'new'}, {'name': '... | def add_db_options(field, constraints, prefix, cursor, sql): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, constraints, prefix, options) | 17dcec05342a59b826eb656f267c946a5551f2e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/17dcec05342a59b826eb656f267c946a5551f2e6/Query.py | |
add_db_options('component', constraints, 'query.options.', cursor, 'SELECT name FROM component ORDER BY name', ) add_db_options('milestone', constraints, 'query.options.', cursor, 'SELECT name FROM milestone ORDER BY name') add_db_options('version', constraints, 'query.options.', cursor, 'SELECT name FROM version ORDER... | add_options('status', constraints, 'query.options.', cursor, "SELECT name FROM enum WHERE type='status'") add_options('resolution', constraints, 'query.options.', cursor, "SELECT name FROM enum WHERE type='resolution'") add_options('component', constraints, 'query.options.', cursor, "SELECT name FROM component ORDER BY... | def add_db_options(field, constraints, prefix, cursor, sql): cursor.execute(sql) options = [] while 1: row = cursor.fetchone() if not row: break if row[0]: options.append({'name': row[0]}) add_options(field, constraints, prefix, options) | 17dcec05342a59b826eb656f267c946a5551f2e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/17dcec05342a59b826eb656f267c946a5551f2e6/Query.py |
"FROM ticket OUTER JOIN ticket_custom ON id = ticket" | "FROM ticket LEFT OUTER JOIN ticket_custom ON id = ticket" | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | 17dcec05342a59b826eb656f267c946a5551f2e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/17dcec05342a59b826eb656f267c946a5551f2e6/Query.py |
self.base_url = 'http://%s:%d%s' % (host, port, cgi_location) | self.base_url = 'http://%s:%d%s' % (host, port, self.cgi_location) | def init_request(self): core.Request.init_request(self) options = self.req.get_options() | 97f132559aa91f0635ad5f6fe993b3517299b8c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f132559aa91f0635ad5f6fe993b3517299b8c5/ModPythonHandler.py |
req.write('<li><a href="%s">%s</a></li>' % (mpr.idx_location + '/' + project, | req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), | def send_project_index(req, mpr, dir): req.content_type = 'text/html' req.write('<html><head><title>Available Projects</title></head>') req.write('<body><h1>Available Projects</h1><ul>') for project in os.listdir(dir): req.write('<li><a href="%s">%s</a></li>' % (mpr.idx_location + '/' + project, project)) req.write('</... | 97f132559aa91f0635ad5f6fe993b3517299b8c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/97f132559aa91f0635ad5f6fe993b3517299b8c5/ModPythonHandler.py |
return {'order': order, 'desc': desc and 1 or 0, | return {'order': order, 'desc': desc and 1 or None, | def browse_order(a): return a['is_dir'] and dir_order or 0, file_order(a) | 3dcef4da7b84f5244976fe1d8e777916b049bad0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3dcef4da7b84f5244976fe1d8e777916b049bad0/browser.py |
if not order in Ticket.std_fields: | if order != 'id' and not order in Ticket.std_fields: | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Custom Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | a7751087a7e65280d357e7edc0be9a4b07b2446a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/a7751087a7e65280d357e7edc0be9a4b07b2446a/Query.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.