rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
output = "email me here: %s@%s\u200B. it'll be great" % ( | output = "email me here: %s@%s . it'll be great" % ( | def test(self): ''' a controller called put_forwarder_in_contact_blurb_if_they_want() takes a string which is what someone inputs as their contact info blurb it also takes said person's username or person object or something we're testing this: the controller returns a string which is the same as the one that it receiv... |
if self.icon_for_profile: | if self.icon_for_profile and not self.icon_is_wrong: | def get_url_of_icon_or_generic(self): # Recycle icon_smaller_for_badge since it's the same size as # the icon for most other uses (profiles, etc.). if self.icon_for_profile: return self.icon_for_profile.url else: return settings.MEDIA_URL + 'no-project-icon.png' |
if self.icon_smaller_for_badge: | if self.icon_smaller_for_badge and not self.icon_is_wrong: | def get_url_of_badge_size_icon_or_generic(self): if self.icon_smaller_for_badge: return self.icon_smaller_for_badge.url else: return settings.MEDIA_URL + 'no-project-icon-w=40.png' |
if self.icon_for_search_result: | if self.icon_for_search_result and not self.icon_is_wrong: | def get_url_of_search_result_icon_or_generic(self): if self.icon_for_search_result: return self.icon_for_search_result.url else: return settings.MEDIA_URL + 'no-project-icon-w=20.png' |
{'query': email}, many=True) | {u'query': unicode(email)}, many=True) | def search_contribution_info_by_email(self, email): ret = [] url = 'http://www.ohloh.net/contributors.xml?' c_fs, web_response = ohloh_url2data(url, 'result/contributor_fact', {'query': email}, many=True) |
BASE_URL='http://twistedmatrix.com/trac/', bitesized_keyword='easy') | BASE_URL='http://twistedmatrix.com/trac/') | def test_create_bug_object_data_dict_more_recent(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': ... |
got = tb.as_data_dict_for_bug_object() | got = tb.as_data_dict_for_bug_object(tracbug_tests_extract_tracker_specific_data) | def test_create_bug_object_data_dict_more_recent(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': ... |
BASE_URL='http://twistedmatrix.com/trac/', bitesized_keyword='easy') | BASE_URL='http://twistedmatrix.com/trac/') | def test_create_bug_object_data_dict(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': '4298', 'key... |
got = tb.as_data_dict_for_bug_object() | got = tb.as_data_dict_for_bug_object(tracbug_tests_extract_tracker_specific_data) | def test_create_bug_object_data_dict(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': '4298', 'key... |
BASE_URL='http://twistedmatrix.com/trac/', bitesized_keyword='easy') | BASE_URL='http://twistedmatrix.com/trac/') | def test_create_bug_that_lacks_modified_date(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': '429... |
got = tb.as_data_dict_for_bug_object() | got = tb.as_data_dict_for_bug_object(tracbug_tests_extract_tracker_specific_data) | def test_create_bug_that_lacks_modified_date(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).", 'id': '429... |
BASE_URL='http://twistedmatrix.com/trac/', bitesized_keyword='easy') | BASE_URL='http://twistedmatrix.com/trac/') | def test_create_bug_that_lacks_modified_date_and_uses_owned_by_instead_of_assigned_to(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's de... |
got = tb.as_data_dict_for_bug_object() | got = tb.as_data_dict_for_bug_object(tracbug_tests_extract_tracker_specific_data) | def test_create_bug_that_lacks_modified_date_and_uses_owned_by_instead_of_assigned_to(self, m): m.return_value = { 'branch': '', 'branch_author': '', 'cc': 'thijs_ exarkun', 'component': 'core', 'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's de... |
language_names = query.get_q().get_language_names() | language_names = query.get_language_names() | def test_with_language_as_unknown(self): # In the setUp we create bugs in three languages. # Here, we verify that the get_language_names() method correctly returns # all three languages, even though the GET data shows that we are # browsing by language. |
canonical_bug_link = models.URLField(max_length=200) | canonical_bug_link = models.URLField(max_length=200, unique=True) | def get_query_set(self): return super(OpenBugsManager, self).get_query_set().filter( looks_closed=False) |
logging.info("Guessing on KDE subproject name. Found %s" % things) | logging.info("Guessing on KDE subproject name. Found %s" % repr(things)) | def project_finder_plugin(bug_xml_elt): import mysite.search.models product = bug_xml_elt.xpath('product')[0].text reasonable_products = set([ 'Akonadi', 'Phonon' 'kmail', 'Rocs', 'akregator', 'amarok', 'ark', 'cervisia', 'k3b', 'kappfinder', 'kbabel', 'kdeprint', 'kdesktop', 'kfile', 'kfourinline', 'khotkeys', 'kio', ... |
canonical_bug_link="http://asdf.com", | canonical_bug_link="http://asdf.com/" + uuid.uuid4().hex, | def create_dummy(**kwargs): now = datetime.datetime.utcnow() n = str(Bug.all_bugs.count()) data = dict(title=n, project=Project.objects.all()[0], date_reported=now, last_touched=now, last_polled=now, canonical_bug_link="http://asdf.com", submitter_username='dude', description='') data.update(kwargs) ret = Bug(**data) r... |
data['title'] = '(in Fedora) ' + data['title'] | def project_finder_plugin(bug_elt): component = bug_elt.find('component').text p, _ = mysite.search.models.Project.objects.get_or_create(name=component) # NOTE: If get_or_create() returns a new Project, we're not going # to know the primary_language. return p | |
mysite.profile.tasks.fill_recommended_bugs_cache() | def handle(self, *args, **options): mysite.profile.tasks.sync_bug_epoch_from_model_then_fill_recommended_bugs_cache() mysite.profile.tasks.fill_recommended_bugs_cache() | |
def test_set_to_true(self): | def test_set_to_false(self): | def test_set_to_true(self): # Starts as True p = Person.objects.get(user__username='paulproteus') p.expand_next_steps = True p.save() |
cache.set(key_name, geocoded_in_json, 60 * 60 * 24 * 7) | cache_duration = A_LONG_TIME_IN_SECONDS + random.randrange(0, JUST_FIVE_MINUTES_IN_SECONDS) else: cache_duration = random.randrange(0, JUST_FIVE_MINUTES_IN_SECONDS) cache.set(key_name, geocoded_in_json, cache_duration) | def cached_geocoding_in_json(address): if address == 'Inaccessible Island': is_inaccessible = True else: is_inaccessible = False key_name = address2cache_key_name(address) geocoded = None geocoded_in_json = cache.get(key_name) if geocoded_in_json is None: geocoded = _geocode(address) or {} geocoded_and_inaccessible = {... |
'lp': lp_action, | def bb_action(dia): """ Given a dia with a username, check to see if there are any source packages maintained by the user. """ return mysite.customs.bitbucket.get_user_repos(dia.query) | |
dia = DataImportAttempt.objects.get(id=dia_id) | dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id) | def create_citations_from_ohloh_contributor_facts(dia_id, ohloh_results): '''Input: A sequence of Ohloh ContributionFact dicts and the id of the DataImport they came from. Side-effect: Create matching structures in the DB and mark our success in the database.''' # {{{ dia = DataImportAttempt.objects.get(id=dia_id) per... |
(portfolio_entry, _) = PortfolioEntry.objects.get_or_create( | (portfolio_entry, _) = mysite.profile.models.PortfolioEntry.objects.get_or_create( | def create_citations_from_ohloh_contributor_facts(dia_id, ohloh_results): '''Input: A sequence of Ohloh ContributionFact dicts and the id of the DataImport they came from. Side-effect: Create matching structures in the DB and mark our success in the database.''' # {{{ dia = DataImportAttempt.objects.get(id=dia_id) per... |
citation = Citation.create_from_ohloh_contrib_info(ohloh_contrib_info) | citation = mysite.profile.models.Citation.create_from_ohloh_contrib_info(ohloh_contrib_info) | def create_citations_from_ohloh_contributor_facts(dia_id, ohloh_results): '''Input: A sequence of Ohloh ContributionFact dicts and the id of the DataImport they came from. Side-effect: Create matching structures in the DB and mark our success in the database.''' # {{{ dia = DataImportAttempt.objects.get(id=dia_id) per... |
dia = DataImportAttempt.objects.get(id=dia_id) | dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id) | def create_citations_from_launchpad_results(dia_id, lp_results): "Input: A dictionary that maps from a project name to information " "about that project, e.g. " """ { 'F-Spot': { 'url': 'http://launchpad.net/f-spot', 'involvement_types': ['Bug Management', 'Bazaar Branches'], 'languages': ['python', 'ruby'], 'citation_... |
if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, project=project) | if mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = mysite.profile.models.PortfolioEntry(person=person, project=project) | def create_citations_from_launchpad_results(dia_id, lp_results): "Input: A dictionary that maps from a project name to information " "about that project, e.g. " """ { 'F-Spot': { 'url': 'http://launchpad.net/f-spot', 'involvement_types': ['Bug Management', 'Bazaar Branches'], 'languages': ['python', 'ruby'], 'citation_... |
portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() | portfolio_entry = mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project)[0] citation = mysite.profile.models.Citation() | def create_citations_from_launchpad_results(dia_id, lp_results): "Input: A dictionary that maps from a project name to information " "about that project, e.g. " """ { 'F-Spot': { 'url': 'http://launchpad.net/f-spot', 'involvement_types': ['Bug Management', 'Bazaar Branches'], 'languages': ['python', 'ruby'], 'citation_... |
dia = DataImportAttempt.objects.get(id=dia_id) | dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id) | def create_citations_from_github_results(dia_id, results, override_contrib=None): repos, dict_mapping_repos_to_languages = results dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for repo in repos: (project, _) = Project.objects.get_or_create(name=repo.name) # FIXME: Populate project description, n... |
if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, | if mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = mysite.profile.models.PortfolioEntry(person=person, | def create_citations_from_github_results(dia_id, results, override_contrib=None): repos, dict_mapping_repos_to_languages = results dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for repo in repos: (project, _) = Project.objects.get_or_create(name=repo.name) # FIXME: Populate project description, n... |
portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] | portfolio_entry = mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project)[0] | def create_citations_from_github_results(dia_id, results, override_contrib=None): repos, dict_mapping_repos_to_languages = results dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for repo in repos: (project, _) = Project.objects.get_or_create(name=repo.name) # FIXME: Populate project description, n... |
citation = Citation() | citation = mysite.profile.models.Citation() | def create_citations_from_github_results(dia_id, results, override_contrib=None): repos, dict_mapping_repos_to_languages = results dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for repo in repos: (project, _) = Project.objects.get_or_create(name=repo.name) # FIXME: Populate project description, n... |
dia = DataImportAttempt.objects.get(id=dia_id) | dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id) | def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_nam... |
if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, | if mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = mysite.profile.models.PortfolioEntry(person=person, | def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_nam... |
portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] | portfolio_entry = mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project)[0] | def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_nam... |
citation = Citation() | citation = mysite.profile.models.Citation() | def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_nam... |
portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() | portfolio_entry = mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project)[0] citation = mysite.profile.models.Citation() | def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_nam... |
person = Person.objects.get(id=person_id) | person = mysite.profile.models.Person.objects.get(id=person_id) | def run(self, person_id, **kwargs): person = Person.objects.get(id=person_id) pi = mysite.profile.search_indexes.PersonIndex(person) pi.update_object(person) |
dia = DataImportAttempt.objects.get(id=dia_id) | dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id) | def run(self, dia_id, **kwargs): """""" dia = DataImportAttempt.objects.get(id=dia_id) try: logger = self.get_logger(**kwargs) logger.info("Starting job for <%s>" % dia) if dia.completed: logger.info("Bailing out job for <%s>" % dia) return results = source2actual_action[dia.source](dia) source2result_handler[dia.sourc... |
gnome2openhatch = {'general': 'GNOME (general)' | gnome2openhatch = {'general': 'GNOME (general)', | def project_finder_plugin(bug_elt): import mysite.search.models project_name = bug_elt.xpath('product')[0].text |
bug_project_name_format=bt.bug_project_name_format) | bug_project_name_format=bt.bug_project_name_format, bug_id_list_only=(bt.query_url_type=='tracker')) | def __init__(self): BugzillaBugTracker.__init__(self, base_url=bt.base_url, project_name=bt.project_name, bug_project_name_format=bt.bug_project_name_format) |
def generate_bug_xml_from_queries(self, queries) | def generate_bug_xml_from_queries(self, queries): | def generate_bug_xml_from_queries(self, queries) for query_name in queries: query_url = queries[query_name] query_xml = mysite.customs.bugtrackers.bugzilla.url2bug_data(query_url) for bug_xml in query_xml.xpath('bug'): yield bug_xml |
def get_current_xml_bug_tree(self): return mysite.customs.bugtrackers.bugzilla.url2bug_data( | def __init__(self): BugzillaBugTracker.__init__(self, base_url='https://bugs.kde.org/', project_name='KDE', bug_project_name_format='') | |
class MusopenBugzilla(BugzillaBugTracker): enabled = False def __init__(self): BugzillaBugTracker.__init__(self, base_url='', project_name='Musopen', bug_project_name_format='{project}') def generate_current_bug_xml(self): queries = { 'Easy bugs': '', 'Documentation bugs': '' } return self.generate_bug_xml_from_queri... | def extract_tracker_specific_data(xml_data, ret_dict): # Make modifications to ret_dict using provided metadata ret_dict['good_for_newcomers'] = False # No bitesized keyword. # Then pass ret_dict back return ret_dict | |
instantiated.update() | try: instantiated.update() except: logging.info("[Bugzilla] ERROR: Importer failed, likely HTTP500, continuing on..." | def find_and_update_enabled_bugzilla_instances(self): enabled_bugzilla_instances = [] |
'user_wants_to_help': request.user.is_authenticated() and request.user.get_profile() in p.people_who_wanna_help.all(), | 'user_wants_to_help': request.user.get_profile() in p.people_who_wanna_help.all(), | def project(request, project__name = None): p = get_object_or_404(Project, name=project__name) pfentries = p.portfolioentry_set.exclude(project_description='') only_good_pfentries = lambda pfe: pfe.project_description.strip() pfentries = filter(only_good_pfentries, pfentries) context = {} if pfentries: context['rando... |
query_url = models.URLField(max_length=200, unique=True, blank=False, null=False) | query_url = models.SeparatedValuesField(max_length=200, unique=True, blank=False, null=False) | def create_from_http_error(error): return None |
pass | logging.info("Skipping! It's fresh.") return | def look_at_one_twisted_bug(bug_id): logging.info("Was asked to look at bug %d in Twisted" % bug_id) tb = mysite.customs.bugtrackers.trac.TracBug( bug_id=bug_id, BASE_URL='http://twistedmatrix.com/trac/') bug_url = tb.as_bug_specific_url() # If bug is already in our database, and we looked at # it within the past day... |
banshee_mentors = mysite.profile.views.people_matching('can_mentor', 'Banshee') | banshee_mentors = mysite.profile.controllers.people_matching( 'can_mentor', 'Banshee') | def test(self): '''This test creates: * one person who is listed as able to mentor in Banshee * one person who is not and asks the Banshee project to list its available mentors.''' banshee = Project.create_dummy(name='Banshee') can_mentor, _ = TagType.objects.get_or_create(name='can_mentor') willing_to_mentor_banshee,... |
message = render_to_string('weekly_email_re_projects.txt', context) send_mail("Your weekly OpenHatch horoscope", message, "all@openhatch.org", [person.user.email]) | message_in_plain_text = "(plain text message here)" message_in_html = render_to_string('weekly_email_re_projects.txt', context) print "Emailing %s their weekly project activity." % person.user.email email = EmailMultiAlternatives( subject="Your weekly OpenHatch horoscope", body=message_in_plain_text, from_email="all@op... | def handle(self, *args, **options): |
if not request.user.is_authenticated(): | if request.user.is_authenticated(): data['nudge_location'] = not request.user.get_profile().location_display_name data['nudge_projects'] = not request.user.get_profile().dataimportattempt_set.all() data['nudge_tags'] = not request.user.get_profile().get_tags_for_recommendations() data['show_nudge_box'] = (data['nudg... | def landing_page(request): data = {} data['entries'] = mysite.customs.feed.cached_blog_entries()[:3] recommended_bugs = [] if request.user.is_authenticated(): suggested_searches = request.user.get_profile().get_recommended_search_terms() recommended_bugs = mysite.profile.controllers.recommend_bugs(suggested_searches,... |
else: data['nudge_location'] = not request.user.get_profile().location_display_name data['nudge_projects'] = not request.user.get_profile().dataimportattempt_set.all() data['nudge_tags'] = not request.user.get_profile().get_tags_for_recommendations() data['show_nudge_box'] = (data['nudge_location'] or data['nudge_pr... | def landing_page(request): data = {} data['entries'] = mysite.customs.feed.cached_blog_entries()[:3] recommended_bugs = [] if request.user.is_authenticated(): suggested_searches = request.user.get_profile().get_recommended_search_terms() recommended_bugs = mysite.profile.controllers.recommend_bugs(suggested_searches,... | |
person=Person.get_by_username(username)) | person=Person.get_by_username(username), is_published=True) | def create_pfe_with_description(username): return PortfolioEntry.create_dummy(project=project, person=Person.get_by_username(username)) |
callable = bugzilla_trackers[bugzilla_tracker] | call_me = bugzilla_trackers[bugzilla_tracker] call_me() | def update_bugzilla_trackers(self): bugzilla_trackers = { 'Miro': mysite.customs.miro.grab_miro_bugs, 'KDE junior jobs': mysite.customs.bugtrackers.kde.grab, 'Wikimedia easy bugs': mysite.customs.bugtrackers.wikimedia.grab, 'GNOME Love': mysite.customs.bugtrackers.gnome_love.grab, |
else: | if not data['recommended_bugs']: | def landing_page(request): data = {} data['entries'] = mysite.customs.feed.cached_blog_entries()[:3] recommended_bugs = [] if request.user.is_authenticated(): suggested_searches = request.user.get_profile().get_recommended_search_terms() recommended_bugs = mysite.profile.controllers.recommend_bugs(suggested_searches,... |
url = models.URLField(max_length=300, unique=True, | url = models.URLField(max_length=200, unique=True, | def create_from_http_error(error): return None |
if 'center' in request.GET: | if request.GET.get('center', False): | def people_map(request): data = {} data['people'] = Person.objects.all().order_by('user__username') data['person_id2data_as_json'] = simplejson.dumps(dict([ (person.pk, {'name': person.get_full_name_or_username(), 'location': person.location_display_name}) for person in Person.objects.all() if person.location_display_n... |
if data['center_json'] == 'null' or not data['center_json']: data['center_json'] = False | if data['center_json'] == 'null': data['geocode_failed'] = True; | def people_map(request): data = {} data['people'] = Person.objects.all().order_by('user__username') data['person_id2data_as_json'] = simplejson.dumps(dict([ (person.pk, {'name': person.get_full_name_or_username(), 'location': person.location_display_name}) for person in Person.objects.all() if person.location_display_n... |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_miro_bug_object(self, mock_xml_opener): # Parse XML document as if we got it from the web mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
bugzilla_tracker=miro_tracker | tracker=miro_tracker, | def test_miro_bug_object(self, mock_xml_opener): # Parse XML document as if we got it from the web mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
bitesized_text='bitesized' ) | bitesized_text='bitesized', documentation_type='key', ) | def test_full_grab_miro_bugs(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
bugzilla_tracker=miro_tracker | tracker=miro_tracker, | def test_full_grab_miro_bugs(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_miro_bugzilla_detects_closedness(self, mock_xml_opener): cooked_xml = open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read().replace( 'NEW', 'CLOSED') mock_xml_opener.return_value = lxml.etree.XML(cooked_xml) |
bugzilla_tracker=miro_tracker | tracker=miro_tracker | def test_miro_bugzilla_detects_closedness(self, mock_xml_opener): cooked_xml = open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read().replace( 'NEW', 'CLOSED') mock_xml_opener.return_value = lxml.etree.XML(cooked_xml) |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_full_grab_resolved_miro_bug(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06-RESOLVED.xml')).read()) |
bugzilla_tracker=miro_tracker | tracker=miro_tracker | def test_full_grab_resolved_miro_bug(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06-RESOLVED.xml')).read()) |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_full_grab_miro_bugs_refreshes_older_bugs(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) miro_tracker = mysite.customs.models.BugzillaTracker( project_name='Miro', base_url='http://bugzilla.pcultur... |
bugzilla_tracker=miro_tracker | tracker=miro_tracker | def test_full_grab_miro_bugs_refreshes_older_bugs(self, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) miro_tracker = mysite.customs.models.BugzillaTracker( project_name='Miro', base_url='http://bugzilla.pcultur... |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_regrab_miro_bugs_refreshes_older_bugs_even_when_missing_from_csv(self, mock_xml_bug_tree, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
bugzilla_tracker=miro_tracker | tracker=miro_tracker | def test_regrab_miro_bugs_refreshes_older_bugs_even_when_missing_from_csv(self, mock_xml_bug_tree, mock_xml_opener): mock_xml_opener.return_value = lxml.etree.XML(open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read()) |
self.create_bug_object_for_remote_bug_id_if_necessary(bug_id=bug_id) | self.create_bug_object_for_remote_bug_id_if_necessary(remote_bug_id=bug_id) | def update(self): '''Call this nightly.''' logging.info("Learning about new bugs in %s" % self.project.name) |
[toughness_option_any] | toughness_option_any | def test_toughness_facet(self): # What options do we expect? toughness_option_bitesize = {'name': 'bitesize', 'count': 1, 'is_active': False, 'query_string': 'q=screensaver&toughness=bitesize'} toughness_option_any = {'name': 'any', 'count': 3, 'is_active': True, 'query_string': 'q=screensaver&toughness='} expected_tou... |
self.compare_lists_of_dicts( | self.assertEqual( | def test_toughness_facet(self): # What options do we expect? toughness_option_bitesize = {u'name': u'bitesize', u'count': 1, u'is_active': False, u'query_string': u'q=&toughness=bitesize&language=Python'} toughness_option_any = {u'name': u'any', u'count': 2, u'is_active': True, u'query_string': u'q=&toughness=&language... |
[toughness_option_any] | toughness_option_any | def test_toughness_facet(self): # What options do we expect? toughness_option_bitesize = {u'name': u'bitesize', u'count': 1, u'is_active': False, u'query_string': u'q=&toughness=bitesize&language=Python'} toughness_option_any = {u'name': u'any', u'count': 2, u'is_active': True, u'query_string': u'q=&toughness=&language... |
self.compare_lists_of_dicts( | self.assertEqual( | def test_languages_facet(self): # What options do we expect? languages_option_python = {u'name': u'Python', u'count': 2, u'is_active': True, u'query_string': u'q=&language=Python'} languages_option_perl = {u'name': u'Perl', u'count': 1, u'is_active': False, u'query_string': u'q=&language=Perl'} languages_option_c = {u'... |
[languages_option_any], | languages_option_any, | def test_languages_facet(self): # What options do we expect? languages_option_python = {u'name': u'Python', u'count': 2, u'is_active': True, u'query_string': u'q=&language=Python'} languages_option_perl = {u'name': u'Perl', u'count': 1, u'is_active': False, u'query_string': u'q=&language=Perl'} languages_option_c = {u'... |
for lp_bug in mysite.search.models.Bug.all_bugs.filter( canonical_bug_link__startswith='https://bugs.launchpad.net/'): refresh_one_launchpad_bug.apply( | all_lp_bugs = mysite.search.models.Bug.all_bugs.filter( canonical_bug_link__startswith='https://bugs.launchpad.net/') logging.info("All %d of them." % all_lp_bugs.count()) for lp_bug in all_lp_bugs: refresh_one_launchpad_bug( | def refresh_all_launchpad_bugs(): logging.info("Refreshing all Launchpad bugs.") for lp_bug in mysite.search.models.Bug.all_bugs.filter( canonical_bug_link__startswith='https://bugs.launchpad.net/'): refresh_one_launchpad_bug.apply( canonical_bug_link=lp_bug.canonical_bug_link, openhatch_project_name=None) |
def __init__(self, base_url, project_name, bitesized_keyword): | def __init__(self, base_url, project_name, bitesized_keyword, bug_project_name_format): | def __init__(self, base_url, project_name, bitesized_keyword): self.base_url = base_url self.project_name = project_name self.bitesized_keyword = bitesized_keyword |
project_from_name, _ = mysite.search.models.Project.objects.get_or_create(name=self.project_name) | project_from_name, _ = mysite.search.models.Project.objects.get_or_create(name=self.generate_bug_project_name(tb)) | def refresh_one_bug_id(self, bug_id): tb = mysite.customs.bugtrackers.trac.TracBug( bug_id=bug_id, BASE_URL=self.base_url, bitesized_keyword=self.bitesized_keyword) bug_url = tb.as_bug_specific_url() try: bug = mysite.search.models.Bug.all_bugs.get( canonical_bug_link=bug_url) except mysite.search.models.Bug.DoesNotEx... |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Tahoe-LAFS', base_url='http://tahoe-lafs.org/trac/tahoe-lafs/', bitesized_keyword='easy') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Twisted', base_url='http://twistedmatrix.com/trac/', bitesized_keyword='easy') |
bitesized_keyword='sugar-love') | bitesized_keyword='sugar-love', bug_project_name_format='{component}') | def __init__(self): TracBugTracker.__init__(self, project_name='Sugar Labs', base_url='http://bugs.sugarlabs.org/', bitesized_keyword='sugar-love') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='StatusNet', base_url='http://status.net/trac/', bitesized_keyword='easy') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Xiph', base_url='http://trac.xiph.org/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time |
enabled = True | enabled = False | def generate_list_of_bug_ids_to_look_at(self): # Only gives a list of bitesized bugs - confirm if devels want all bugs indexed return mysite.customs.bugtrackers.trac.csv_url2list_of_bug_ids( mysite.customs.bugtrackers.trac.csv_of_bugs( 'https://trac.xiph.org/query?status=assigned&status=new&status=reopened&order=priori... |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='OLPC', base_url='http://dev.laptop.org/', bitesized_keyword='easy') # Also uses 'sugar-love'. |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Django', base_url='http://code.djangoproject.com/', bitesized_keyword='easy') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='HelenOS', base_url='http://trac.helenos.org/trac.fcgi/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Bcfg2', base_url='https://trac.mcs.anl.gov/projects/bcfg2/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time |
bitesized_keyword='papercut') | bitesized_keyword='papercut', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='WarFoundry', base_url='http://dev.ibboard.co.uk/projects/warfoundry/', bitesized_keyword='papercut') |
bitesized_keyword='') | bitesized_keyword='', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Fedora Python Modules', base_url='https://fedorahosted.org/python-fedora/', bitesized_keyword='') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Angband', base_url='http://trac.rephial.org/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time |
bitesized_keyword='Easy (less than 1 hour)') | bitesized_keyword='Easy (less than 1 hour)', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='GHC', base_url='http://hackage.haskell.org/trac/ghc/', bitesized_keyword='Easy (less than 1 hour)') # FIXME: Does OH support spaces in keywords? |
bitesized_keyword='bitesized') | bitesized_keyword='bitesized', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Trac', base_url='http://trac.edgewall.org/', bitesized_keyword='bitesized') |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='SSSD', base_url='https://fedorahosted.org/sssd/', bitesized_keyword='easy') # They actually use the 'trivial' priority setting |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='I2P', base_url='http://trac.i2p2.de/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time |
bitesized_keyword='') | bitesized_keyword='', bug_project_name_format='') | def __init__(self): TracBugTracker.__init__(self, project_name='', base_url='', bitesized_keyword='') |
for person in Person.objects.all(): | for person in mysite.profile.models.Person.objects.all(): | def fill_recommended_bugs_cache(): logging.info("Filling recommended bugs cache for all people.") for person in Person.objects.all(): suggested_searches = person.get_recommended_search_terms() # expensive? recommended_bugs = mysite.profile.controllers.recommend_bugs(suggested_searches, n=5) # cache fill logging.info("F... |
current_xml_bug_tree = self.get_current_xml_bug_tree() for bug_data in current_xml_bug_tree.xpath('bug'): | for bug_data in self.generate_current_bug_xml(): | def update(self): logging.info("[Bugzilla] Started refreshing all %s bugs" % self.project_name) |
def get_current_xml_bug_tree(self): return mysite.customs.bugtrackers.bugzilla.url2bug_data( 'http://bugzilla.pculture.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field-1-0-0=bug_status&field-1-1-0=product&field-1-2-0=keywords&keywords=bitesized&product=Miro&query_format=advanced&remaction=&t... | def generate_current_bug_xml(self): queries = { 'Easy bugs': 'http://bugzilla.pculture.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field-1-0-0=bug_status&field-1-1-0=product&field-1-2-0=keywords&keywords=bitesized&product=Miro&query_format=advanced&remaction=&type-1-0-0=anyexact&type-1-1-0=an... | def get_current_xml_bug_tree(self): return mysite.customs.bugtrackers.bugzilla.url2bug_data( 'http://bugzilla.pculture.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field-1-0-0=bug_status&field-1-1-0=product&field-1-2-0=keywords&keywords=bitesized&product=Miro&query_format=advanced&remaction=&t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.