def test_related_links(self): response = self.app.get('/wiki/TEST/').follow() assert 'Edit TEST' in response assert 'Related' not in response self.app.post('/wiki/TEST/update', params={ 'title': 'TEST', 'text': 'sometext', 'labels': '', 'viewable_by-0.id': 'all'}) self.app.post('/wiki/aaa/update', params={ 'title': 'aaa', 'text': '', 'labels': '', 'viewable_by-0.id': 'all'}) self.app.post('/wiki/bbb/update', params={ 'title': 'bbb', 'text': '', 'labels': '', 'viewable_by-0.id': 'all'}) h.set_context('test', 'wiki', neighborhood='Projects') a = model.Page.query.find(dict(title='aaa')).first() a.text = '\n[TEST]\n' b = model.Page.query.find(dict(title='TEST')).first() b.text = '\n[bbb]\n' ThreadLocalORMSession.flush_all() M.MonQTask.run_ready() ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() response = self.app.get('/wiki/TEST/') assert 'Related' in response assert 'aaa' in response assert 'bbb' in response
def test_ticket_move_with_different_custom_fields(self): app1 = c.project.app_instance('bugs') app2 = c.project.app_instance('bugs2') app1.globals.custom_fields.extend([ {'name': '_test', 'type': 'string', 'label': 'Test field'}, {'name': '_test2', 'type': 'string', 'label': 'Test field 2'}]) app2.globals.custom_fields.append( {'name': '_test', 'type': 'string', 'label': 'Test field'}) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() with h.push_context(c.project._id, app_config_id=app1.config._id): ticket = Ticket.new() ticket.summary = 'test ticket' ticket.description = 'test description' ticket.custom_fields['_test'] = 'test val' ticket.custom_fields['_test2'] = 'test val 2' t = ticket.move(app2.config) assert_equal(t.summary, 'test ticket') assert_equal(t.description, 'test description') assert_equal(t.custom_fields['_test'], 'test val') post = Post.query.find( dict(thread_id=ticket.discussion_thread._id)).first() assert post is not None, 'No comment about ticket moving' message = 'Ticket moved from /p/test/bugs/1/' message += '\n\nCan\'t be converted:\n' message += '\n- **_test2**: test val 2' assert_equal(post.text, message)
def test_related_links(self): response = self.app.get('/wiki/TEST/').follow() assert 'Edit TEST' in response assert 'Related' not in response self.app.post('/wiki/TEST/update', params={ 'title': 'TEST', 'text': 'sometext', 'labels': '', 'viewable_by-0.id': 'all'}) self.app.post('/wiki/aaa/update', params={ 'title': 'aaa', 'text': '', 'labels': '', 'viewable_by-0.id': 'all'}) self.app.post('/wiki/bbb/update', params={ 'title': 'bbb', 'text': '', 'labels': '', 'viewable_by-0.id': 'all'}) h.set_context('test', 'wiki', neighborhood='Projects') a = model.Page.query.find(dict(title='aaa')).first() a.text = '\n[TEST]\n' b = model.Page.query.find(dict(title='TEST')).first() b.text = '\n[bbb]\n' ThreadLocalORMSession.flush_all() M.MonQTask.run_ready() ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() response = self.app.get('/wiki/TEST/') assert 'Related' in response assert 'aaa' in response assert 'bbb' in response
def test_ticket_move_with_users_not_in_project(self): app1 = c.project.app_instance('bugs') app2 = c.project.app_instance('bugs2') app1.globals.custom_fields.extend([ {'name': '_user_field', 'type': 'user', 'label': 'User field'}, {'name': '_user_field_2', 'type': 'user', 'label': 'User field 2'}]) app2.globals.custom_fields.extend([ {'name': '_user_field', 'type': 'user', 'label': 'User field'}, {'name': '_user_field_2', 'type': 'user', 'label': 'User field 2'}]) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() from allura.websetup import bootstrap bootstrap.create_user('test-user-0') with h.push_context(c.project._id, app_config_id=app1.config._id): ticket = Ticket.new() ticket.summary = 'test ticket' ticket.description = 'test description' ticket.custom_fields['_user_field'] = 'test-user' # in project # not in project ticket.custom_fields['_user_field_2'] = 'test-user-0' # not in project ticket.assigned_to_id = User.by_username('test-user-0')._id t = ticket.move(app2.config) assert_equal(t.assigned_to_id, None) assert_equal(t.custom_fields['_user_field'], 'test-user') assert_equal(t.custom_fields['_user_field_2'], '') post = Post.query.find( dict(thread_id=ticket.discussion_thread._id)).first() assert post is not None, 'No comment about ticket moving' message = 'Ticket moved from /p/test/bugs/1/' message += '\n\nCan\'t be converted:\n' message += '\n- **_user_field_2**: test-user-0 (user not in project)' message += '\n- **assigned_to**: test-user-0 (user not in project)' assert_equal(post.text, message)
def test_ticket_move_with_users_not_in_project(self): app1 = c.project.app_instance('bugs') app2 = c.project.app_instance('bugs2') app1.globals.custom_fields.extend([ {'name': '_user_field', 'type': 'user', 'label': 'User field'}, {'name': '_user_field_2', 'type': 'user', 'label': 'User field 2'}]) app2.globals.custom_fields.extend([ {'name': '_user_field', 'type': 'user', 'label': 'User field'}, {'name': '_user_field_2', 'type': 'user', 'label': 'User field 2'}]) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() from allura.websetup import bootstrap bootstrap.create_user('test-user-0') with h.push_context(c.project._id, app_config_id=app1.config._id): ticket = Ticket.new() ticket.summary = 'test ticket' ticket.description = 'test description' ticket.custom_fields['_user_field'] = 'test-user' # in project ticket.custom_fields['_user_field_2'] = 'test-user-0' # not in project ticket.assigned_to_id = User.by_username('test-user-0')._id # not in project t = ticket.move(app2.config) assert_equal(t.assigned_to_id, None) assert_equal(t.custom_fields['_user_field'], 'test-user') assert_equal(t.custom_fields['_user_field_2'], '') post = Post.query.find(dict(thread_id=ticket.discussion_thread._id)).first() assert post is not None, 'No comment about ticket moving' message = 'Ticket moved from /p/test/bugs/1/' message += '\n\nCan\'t be converted:\n' message += '\n- **_user_field_2**: test-user-0 (user not in project)' message += '\n- **assigned_to**: test-user-0 (user not in project)' assert_equal(post.text, message)
def test_ticket_move_with_different_custom_fields(self): app1 = c.project.app_instance('bugs') app2 = c.project.app_instance('bugs2') app1.globals.custom_fields.extend([ {'name': '_test', 'type': 'string', 'label': 'Test field'}, {'name': '_test2', 'type': 'string', 'label': 'Test field 2'}]) app2.globals.custom_fields.append( {'name': '_test', 'type': 'string', 'label': 'Test field'}) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() with h.push_context(c.project._id, app_config_id=app1.config._id): ticket = Ticket.new() ticket.summary = 'test ticket' ticket.description = 'test description' ticket.custom_fields['_test'] = 'test val' ticket.custom_fields['_test2'] = 'test val 2' t = ticket.move(app2.config) assert_equal(t.summary, 'test ticket') assert_equal(t.description, 'test description') assert_equal(t.custom_fields['_test'], 'test val') post = Post.query.find(dict(thread_id=ticket.discussion_thread._id)).first() assert post is not None, 'No comment about ticket moving' message = 'Ticket moved from /p/test/bugs/1/' message += '\n\nCan\'t be converted:\n' message += '\n- **_test2**: test val 2' assert_equal(post.text, message)
def setUp(): g._push_object(Globals()) c._push_object(mock.Mock()) request._push_object(Request.blank('/')) ThreadLocalORMSession.close_all() M.EmailAddress.query.remove({}) M.OpenIdNonce.query.remove({}) M.OpenIdAssociation.query.remove({})
def load(self): artifact_orm_session._get().skip_mod_date = True self.load_pages() self.project.notifications_disabled = False artifact_orm_session._get().skip_mod_date = False ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() allura_base.log.info('Loading wiki done')
def main(): M.TroveCategory(trove_cat_id=670, trove_parent_id=14, shortname="agpl", fullname="Affero GNU Public License", fullpath="License :: OSI-Approved Open Source :: Affero GNU Public License") ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): broken_posts = BM.BlogPost.query.find(dict(neighborhood_id=None)).all() for post in broken_posts: c.project = post.app.project c.app = post.app post.neighborhood_id = post.app.project.neighborhood_id ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def load(self): artifact_orm_session._get().skip_mod_date = True self.load_pages() self.project.notifications_disabled = False artifact_orm_session._get().skip_mod_date = False ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() allura_base.log.info('Loading wiki done')
def main(): M.TroveCategory(trove_cat_id=670, trove_parent_id=14, shortname="agpl", fullname="Affero GNU Public License", fullpath="License :: OSI-Approved Open Source :: Affero GNU Public License") ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def setUp(): g._push_object(Globals()) c._push_object(mock.Mock()) request._push_object(Request.blank('/')) ThreadLocalORMSession.close_all() M.EmailAddress.query.remove({}) M.OpenIdNonce.query.remove({}) M.OpenIdAssociation.query.remove({})
def main(): M.TroveCategory(trove_cat_id=862, trove_parent_id=14, shortname="lppl", fullname="LaTeX Project Public License", fullpath="License :: OSI-Approved Open Source :: LaTeX Project Public License") M.TroveCategory(trove_cat_id=655, trove_parent_id=432, shortname="win64", fullname="64-bit MS Windows", fullpath="Operating System :: Grouping and Descriptive Categories :: 64-bit MS Windows") M.TroveCategory(trove_cat_id=657, trove_parent_id=418, shortname="vista", fullname="Vista", fullpath="Operating System :: Modern (Vendor-Supported) Desktop Operating Systems :: Vista") M.TroveCategory(trove_cat_id=851, trove_parent_id=418, shortname="win7", fullname="Windows 7", fullpath="Operating System :: Modern (Vendor-Supported) Desktop Operating Systems :: Windows 7") M.TroveCategory(trove_cat_id=728, trove_parent_id=315, shortname="android", fullname="Android", fullpath="Operating System :: Handheld/Embedded Operating Systems :: Android") M.TroveCategory(trove_cat_id=780, trove_parent_id=315, shortname="ios", fullname="Apple iPhone", fullpath="Operating System :: Handheld/Embedded Operating Systems :: Apple iPhone") M.TroveCategory(trove_cat_id=863, trove_parent_id=534, shortname="architects", fullname="Architects", fullpath="Intended Audience :: by End-User Class :: Architects") M.TroveCategory(trove_cat_id=864, trove_parent_id=534, shortname="auditors", fullname="Auditors", fullpath="Intended Audience :: by End-User Class :: Auditors") M.TroveCategory(trove_cat_id=865, trove_parent_id=534, shortname="testers", fullname="Testers", fullpath="Intended Audience :: by End-User Class :: Testers") M.TroveCategory(trove_cat_id=866, trove_parent_id=534, shortname="secpros", fullname="Security Professionals", fullpath="Intended Audience :: by End-User Class :: Security Professionals") M.TroveCategory(trove_cat_id=867, trove_parent_id=535, shortname="secindustry", fullname="Security", fullpath="Intended Audience :: by Industry or Sector :: Security") ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): M.TroveCategory(trove_cat_id=862, trove_parent_id=14, shortname="lppl", fullname="LaTeX Project Public License", fullpath="License :: OSI-Approved Open Source :: LaTeX Project Public License") M.TroveCategory(trove_cat_id=655, trove_parent_id=432, shortname="win64", fullname="64-bit MS Windows", fullpath="Operating System :: Grouping and Descriptive Categories :: 64-bit MS Windows") M.TroveCategory(trove_cat_id=657, trove_parent_id=418, shortname="vista", fullname="Vista", fullpath="Operating System :: Modern (Vendor-Supported) Desktop Operating Systems :: Vista") M.TroveCategory(trove_cat_id=851, trove_parent_id=418, shortname="win7", fullname="Windows 7", fullpath="Operating System :: Modern (Vendor-Supported) Desktop Operating Systems :: Windows 7") M.TroveCategory(trove_cat_id=728, trove_parent_id=315, shortname="android", fullname="Android", fullpath="Operating System :: Handheld/Embedded Operating Systems :: Android") M.TroveCategory(trove_cat_id=780, trove_parent_id=315, shortname="ios", fullname="Apple iPhone", fullpath="Operating System :: Handheld/Embedded Operating Systems :: Apple iPhone") M.TroveCategory(trove_cat_id=863, trove_parent_id=534, shortname="architects", fullname="Architects", fullpath="Intended Audience :: by End-User Class :: Architects") M.TroveCategory(trove_cat_id=864, trove_parent_id=534, shortname="auditors", fullname="Auditors", fullpath="Intended Audience :: by End-User Class :: Auditors") M.TroveCategory(trove_cat_id=865, trove_parent_id=534, shortname="testers", fullname="Testers", fullpath="Intended Audience :: by End-User Class :: Testers") M.TroveCategory(trove_cat_id=866, trove_parent_id=534, shortname="secpros", fullname="Security Professionals", fullpath="Intended Audience :: by End-User Class :: Security Professionals") M.TroveCategory(trove_cat_id=867, trove_parent_id=535, shortname="secindustry", fullname="Security", fullpath="Intended Audience :: by Industry or Sector :: Security") ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def setUp(): controller = TestController() controller.setUp() controller.app.get('/wiki/Home/') setup_global_objects() ThreadLocalORMSession.close_all() h.set_context('test', 'wiki', neighborhood='Projects') ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): M.TroveCategory(trove_cat_id=905, trove_parent_id=14, shortname='mpl20', fullname='Mozilla Public License 2.0 (MPL 2.0)', fullpath='License :: OSI-Approved Open Source :: Mozilla Public License 2.0 (MPL 2.0)') ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def wrapped(*args, **kw): user = M.User.by_username(username) c.user = user n = M.Neighborhood.query.get(name='Users') shortname = 'u/' + username p = M.Project.query.get(shortname=shortname, neighborhood_id=n._id) if not p: n.register_project(shortname, user=user, user_project=True) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() return func(*args, **kw)
def wrapped(*args, **kw): user = M.User.by_username(username) c.user = user n = M.Neighborhood.query.get(name='Users') shortname = 'u/' + username p = M.Project.query.get(shortname=shortname, neighborhood_id=n._id) if not p: n.register_project(shortname, user=user, user_project=True) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() return func(*args, **kw)
def main(): M.TroveCategory( trove_cat_id=905, trove_parent_id=14, shortname='mpl20', fullname='Mozilla Public License 2.0 (MPL 2.0)', fullpath= 'License :: OSI-Approved Open Source :: Mozilla Public License 2.0 (MPL 2.0)' ) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def test_touch(self): self.new_ticket(summary='test touch') h.set_context('test', 'bugs', neighborhood='Projects') ticket = tm.Ticket.query.get(ticket_num=1) old_date = ticket.mod_date ticket.summary = 'changing the summary' time.sleep(1) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() ticket = tm.Ticket.query.get(ticket_num=1) new_date = ticket.mod_date assert new_date > old_date
def main(): update_trove_cat(16, dict(fullname="GNU Library or Lesser General Public License version 2.0 (LGPLv2)", fullpath="License :: OSI-Approved Open Source :: GNU Library or Lesser General Public License version 2.0 (LGPLv2)")) update_trove_cat(15, dict(fullname="GNU General Public License version 2.0 (GPLv2)", fullpath="License :: OSI-Approved Open Source :: GNU General Public License version 2.0 (GPLv2)")) update_trove_cat(670, dict(trove_cat_id=628, fullname="Affero GNU Public License")) create_trove_cat((868,13,"ccal","Creative Commons Attribution License","License :: Creative Commons Attribution License")) create_trove_cat((869,868,"ccaslv2","Creative Commons Attribution ShareAlike License V2.0","License :: Creative Commons Attribution License :: Creative Commons Attribution ShareAlike License V2.0")) create_trove_cat((870,868,"ccaslv3","Creative Commons Attribution ShareAlike License V3.0","License :: Creative Commons Attribution License :: Creative Commons Attribution ShareAlike License V3.0")) create_trove_cat((871,868,"ccanclv2","Creative Commons Attribution Non-Commercial License V2.0","License :: Creative Commons Attribution License :: Creative Commons Attribution Non-Commercial License V2.0")) create_trove_cat((680,14,"lgplv3","GNU Library or Lesser General Public License version 3.0 (LGPLv3)","License :: OSI-Approved Open Source :: GNU Library or Lesser General Public License version 3.0 (LGPLv3)")) create_trove_cat((679,14,"gplv3","GNU General Public License version 3.0 (GPLv3)","License :: OSI-Approved Open Source :: GNU General Public License version 3.0 (GPLv3)")) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def wrapped(*args, **kw): c.user = M.User.by_username(username) p = M.Project.query.get(shortname=project_shortname) c.project = p if mount_point and not p.app_instance(mount_point): c.app = p.install_app(ep_name, mount_point, mount_label, ordinal, **override_options) if post_install_hook: post_install_hook(c.app) while M.MonQTask.run_ready('setup'): pass ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() elif mount_point: c.app = p.app_instance(mount_point) return func(*args, **kw)
def test_discussion_methods(): d = M.Discussion(shortname='test', name='test') assert d.thread_class() == M.Thread assert d.post_class() == M.Post assert d.attachment_class() == M.DiscussionAttachment ThreadLocalORMSession.flush_all() d.update_stats() ThreadLocalORMSession.flush_all() assert d.last_post == None assert d.url().endswith('wiki/_discuss/') assert d.index()['name_s'] == 'test' assert d.subscription() == None assert d.find_posts().count() == 0 jsn = d.__json__() assert jsn['name'] == d.name d.delete() ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def test_thread_methods(): d = M.Discussion(shortname='test', name='test') t = M.Thread(discussion_id=d._id, subject='Test Thread') assert t.discussion_class() == M.Discussion assert t.post_class() == M.Post assert t.attachment_class() == M.DiscussionAttachment p0 = t.post('This is a post') p1 = t.post('This is another post') time.sleep(0.25) p2 = t.post('This is a reply', parent_id=p0._id) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() d = M.Discussion.query.get(shortname='test') t = d.threads[0] assert d.last_post is not None assert t.last_post is not None t.create_post_threads(t.posts) posts0 = t.find_posts(page=0, limit=10, style='threaded') posts1 = t.find_posts(page=0, limit=10, style='timestamp') assert posts0 != posts1 ts = p0.timestamp.replace( microsecond=int(p0.timestamp.microsecond // 1000) * 1000) posts2 = t.find_posts(page=0, limit=10, style='threaded', timestamp=ts) assert len(posts2) > 0 assert 'wiki/_discuss/' in t.url() assert t.index()['views_i'] == 0 assert not t.subscription t.subscription = True assert t.subscription t.subscription = False assert not t.subscription assert t.top_level_posts().count() == 2 assert t.post_count == 3 jsn = t.__json__() assert '_id' in jsn assert_equals(len(jsn['posts']), 3) (p.approve() for p in (p0, p1)) assert t.num_replies == 2 t.spam() assert t.num_replies == 0 ThreadLocalORMSession.flush_all() assert len(t.find_posts()) == 0 t.delete()
def test_add_remove_label(self): r = self.app.get('/admin/trove') form = r.forms['label_edit_form'] form['labels'].value = 'foo,bar,baz' with audits('updated labels'): r = form.submit() r = r.follow() p_nbhd = M.Neighborhood.query.get(name='Projects') p = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id) assert p.labels == ['foo', 'bar', 'baz'] assert form['labels'].value == 'foo,bar,baz' ThreadLocalORMSession.close_all() form['labels'].value = 'asdf' with audits('updated labels'): r = form.submit() r = r.follow() p = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id) assert_equals(p.labels, ['asdf']) assert form['labels'].value == 'asdf'
def test_add_remove_label(self): r = self.app.get('/admin/trove') form = r.forms['label_edit_form'] form['labels'].value = 'foo,bar,baz' with audits('updated labels'): r = form.submit() r = r.follow() p_nbhd = M.Neighborhood.query.get(name='Projects') p = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id) assert p.labels == ['foo', 'bar', 'baz'] assert form['labels'].value == 'foo,bar,baz' ThreadLocalORMSession.close_all() form['labels'].value = 'asdf' with audits('updated labels'): r = form.submit() r = r.follow() p = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id) assert_equals(p.labels, ['asdf']) assert form['labels'].value == 'asdf'
def wrapped(*args, **kw): c.user = M.User.by_username(username) p = M.Project.query.get(shortname=project_shortname) c.project = p if mount_point and not p.app_instance(mount_point): c.app = p.install_app(ep_name, mount_point, mount_label, ordinal, **override_options) if post_install_hook: post_install_hook(c.app) if asbool(tg.config.get('smtp.mock')): smtp_mock = patch('allura.lib.mail_util.smtplib.SMTP') else: smtp_mock = NullContextManager() with smtp_mock: while M.MonQTask.run_ready('setup'): pass ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() elif mount_point: c.app = p.app_instance(mount_point) return func(*args, **kw)
def main(): test = sys.argv[-1] == 'test' num_projects_examined = 0 log.info('Examining all projects for mount order.') for some_projects in utils.chunked_find(M.Project): for project in some_projects: c.project = project mounts = project.ordered_mounts(include_hidden=True) # ordered_mounts() means duplicate ordinals (if any) will be next # to each other duplicates_found = False prev_ordinal = None for mount in mounts: if mount['ordinal'] == prev_ordinal: duplicates_found = True break prev_ordinal = mount['ordinal'] if duplicates_found: if test: log.info('Would renumber mounts for project "%s".' % project.shortname) else: log.info('Renumbering mounts for project "%s".' % project.shortname) for i, mount in enumerate(mounts): if 'ac' in mount: mount['ac'].options['ordinal'] = i elif 'sub' in mount: mount['sub'].ordinal = i ThreadLocalORMSession.flush_all() num_projects_examined += 1 session(project).clear() log.info('%s projects examined.' % num_projects_examined) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): test = sys.argv[-1] == 'test' num_projects_examined = 0 log.info('Examining all projects for mount order.') for some_projects in utils.chunked_find(M.Project): for project in some_projects: c.project = project mounts = project.ordered_mounts(include_hidden=True) # ordered_mounts() means duplicate ordinals (if any) will be next # to each other duplicates_found = False prev_ordinal = None for mount in mounts: if mount['ordinal'] == prev_ordinal: duplicates_found = True break prev_ordinal = mount['ordinal'] if duplicates_found: if test: log.info('Would renumber mounts for project "%s".' % project.shortname) else: log.info('Renumbering mounts for project "%s".' % project.shortname) for i, mount in enumerate(mounts): if 'ac' in mount: mount['ac'].options['ordinal'] = i elif 'sub' in mount: mount['sub'].ordinal = i ThreadLocalORMSession.flush_all() num_projects_examined += 1 session(project).clear() log.info('%s projects examined.' % num_projects_examined) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def wrapped(*args, **kw): c.user = M.User.by_username(username) p = M.Project.query.get(shortname=project_shortname) c.project = p if mount_point and not p.app_instance(mount_point): c.app = p.install_app(ep_name, mount_point, mount_label, ordinal, **override_options) if post_install_hook: post_install_hook(c.app) if asbool(tg.config.get('smtp.mock')): smtp_mock = patch('allura.lib.mail_util.smtplib.SMTP') else: smtp_mock = NullContextManager() with smtp_mock: while M.MonQTask.run_ready('setup'): pass ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() elif mount_point: c.app = p.app_instance(mount_point) return func(*args, **kw)
def main(): create_trove_cat((639,14,"cpal","Common Public Attribution License 1.0 (CPAL)","License :: OSI-Approved Open Source :: Common Public Attribution License 1.0 (CPAL)")) create_trove_cat((640,99,"dvd","DVD","Topic :: Multimedia :: DVD")) create_trove_cat((641,576,"workflow","Workflow","Topic :: Office/Business :: Enterprise :: Workflow")) create_trove_cat((642,292,"linuxdrivers","Linux","Topic :: System :: Hardware :: Hardware Drivers :: Linux")) create_trove_cat((643,582,"uml","UML","Topic :: Software Development :: Design :: UML")) create_trove_cat((644,92,"cms","CMS Systems","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CMS Systems")) create_trove_cat((645,92,"blogging","Blogging","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Blogging")) create_trove_cat((646,52,"subversion","Subversion","Topic :: Software Development :: Version Control :: Subversion")) create_trove_cat((647,612,"webservices","Web Services","Topic :: Formats and Protocols :: Protocols :: Web Services")) create_trove_cat((648,554,"json","JSON","Topic :: Formats and Protocols :: Data Formats :: JSON")) create_trove_cat((649,100,"imagegalleries","Image Galleries","Topic :: Multimedia :: Graphics :: Image Galleries")) create_trove_cat((650,612,"ajax","AJAX","Topic :: Formats and Protocols :: Protocols :: AJAX")) create_trove_cat((651,92,"wiki","Wiki","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki")) create_trove_cat((652,45,"appservers","Application Servers","Topic :: Software Development :: Application Servers")) create_trove_cat((653,20,"rssreaders","RSS Feed Readers","Topic :: Communications :: RSS Feed Readers")) create_trove_cat((654,129,"ecommerce","E-Commerce / Shopping","Topic :: Office/Business :: E-Commerce / Shopping")) create_trove_cat((656,99,"htpc","Home Theater PC","Topic :: Multimedia :: Home Theater PC")) create_trove_cat((658,22,"jabber","Jabber","Topic :: Communications :: Chat :: Jabber")) create_trove_cat((659,576,"enterprisebpm","Business Performance Management","Topic :: Office/Business :: Enterprise :: Business Performance Management")) create_trove_cat((660,576,"enterprisebi","Business Intelligence","Topic :: Office/Business :: Enterprise :: Business Intelligence")) create_trove_cat((661,75,"budgetingandforecasting","Budgeting and Forecasting","Topic :: Office/Business :: Financial :: Budgeting and Forecasting")) create_trove_cat((662,497,"ingres","Ingres","Database Environment :: Network-based DBMS :: Ingres")) create_trove_cat((663,92,"socialnetworking","Social Networking","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Social Networking")) create_trove_cat((664,199,"virtualization","Virtualization","Operating System :: Virtualization")) create_trove_cat((665,664,"vmware","VMware","Operating System :: Virtualization :: VMware")) create_trove_cat((666,664,"xen","Xen","Operating System :: Virtualization :: Xen")) create_trove_cat((667,247,"voip","VoIP","Topic :: Communications :: Telephony :: VoIP")) create_trove_cat((668,92,"ticketing","Ticketing Systems","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Ticketing Systems")) create_trove_cat((669,315,"blackberryos","Blackberry RIM OS","Operating System :: Handheld/Embedded Operating Systems :: Blackberry RIM OS")) create_trove_cat((671,14,"ms-pl","Microsoft Public License","License :: OSI-Approved Open Source :: Microsoft Public License")) create_trove_cat((672,14,"ms-rl","Microsoft Reciprocal License","License :: OSI-Approved Open Source :: Microsoft Reciprocal License")) create_trove_cat((673,576,"bsm","Business Service Management","Topic :: Office/Business :: Enterprise :: Business Service Management")) create_trove_cat((674,673,"servicesupport","Service Support","Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Support")) create_trove_cat((675,673,"serviceassurance","Service Assurance","Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Assurance")) create_trove_cat((676,673,"serviceautomation","Service Automation","Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Automation")) create_trove_cat((677,14,"artisticv2","Artistic License 2.0","License :: OSI-Approved Open Source :: Artistic License 2.0")) create_trove_cat((678,14,"boostlicense","Boost Software License (BSL1.0)","License :: OSI-Approved Open Source :: Boost Software License (BSL1.0)")) create_trove_cat((679,14,"gplv3","GNU General Public License version 3.0 (GPLv3)","License :: OSI-Approved Open Source :: GNU General Public License version 3.0 (GPLv3)")) create_trove_cat((680,14,"lgplv3","GNU Library or ""Lesser"" General Public License version 3.0 (LGPLv3)","License :: OSI-Approved Open Source :: GNU Library or ""Lesser"" General Public License version 3.0 (LGPLv3)")) create_trove_cat((681,14,"isclicense","ISC License","License :: OSI-Approved Open Source :: ISC License")) create_trove_cat((682,14,"multicslicense","Multics License","License :: OSI-Approved Open Source :: Multics License")) create_trove_cat((683,14,"ntplicense","NTP License","License :: OSI-Approved Open Source :: NTP License")) create_trove_cat((684,14,"nposl3","Non-Profit Open Software License 3.0 (Non-Profit OSL 3.0)","License :: OSI-Approved Open Source :: Non-Profit Open Software License 3.0 (Non-Profit OSL 3.0)")) create_trove_cat((685,14,"rpl15","Reciprocal Public License 1.5 (RPL1.5)","License :: OSI-Approved Open Source :: Reciprocal Public License 1.5 (RPL1.5)")) create_trove_cat((686,14,"splicense2","Simple Public License 2.0","License :: OSI-Approved Open Source :: Simple Public License 2.0")) create_trove_cat((687,673,"cmdb","Configuration Management Database (CMDB)","Topic :: Office/Business :: Enterprise :: Business Service Management :: Configuration Management Database (CMDB)")) create_trove_cat((688,18,"mobileapps","Mobile","Topic :: Mobile")) create_trove_cat((689,315,"winmobile","Windows Mobile","Operating System :: Handheld/Embedded Operating Systems :: Windows Mobile")) create_trove_cat((690,315,"brew","BREW (Binary Runtime Environment for Wireless)","Operating System :: Handheld/Embedded Operating Systems :: BREW (Binary Runtime Environment for Wireless)")) create_trove_cat((691,315,"j2me","J2ME (Java Platform, Micro Edition)","Operating System :: Handheld/Embedded Operating Systems :: J2ME (Java Platform, Micro Edition)")) create_trove_cat((692,315,"maemo","Maemo","Operating System :: Handheld/Embedded Operating Systems :: Maemo")) create_trove_cat((693,315,"limo","LiMo (Linux Mobile)","Operating System :: Handheld/Embedded Operating Systems :: LiMo (Linux Mobile)")) create_trove_cat((694,160,"clean","Clean","Programming Language :: Clean")) create_trove_cat((695,160,"lasso","Lasso","Programming Language :: Lasso")) create_trove_cat((696,160,"turing","Turing","Programming Language :: Turing")) create_trove_cat((697,160,"glsl","GLSL (OpenGL Shading Language)","Programming Language :: GLSL (OpenGL Shading Language)")) create_trove_cat((698,160,"lazarus","Lazarus","Programming Language :: Lazarus")) create_trove_cat((699,160,"freepascal","Free Pascal","Programming Language :: Free Pascal")) create_trove_cat((700,160,"scriptol","Scriptol","Programming Language :: Scriptol")) create_trove_cat((701,160,"pl-i","PL/I (Programming Language One)","Programming Language :: PL/I (Programming Language One)")) create_trove_cat((702,160,"oz","Oz","Programming Language :: Oz")) create_trove_cat((703,160,"limbo","Limbo","Programming Language :: Limbo")) create_trove_cat((704,160,"scala","Scala","Programming Language :: Scala")) create_trove_cat((705,160,"blitzmax","BlitzMax","Programming Language :: BlitzMax")) create_trove_cat((706,160,"xbaseclipper","XBase/Clipper","Programming Language :: XBase/Clipper")) create_trove_cat((707,160,"curl","Curl","Programming Language :: Curl")) create_trove_cat((708,160,"flex","Flex","Programming Language :: Flex")) create_trove_cat((709,160,"mathematica","Mathematica","Programming Language :: Mathematica")) create_trove_cat((710,160,"visualdataflex","Visual DataFlex","Programming Language :: Visual DataFlex")) create_trove_cat((711,160,"fenix","Fenix","Programming Language :: Fenix")) create_trove_cat((713,456,"vexi","Vexi","User Interface :: Graphical :: Vexi")) create_trove_cat((714,160,"kaya","Kaya","Programming Language :: Kaya")) create_trove_cat((715,160,"transcript-revolution","Transcript/Revolution","Programming Language :: Transcript/Revolution")) create_trove_cat((716,160,"haXe","haXe","Programming Language :: haXe")) create_trove_cat((717,160,"proglangmeta","Project is a programming language","Programming Language :: Project is a programming language")) create_trove_cat((718,634,"msxb360","Microsoft Xbox 360","Operating System :: Other Operating Systems :: Console-based Platforms :: Microsoft Xbox 360")) create_trove_cat((719,634,"nintendogc","Nintendo GameCube","Operating System :: Other Operating Systems :: Console-based Platforms :: Nintendo GameCube")) create_trove_cat((720,634,"nintendowii","Nintendo Wii","Operating System :: Other Operating Systems :: Console-based Platforms :: Nintendo Wii")) create_trove_cat((721,634,"sonyps3","Sony PlayStation 3","Operating System :: Other Operating Systems :: Console-based Platforms :: Sony PlayStation 3")) create_trove_cat((722,634,"sonypsp","Sony PlayStation Portable (PSP)","Operating System :: Other Operating Systems :: Console-based Platforms :: Sony PlayStation Portable (PSP)")) create_trove_cat((723,160,"scilab","Scilab","Programming Language :: Scilab")) create_trove_cat((724,160,"scicos","Scicos","Programming Language :: Scicos")) create_trove_cat((725,534,"management","Management","Intended Audience :: by End-User Class :: Management")) create_trove_cat((726,71,"edadministration","Administration","Topic :: Education :: Administration")) create_trove_cat((727,97,"mechcivileng","Mechanical and Civil Engineering","Topic :: Scientific/Engineering :: Mechanical and Civil Engineering")) create_trove_cat((729,535,"audienceengineering","Engineering","Intended Audience :: by Industry or Sector :: Engineering")) create_trove_cat((730,274,"basque","Basque (Euskara)","Translations :: Basque (Euskara)")) create_trove_cat((731,14,"classpath","GNU General Public License with Classpath exception (Classpath::License)","License :: OSI-Approved Open Source :: GNU General Public License with Classpath exception (Classpath::License)")) create_trove_cat((732,727,"caddcam","Computer-aided technologies (CADD/CAM/CAE)","Topic :: Scientific/Engineering :: Mechanical and Civil Engineering :: Computer-aided technologies (CADD/CAM/CAE)")) create_trove_cat((733,576,"humanresources","Human Resources","Topic :: Office/Business :: Enterprise :: Human Resources")) create_trove_cat((734,554,"mcml","Media Center Markup Language (MCML)","Topic :: Formats and Protocols :: Data Formats :: Media Center Markup Language (MCML)")) create_trove_cat((735,461,"nsis","Nullsoft Scriptable Install System (NSIS)","User Interface :: Plugins :: Nullsoft Scriptable Install System (NSIS)")) create_trove_cat((736,97,"scada","SCADA","Topic :: Scientific/Engineering :: SCADA")) create_trove_cat((737,461,"autohotkey","AutoHotkey","User Interface :: Plugins :: AutoHotkey")) create_trove_cat((738,160,"autoit","AutoIt","Programming Language :: AutoIt")) create_trove_cat((739,132,"humanitarianism","Humanitarianism","Topic :: Religion and Philosophy :: Humanitarianism")) create_trove_cat((740,129,"insurance","Insurance","Topic :: Office/Business :: Insurance")) create_trove_cat((741,97,"linguistics","Linguistics","Topic :: Scientific/Engineering :: Linguistics")) create_trove_cat((742,741,"machinetranslation","Machine Translation","Topic :: Scientific/Engineering :: Linguistics :: Machine Translation")) create_trove_cat((743,43,"antispam","Anti-Spam","Topic :: Security :: Anti-Spam")) create_trove_cat((744,43,"antivirus","Anti-Virus","Topic :: Security :: Anti-Virus")) create_trove_cat((745,43,"antimalware","Anti-Malware","Topic :: Security :: Anti-Malware")) create_trove_cat((746,554,"autocaddxf","AutoCAD DXF","Topic :: Formats and Protocols :: Data Formats :: AutoCAD DXF")) create_trove_cat((747,75,"billing","Billing","Topic :: Office/Business :: Financial :: Billing")) create_trove_cat((748,576,"processmanagement","Business Process Management","Topic :: Office/Business :: Enterprise :: Business Process Management")) create_trove_cat((749,136,"embedded","Embedded systems","Topic :: System :: Embedded systems")) create_trove_cat((750,456,"magicui","Magic User Interface (MUI)","User Interface :: Graphical :: Magic User Interface (MUI)")) create_trove_cat((751,237,"xul","XUL","User Interface :: Web-based :: XUL")) create_trove_cat((752,80,"flightsim","Flight simulator","Topic :: Games/Entertainment :: Flight simulator")) create_trove_cat((753,63,"vivim","Vi/Vim","Topic :: Text Editors :: Vi/Vim")) create_trove_cat((754,45,"sourceanalysis","Source code analysis","Topic :: Software Development :: Source code analysis")) create_trove_cat((755,45,"sourcebrowsing","Source code browsing","Topic :: Software Development :: Source code browsing")) create_trove_cat((756,576,"plm","Product lifecycle management (PLM)","Topic :: Office/Business :: Enterprise :: Product lifecycle management (PLM)")) create_trove_cat((757,274,"breton","Breton","Translations :: Breton")) create_trove_cat((758,498,"db4o","db4objects (db4o)","Database Environment :: File-based DBMS :: db4objects (db4o)")) create_trove_cat((759,497,"nexusdb","NexusDB","Database Environment :: Network-based DBMS :: NexusDB")) create_trove_cat((760,160,"prism","Prism","Programming Language :: Prism")) create_trove_cat((761,45,"collaborative","Collaborative development tools","Topic :: Software Development :: Collaborative development tools")) create_trove_cat((762,91,"pluginsaddons","Plugins and add-ons","Topic :: Internet :: WWW/HTTP :: Browsers :: Plugins and add-ons")) create_trove_cat((763,456,"winaero","Windows Aero","User Interface :: Graphical :: Windows Aero")) create_trove_cat((764,45,"agile","Agile development tools","Topic :: Software Development :: Agile development tools")) create_trove_cat((765,535,"agriculture","Agriculture","Intended Audience :: by Industry or Sector :: Agriculture")) create_trove_cat((766,100,"animation","Animation","Topic :: Multimedia :: Graphics :: Animation")) create_trove_cat((767,45,"assemblers","Assemblers","Topic :: Software Development :: Assemblers")) create_trove_cat((768,535,"automotive","Automotive","Intended Audience :: by Industry or Sector :: Automotive")) create_trove_cat((769,554,"CSV","Comma-separated values (CSV)","Topic :: Formats and Protocols :: Data Formats :: Comma-separated values (CSV)")) create_trove_cat((770,45,"softdevlibraries","Libraries","Topic :: Software Development :: Libraries")) create_trove_cat((771,45,"sourcereview","Source code review","Topic :: Software Development :: Source code review")) create_trove_cat((772,80,"hobbies","Hobbies","Topic :: Games/Entertainment :: Hobbies")) create_trove_cat((773,772,"collectionmanage","Collection management","Topic :: Games/Entertainment :: Hobbies :: Collection management")) create_trove_cat((774,80,"multiplayer","Multiplayer","Topic :: Games/Entertainment :: Multiplayer")) create_trove_cat((775,80,"mmorpg","MMORPG","Topic :: Games/Entertainment :: MMORPG")) create_trove_cat((776,97,"mapping","Mapping","Topic :: Scientific/Engineering :: Mapping")) create_trove_cat((777,776,"gps","GPS (Global Positioning System)","Topic :: Scientific/Engineering :: Mapping :: GPS (Global Positioning System)")) create_trove_cat((778,43,"passwordmanage","Password manager","Topic :: Security :: Password manager")) create_trove_cat((779,315,"linksyswrt54g","Linksys WRT54G series","Operating System :: Handheld/Embedded Operating Systems :: Linksys WRT54G series")) create_trove_cat((781,576,"medhealth","Medical/Healthcare","Topic :: Office/Business :: Enterprise :: Medical/Healthcare")) create_trove_cat((782,45,"bined","Binary editors","Topic :: Software Development :: Binary editors")) create_trove_cat((783,99,"mmcatalog","Cataloguing","Topic :: Multimedia :: Cataloguing")) create_trove_cat((784,113,"composition","Composition","Topic :: Multimedia :: Sound/Audio :: Composition")) create_trove_cat((785,772,"cooking","Cooking","Topic :: Games/Entertainment :: Hobbies :: Cooking")) create_trove_cat((786,136,"cron","Cron and scheduling","Topic :: System :: Cron and scheduling")) create_trove_cat((787,638,"recovery","Data recovery","Topic :: System :: Storage :: Data recovery")) create_trove_cat((788,87,"otherfile","Other file transfer protocol","Topic :: Internet :: Other file transfer protocol")) create_trove_cat((789,581,"digpreserve","Digital preservation","Topic :: Education :: Library :: Digital preservation")) create_trove_cat((790,251,"directconnect","Direct Connect","Topic :: Communications :: File Sharing :: Direct Connect")) create_trove_cat((791,129,"dtp","Desktop Publishing","Topic :: Office/Business :: Desktop Publishing")) create_trove_cat((792,580,"etl","ETL","Topic :: Office/Business :: Enterprise :: Data Warehousing :: ETL")) create_trove_cat((793,55,"fonts","Fonts","Topic :: Desktop Environment :: Fonts")) create_trove_cat((794,80,"gameframeworks","Game development framework","Topic :: Games/Entertainment :: Game development framework")) create_trove_cat((795,100,"handrec","Handwriting recognition","Topic :: Multimedia :: Graphics :: Handwriting recognition")) create_trove_cat((796,136,"homeauto","Home Automation","Topic :: System :: Home Automation")) create_trove_cat((797,63,"translation","Computer Aided Translation (CAT)","Topic :: Text Editors :: Computer Aided Translation (CAT)")) create_trove_cat((798,136,"osdistro","OS distribution","Topic :: System :: OS distribution")) create_trove_cat((799,798,"livecd","Live CD","Topic :: System :: OS distribution :: Live CD")) create_trove_cat((800,497,"lotusnotes","Lotus Notes/Domino","Database Environment :: Network-based DBMS :: Lotus Notes/Domino")) create_trove_cat((801,160,"lotusscript","LotusScript","Programming Language :: LotusScript")) create_trove_cat((802,133,"machinelearning","Machine Learning","Topic :: Scientific/Engineering :: Artificial Intelligence :: Machine Learning")) create_trove_cat((803,106,"metadata","Metadata editors","Topic :: Multimedia :: Graphics :: Editors :: Metadata editors")) create_trove_cat((804,236,"riscos","RISC OS","Operating System :: Other Operating Systems :: RISC OS")) create_trove_cat((805,282,"politics","Politics","Topic :: Social sciences :: Politics")) create_trove_cat((806,80,"sports","Sports","Topic :: Games/Entertainment :: Sports")) create_trove_cat((807,282,"psychology","Psychology","Topic :: Social sciences :: Psychology")) create_trove_cat((808,458,"ogre3d","Ogre3D","User Interface :: Toolkits/Libraries :: Ogre3D")) create_trove_cat((809,45,"orm","ORM (Object-relational mapping)","Topic :: Software Development :: ORM (Object-relational mapping)")) create_trove_cat((810,575,"perftest","Performance Testing","Topic :: Software Development :: Testing :: Performance Testing")) create_trove_cat((811,75,"personalfinance","Personal finance","Topic :: Office/Business :: Financial :: Personal finance")) create_trove_cat((812,499,"pearmdb2","PHP Pear::MDB2","Database Environment :: Database API :: PHP Pear::MDB2")) create_trove_cat((813,461,"intellij","IntelliJ","User Interface :: Plugins :: IntelliJ")) create_trove_cat((814,554,"postscript","PostScript","Topic :: Formats and Protocols :: Data Formats :: PostScript")) create_trove_cat((815,100,"fractals","Fractals and Procedural Generation","Topic :: Multimedia :: Graphics :: Fractals and Procedural Generation")) create_trove_cat((816,554,"w3cvoice","W3C Voice","Topic :: Formats and Protocols :: Data Formats :: W3C Voice")) create_trove_cat((817,97,"quantumcomp","Quantum Computing","Topic :: Scientific/Engineering :: Quantum Computing")) create_trove_cat((818,129,"reportgen","Report Generators","Topic :: Office/Business :: Report Generators")) create_trove_cat((819,581,"research","Research","Topic :: Education :: Library :: Research")) create_trove_cat((820,87,"ssh","SSH (Secure SHell)","Topic :: Internet :: SSH (Secure SHell)")) create_trove_cat((821,554,"semantic","Semantic Web (RDF, OWL, etc.)","Topic :: Formats and Protocols :: Data Formats :: Semantic Web (RDF, OWL, etc.)")) create_trove_cat((822,90,"socialbookmarking","Social Bookmarking","Topic :: Internet :: WWW/HTTP :: Social Bookmarking")) create_trove_cat((823,20,"synchronization","Synchronization","Topic :: Communications :: Synchronization")) create_trove_cat((824,45,"templates","Templates","Topic :: Software Development :: Templates")) create_trove_cat((825,97,"testmeasure","Test and Measurement","Topic :: Scientific/Engineering :: Test and Measurement")) create_trove_cat((826,98,"statistics","Statistics","Topic :: Scientific/Engineering :: Mathematics :: Statistics")) create_trove_cat((827,129,"knowledgemanagement","Knowledge Management","Topic :: Office/Business :: Knowledge Management")) create_trove_cat((828,147,"unattended","Unattended","Topic :: System :: Installation/Setup :: Unattended")) create_trove_cat((829,457,"emailinterface","Email-based interface","User Interface :: Textual :: Email-based interface")) create_trove_cat((830,282,"voting","Voting","Topic :: Social sciences :: Voting")) create_trove_cat((831,27,"webconferencing","Web Conferencing","Topic :: Communications :: Conferencing :: Web Conferencing")) create_trove_cat((832,27,"videoconferencing","Video Conferencing","Topic :: Communications :: Conferencing :: Video Conferencing")) create_trove_cat((833,160,"objectivec2","Objective-C 2.0","Programming Language :: Objective-C 2.0")) create_trove_cat((834,274,"georgian","Georgian","Translations :: Georgian")) create_trove_cat((835,499,"adonet","ADO.NET","Database Environment :: Database API :: ADO.NET")) create_trove_cat((836,554,"xbrl","XBRL","Topic :: Formats and Protocols :: Data Formats :: XBRL")) create_trove_cat((837,461,"excel","Excel","User Interface :: Plugins :: Excel")) create_trove_cat((838,160,"visualbasicforapplications","Visual Basic for Applications (VBA)","Programming Language :: Visual Basic for Applications (VBA)")) create_trove_cat((839,160,"booprogramminglang","Boo","Programming Language :: Boo")) create_trove_cat((840,52,"git","Git","Topic :: Software Development :: Version Control :: Git")) create_trove_cat((841,52,"mercurial","Mercurial","Topic :: Software Development :: Version Control :: Mercurial")) create_trove_cat((842,52,"bazaar","Bazaar","Topic :: Software Development :: Version Control :: Bazaar")) create_trove_cat((843,14,"eupublicense","European Union Public License","License :: OSI-Approved Open Source :: European Union Public License")) create_trove_cat((844,14,"ipafontlicense","IPA Font License","License :: OSI-Approved Open Source :: IPA Font License")) create_trove_cat((845,14,"miroslicense","MirOS License","License :: OSI-Approved Open Source :: MirOS License")) create_trove_cat((846,14,"openfontlicense11","Open Font License 1.1 (OFL 1.1)","License :: OSI-Approved Open Source :: Open Font License 1.1 (OFL 1.1)")) create_trove_cat((847,80,"realtimetactical","Real Time Tactical","Topic :: Games/Entertainment :: Real Time Tactical")) create_trove_cat((848,160,"algol68","ALGOL 68","Programming Language :: ALGOL 68")) create_trove_cat((849,92,"groupware","Groupware","Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Groupware")) create_trove_cat((850,576,"businesscontinuity","Business Continuity","Topic :: Office/Business :: Enterprise :: Business Continuity")) create_trove_cat((852,554,"teiformat","TEI","Topic :: Formats and Protocols :: Data Formats :: TEI")) create_trove_cat((853,160,"clarion","Clarion","Programming Language :: Clarion")) create_trove_cat((854,576,"sales","Sales","Topic :: Office/Business :: Enterprise :: Sales")) create_trove_cat((855,97,"buildingauto","Building Automation","Topic :: Scientific/Engineering :: Building Automation")) create_trove_cat((856,129,"businessmodelling","Modelling","Topic :: Office/Business :: Modelling")) create_trove_cat((857,150,"routing","Routing","Topic :: System :: Networking :: Routing")) create_trove_cat((858,97,"medicalphysics","Medical Physics","Topic :: Scientific/Engineering :: Medical Physics")) create_trove_cat((859,71,"edlanguage","Languages","Topic :: Education :: Languages")) create_trove_cat((860,97,"molecularmech","Molecular Mechanics","Topic :: Scientific/Engineering :: Molecular Mechanics")) create_trove_cat((861,148,"loganalysis","Log Analysis","Topic :: System :: Logging :: Log Analysis")) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def setUp(): setup_basic_test() ThreadLocalORMSession.close_all() setup_global_objects()
def tearDown(self): ThreadLocalORMSession.close_all()
def main(): u = M.User.query.get(username='******') u.display_name = 'Anonymous' ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): create_trove_cat(( 639, 14, "cpal", "Common Public Attribution License 1.0 (CPAL)", "License :: OSI-Approved Open Source :: Common Public Attribution License 1.0 (CPAL)" )) create_trove_cat((640, 99, "dvd", "DVD", "Topic :: Multimedia :: DVD")) create_trove_cat((641, 576, "workflow", "Workflow", "Topic :: Office/Business :: Enterprise :: Workflow")) create_trove_cat( (642, 292, "linuxdrivers", "Linux", "Topic :: System :: Hardware :: Hardware Drivers :: Linux")) create_trove_cat((643, 582, "uml", "UML", "Topic :: Software Development :: Design :: UML")) create_trove_cat( (644, 92, "cms", "CMS Systems", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CMS Systems")) create_trove_cat( (645, 92, "blogging", "Blogging", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Blogging")) create_trove_cat( (646, 52, "subversion", "Subversion", "Topic :: Software Development :: Version Control :: Subversion")) create_trove_cat( (647, 612, "webservices", "Web Services", "Topic :: Formats and Protocols :: Protocols :: Web Services")) create_trove_cat( (648, 554, "json", "JSON", "Topic :: Formats and Protocols :: Data Formats :: JSON")) create_trove_cat((649, 100, "imagegalleries", "Image Galleries", "Topic :: Multimedia :: Graphics :: Image Galleries")) create_trove_cat((650, 612, "ajax", "AJAX", "Topic :: Formats and Protocols :: Protocols :: AJAX")) create_trove_cat( (651, 92, "wiki", "Wiki", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki")) create_trove_cat((652, 45, "appservers", "Application Servers", "Topic :: Software Development :: Application Servers")) create_trove_cat((653, 20, "rssreaders", "RSS Feed Readers", "Topic :: Communications :: RSS Feed Readers")) create_trove_cat((654, 129, "ecommerce", "E-Commerce / Shopping", "Topic :: Office/Business :: E-Commerce / Shopping")) create_trove_cat((656, 99, "htpc", "Home Theater PC", "Topic :: Multimedia :: Home Theater PC")) create_trove_cat((658, 22, "jabber", "Jabber", "Topic :: Communications :: Chat :: Jabber")) create_trove_cat(( 659, 576, "enterprisebpm", "Business Performance Management", "Topic :: Office/Business :: Enterprise :: Business Performance Management" )) create_trove_cat( (660, 576, "enterprisebi", "Business Intelligence", "Topic :: Office/Business :: Enterprise :: Business Intelligence")) create_trove_cat( (661, 75, "budgetingandforecasting", "Budgeting and Forecasting", "Topic :: Office/Business :: Financial :: Budgeting and Forecasting")) create_trove_cat((662, 497, "ingres", "Ingres", "Database Environment :: Network-based DBMS :: Ingres")) create_trove_cat(( 663, 92, "socialnetworking", "Social Networking", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Social Networking" )) create_trove_cat((664, 199, "virtualization", "Virtualization", "Operating System :: Virtualization")) create_trove_cat((665, 664, "vmware", "VMware", "Operating System :: Virtualization :: VMware")) create_trove_cat( (666, 664, "xen", "Xen", "Operating System :: Virtualization :: Xen")) create_trove_cat((667, 247, "voip", "VoIP", "Topic :: Communications :: Telephony :: VoIP")) create_trove_cat(( 668, 92, "ticketing", "Ticketing Systems", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Ticketing Systems" )) create_trove_cat(( 669, 315, "blackberryos", "Blackberry RIM OS", "Operating System :: Handheld/Embedded Operating Systems :: Blackberry RIM OS" )) create_trove_cat( (671, 14, "ms-pl", "Microsoft Public License", "License :: OSI-Approved Open Source :: Microsoft Public License")) create_trove_cat(( 672, 14, "ms-rl", "Microsoft Reciprocal License", "License :: OSI-Approved Open Source :: Microsoft Reciprocal License")) create_trove_cat(( 673, 576, "bsm", "Business Service Management", "Topic :: Office/Business :: Enterprise :: Business Service Management" )) create_trove_cat(( 674, 673, "servicesupport", "Service Support", "Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Support" )) create_trove_cat(( 675, 673, "serviceassurance", "Service Assurance", "Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Assurance" )) create_trove_cat(( 676, 673, "serviceautomation", "Service Automation", "Topic :: Office/Business :: Enterprise :: Business Service Management :: Service Automation" )) create_trove_cat( (677, 14, "artisticv2", "Artistic License 2.0", "License :: OSI-Approved Open Source :: Artistic License 2.0")) create_trove_cat(( 678, 14, "boostlicense", "Boost Software License (BSL1.0)", "License :: OSI-Approved Open Source :: Boost Software License (BSL1.0)" )) create_trove_cat(( 679, 14, "gplv3", "GNU General Public License version 3.0 (GPLv3)", "License :: OSI-Approved Open Source :: GNU General Public License version 3.0 (GPLv3)" )) create_trove_cat((680, 14, "lgplv3", "GNU Library or " "Lesser" " General Public License version 3.0 (LGPLv3)", "License :: OSI-Approved Open Source :: GNU Library or " "Lesser" " General Public License version 3.0 (LGPLv3)")) create_trove_cat((681, 14, "isclicense", "ISC License", "License :: OSI-Approved Open Source :: ISC License")) create_trove_cat( (682, 14, "multicslicense", "Multics License", "License :: OSI-Approved Open Source :: Multics License")) create_trove_cat((683, 14, "ntplicense", "NTP License", "License :: OSI-Approved Open Source :: NTP License")) create_trove_cat(( 684, 14, "nposl3", "Non-Profit Open Software License 3.0 (Non-Profit OSL 3.0)", "License :: OSI-Approved Open Source :: Non-Profit Open Software License 3.0 (Non-Profit OSL 3.0)" )) create_trove_cat(( 685, 14, "rpl15", "Reciprocal Public License 1.5 (RPL1.5)", "License :: OSI-Approved Open Source :: Reciprocal Public License 1.5 (RPL1.5)" )) create_trove_cat( (686, 14, "splicense2", "Simple Public License 2.0", "License :: OSI-Approved Open Source :: Simple Public License 2.0")) create_trove_cat(( 687, 673, "cmdb", "Configuration Management Database (CMDB)", "Topic :: Office/Business :: Enterprise :: Business Service Management :: Configuration Management Database (CMDB)" )) create_trove_cat((688, 18, "mobileapps", "Mobile", "Topic :: Mobile")) create_trove_cat(( 689, 315, "winmobile", "Windows Mobile", "Operating System :: Handheld/Embedded Operating Systems :: Windows Mobile" )) create_trove_cat(( 690, 315, "brew", "BREW (Binary Runtime Environment for Wireless)", "Operating System :: Handheld/Embedded Operating Systems :: BREW (Binary Runtime Environment for Wireless)" )) create_trove_cat(( 691, 315, "j2me", "J2ME (Java Platform, Micro Edition)", "Operating System :: Handheld/Embedded Operating Systems :: J2ME (Java Platform, Micro Edition)" )) create_trove_cat( (692, 315, "maemo", "Maemo", "Operating System :: Handheld/Embedded Operating Systems :: Maemo")) create_trove_cat(( 693, 315, "limo", "LiMo (Linux Mobile)", "Operating System :: Handheld/Embedded Operating Systems :: LiMo (Linux Mobile)" )) create_trove_cat( (694, 160, "clean", "Clean", "Programming Language :: Clean")) create_trove_cat( (695, 160, "lasso", "Lasso", "Programming Language :: Lasso")) create_trove_cat( (696, 160, "turing", "Turing", "Programming Language :: Turing")) create_trove_cat( (697, 160, "glsl", "GLSL (OpenGL Shading Language)", "Programming Language :: GLSL (OpenGL Shading Language)")) create_trove_cat( (698, 160, "lazarus", "Lazarus", "Programming Language :: Lazarus")) create_trove_cat((699, 160, "freepascal", "Free Pascal", "Programming Language :: Free Pascal")) create_trove_cat( (700, 160, "scriptol", "Scriptol", "Programming Language :: Scriptol")) create_trove_cat( (701, 160, "pl-i", "PL/I (Programming Language One)", "Programming Language :: PL/I (Programming Language One)")) create_trove_cat((702, 160, "oz", "Oz", "Programming Language :: Oz")) create_trove_cat( (703, 160, "limbo", "Limbo", "Programming Language :: Limbo")) create_trove_cat( (704, 160, "scala", "Scala", "Programming Language :: Scala")) create_trove_cat( (705, 160, "blitzmax", "BlitzMax", "Programming Language :: BlitzMax")) create_trove_cat((706, 160, "xbaseclipper", "XBase/Clipper", "Programming Language :: XBase/Clipper")) create_trove_cat( (707, 160, "curl", "Curl", "Programming Language :: Curl")) create_trove_cat( (708, 160, "flex", "Flex", "Programming Language :: Flex")) create_trove_cat((709, 160, "mathematica", "Mathematica", "Programming Language :: Mathematica")) create_trove_cat((710, 160, "visualdataflex", "Visual DataFlex", "Programming Language :: Visual DataFlex")) create_trove_cat( (711, 160, "fenix", "Fenix", "Programming Language :: Fenix")) create_trove_cat( (713, 456, "vexi", "Vexi", "User Interface :: Graphical :: Vexi")) create_trove_cat( (714, 160, "kaya", "Kaya", "Programming Language :: Kaya")) create_trove_cat( (715, 160, "transcript-revolution", "Transcript/Revolution", "Programming Language :: Transcript/Revolution")) create_trove_cat( (716, 160, "haXe", "haXe", "Programming Language :: haXe")) create_trove_cat( (717, 160, "proglangmeta", "Project is a programming language", "Programming Language :: Project is a programming language")) create_trove_cat(( 718, 634, "msxb360", "Microsoft Xbox 360", "Operating System :: Other Operating Systems :: Console-based Platforms :: Microsoft Xbox 360" )) create_trove_cat(( 719, 634, "nintendogc", "Nintendo GameCube", "Operating System :: Other Operating Systems :: Console-based Platforms :: Nintendo GameCube" )) create_trove_cat(( 720, 634, "nintendowii", "Nintendo Wii", "Operating System :: Other Operating Systems :: Console-based Platforms :: Nintendo Wii" )) create_trove_cat(( 721, 634, "sonyps3", "Sony PlayStation 3", "Operating System :: Other Operating Systems :: Console-based Platforms :: Sony PlayStation 3" )) create_trove_cat(( 722, 634, "sonypsp", "Sony PlayStation Portable (PSP)", "Operating System :: Other Operating Systems :: Console-based Platforms :: Sony PlayStation Portable (PSP)" )) create_trove_cat( (723, 160, "scilab", "Scilab", "Programming Language :: Scilab")) create_trove_cat( (724, 160, "scicos", "Scicos", "Programming Language :: Scicos")) create_trove_cat((725, 534, "management", "Management", "Intended Audience :: by End-User Class :: Management")) create_trove_cat((726, 71, "edadministration", "Administration", "Topic :: Education :: Administration")) create_trove_cat(( 727, 97, "mechcivileng", "Mechanical and Civil Engineering", "Topic :: Scientific/Engineering :: Mechanical and Civil Engineering")) create_trove_cat( (729, 535, "audienceengineering", "Engineering", "Intended Audience :: by Industry or Sector :: Engineering")) create_trove_cat((730, 274, "basque", "Basque (Euskara)", "Translations :: Basque (Euskara)")) create_trove_cat(( 731, 14, "classpath", "GNU General Public License with Classpath exception (Classpath::License)", "License :: OSI-Approved Open Source :: GNU General Public License with Classpath exception (Classpath::License)" )) create_trove_cat(( 732, 727, "caddcam", "Computer-aided technologies (CADD/CAM/CAE)", "Topic :: Scientific/Engineering :: Mechanical and Civil Engineering :: Computer-aided technologies (CADD/CAM/CAE)" )) create_trove_cat( (733, 576, "humanresources", "Human Resources", "Topic :: Office/Business :: Enterprise :: Human Resources")) create_trove_cat(( 734, 554, "mcml", "Media Center Markup Language (MCML)", "Topic :: Formats and Protocols :: Data Formats :: Media Center Markup Language (MCML)" )) create_trove_cat(( 735, 461, "nsis", "Nullsoft Scriptable Install System (NSIS)", "User Interface :: Plugins :: Nullsoft Scriptable Install System (NSIS)" )) create_trove_cat((736, 97, "scada", "SCADA", "Topic :: Scientific/Engineering :: SCADA")) create_trove_cat((737, 461, "autohotkey", "AutoHotkey", "User Interface :: Plugins :: AutoHotkey")) create_trove_cat( (738, 160, "autoit", "AutoIt", "Programming Language :: AutoIt")) create_trove_cat((739, 132, "humanitarianism", "Humanitarianism", "Topic :: Religion and Philosophy :: Humanitarianism")) create_trove_cat((740, 129, "insurance", "Insurance", "Topic :: Office/Business :: Insurance")) create_trove_cat((741, 97, "linguistics", "Linguistics", "Topic :: Scientific/Engineering :: Linguistics")) create_trove_cat(( 742, 741, "machinetranslation", "Machine Translation", "Topic :: Scientific/Engineering :: Linguistics :: Machine Translation" )) create_trove_cat( (743, 43, "antispam", "Anti-Spam", "Topic :: Security :: Anti-Spam")) create_trove_cat((744, 43, "antivirus", "Anti-Virus", "Topic :: Security :: Anti-Virus")) create_trove_cat((745, 43, "antimalware", "Anti-Malware", "Topic :: Security :: Anti-Malware")) create_trove_cat( (746, 554, "autocaddxf", "AutoCAD DXF", "Topic :: Formats and Protocols :: Data Formats :: AutoCAD DXF")) create_trove_cat((747, 75, "billing", "Billing", "Topic :: Office/Business :: Financial :: Billing")) create_trove_cat(( 748, 576, "processmanagement", "Business Process Management", "Topic :: Office/Business :: Enterprise :: Business Process Management" )) create_trove_cat((749, 136, "embedded", "Embedded systems", "Topic :: System :: Embedded systems")) create_trove_cat( (750, 456, "magicui", "Magic User Interface (MUI)", "User Interface :: Graphical :: Magic User Interface (MUI)")) create_trove_cat( (751, 237, "xul", "XUL", "User Interface :: Web-based :: XUL")) create_trove_cat((752, 80, "flightsim", "Flight simulator", "Topic :: Games/Entertainment :: Flight simulator")) create_trove_cat( (753, 63, "vivim", "Vi/Vim", "Topic :: Text Editors :: Vi/Vim")) create_trove_cat((754, 45, "sourceanalysis", "Source code analysis", "Topic :: Software Development :: Source code analysis")) create_trove_cat((755, 45, "sourcebrowsing", "Source code browsing", "Topic :: Software Development :: Source code browsing")) create_trove_cat(( 756, 576, "plm", "Product lifecycle management (PLM)", "Topic :: Office/Business :: Enterprise :: Product lifecycle management (PLM)" )) create_trove_cat((757, 274, "breton", "Breton", "Translations :: Breton")) create_trove_cat( (758, 498, "db4o", "db4objects (db4o)", "Database Environment :: File-based DBMS :: db4objects (db4o)")) create_trove_cat((759, 497, "nexusdb", "NexusDB", "Database Environment :: Network-based DBMS :: NexusDB")) create_trove_cat( (760, 160, "prism", "Prism", "Programming Language :: Prism")) create_trove_cat( (761, 45, "collaborative", "Collaborative development tools", "Topic :: Software Development :: Collaborative development tools")) create_trove_cat( (762, 91, "pluginsaddons", "Plugins and add-ons", "Topic :: Internet :: WWW/HTTP :: Browsers :: Plugins and add-ons")) create_trove_cat((763, 456, "winaero", "Windows Aero", "User Interface :: Graphical :: Windows Aero")) create_trove_cat( (764, 45, "agile", "Agile development tools", "Topic :: Software Development :: Agile development tools")) create_trove_cat( (765, 535, "agriculture", "Agriculture", "Intended Audience :: by Industry or Sector :: Agriculture")) create_trove_cat((766, 100, "animation", "Animation", "Topic :: Multimedia :: Graphics :: Animation")) create_trove_cat((767, 45, "assemblers", "Assemblers", "Topic :: Software Development :: Assemblers")) create_trove_cat( (768, 535, "automotive", "Automotive", "Intended Audience :: by Industry or Sector :: Automotive")) create_trove_cat(( 769, 554, "CSV", "Comma-separated values (CSV)", "Topic :: Formats and Protocols :: Data Formats :: Comma-separated values (CSV)" )) create_trove_cat((770, 45, "softdevlibraries", "Libraries", "Topic :: Software Development :: Libraries")) create_trove_cat((771, 45, "sourcereview", "Source code review", "Topic :: Software Development :: Source code review")) create_trove_cat((772, 80, "hobbies", "Hobbies", "Topic :: Games/Entertainment :: Hobbies")) create_trove_cat( (773, 772, "collectionmanage", "Collection management", "Topic :: Games/Entertainment :: Hobbies :: Collection management")) create_trove_cat((774, 80, "multiplayer", "Multiplayer", "Topic :: Games/Entertainment :: Multiplayer")) create_trove_cat((775, 80, "mmorpg", "MMORPG", "Topic :: Games/Entertainment :: MMORPG")) create_trove_cat((776, 97, "mapping", "Mapping", "Topic :: Scientific/Engineering :: Mapping")) create_trove_cat(( 777, 776, "gps", "GPS (Global Positioning System)", "Topic :: Scientific/Engineering :: Mapping :: GPS (Global Positioning System)" )) create_trove_cat((778, 43, "passwordmanage", "Password manager", "Topic :: Security :: Password manager")) create_trove_cat(( 779, 315, "linksyswrt54g", "Linksys WRT54G series", "Operating System :: Handheld/Embedded Operating Systems :: Linksys WRT54G series" )) create_trove_cat( (781, 576, "medhealth", "Medical/Healthcare", "Topic :: Office/Business :: Enterprise :: Medical/Healthcare")) create_trove_cat((782, 45, "bined", "Binary editors", "Topic :: Software Development :: Binary editors")) create_trove_cat((783, 99, "mmcatalog", "Cataloguing", "Topic :: Multimedia :: Cataloguing")) create_trove_cat((784, 113, "composition", "Composition", "Topic :: Multimedia :: Sound/Audio :: Composition")) create_trove_cat((785, 772, "cooking", "Cooking", "Topic :: Games/Entertainment :: Hobbies :: Cooking")) create_trove_cat((786, 136, "cron", "Cron and scheduling", "Topic :: System :: Cron and scheduling")) create_trove_cat((787, 638, "recovery", "Data recovery", "Topic :: System :: Storage :: Data recovery")) create_trove_cat((788, 87, "otherfile", "Other file transfer protocol", "Topic :: Internet :: Other file transfer protocol")) create_trove_cat((789, 581, "digpreserve", "Digital preservation", "Topic :: Education :: Library :: Digital preservation")) create_trove_cat( (790, 251, "directconnect", "Direct Connect", "Topic :: Communications :: File Sharing :: Direct Connect")) create_trove_cat((791, 129, "dtp", "Desktop Publishing", "Topic :: Office/Business :: Desktop Publishing")) create_trove_cat( (792, 580, "etl", "ETL", "Topic :: Office/Business :: Enterprise :: Data Warehousing :: ETL")) create_trove_cat( (793, 55, "fonts", "Fonts", "Topic :: Desktop Environment :: Fonts")) create_trove_cat( (794, 80, "gameframeworks", "Game development framework", "Topic :: Games/Entertainment :: Game development framework")) create_trove_cat( (795, 100, "handrec", "Handwriting recognition", "Topic :: Multimedia :: Graphics :: Handwriting recognition")) create_trove_cat((796, 136, "homeauto", "Home Automation", "Topic :: System :: Home Automation")) create_trove_cat( (797, 63, "translation", "Computer Aided Translation (CAT)", "Topic :: Text Editors :: Computer Aided Translation (CAT)")) create_trove_cat((798, 136, "osdistro", "OS distribution", "Topic :: System :: OS distribution")) create_trove_cat((799, 798, "livecd", "Live CD", "Topic :: System :: OS distribution :: Live CD")) create_trove_cat( (800, 497, "lotusnotes", "Lotus Notes/Domino", "Database Environment :: Network-based DBMS :: Lotus Notes/Domino")) create_trove_cat((801, 160, "lotusscript", "LotusScript", "Programming Language :: LotusScript")) create_trove_cat(( 802, 133, "machinelearning", "Machine Learning", "Topic :: Scientific/Engineering :: Artificial Intelligence :: Machine Learning" )) create_trove_cat( (803, 106, "metadata", "Metadata editors", "Topic :: Multimedia :: Graphics :: Editors :: Metadata editors")) create_trove_cat( (804, 236, "riscos", "RISC OS", "Operating System :: Other Operating Systems :: RISC OS")) create_trove_cat((805, 282, "politics", "Politics", "Topic :: Social sciences :: Politics")) create_trove_cat((806, 80, "sports", "Sports", "Topic :: Games/Entertainment :: Sports")) create_trove_cat((807, 282, "psychology", "Psychology", "Topic :: Social sciences :: Psychology")) create_trove_cat((808, 458, "ogre3d", "Ogre3D", "User Interface :: Toolkits/Libraries :: Ogre3D")) create_trove_cat( (809, 45, "orm", "ORM (Object-relational mapping)", "Topic :: Software Development :: ORM (Object-relational mapping)")) create_trove_cat( (810, 575, "perftest", "Performance Testing", "Topic :: Software Development :: Testing :: Performance Testing")) create_trove_cat( (811, 75, "personalfinance", "Personal finance", "Topic :: Office/Business :: Financial :: Personal finance")) create_trove_cat( (812, 499, "pearmdb2", "PHP Pear::MDB2", "Database Environment :: Database API :: PHP Pear::MDB2")) create_trove_cat((813, 461, "intellij", "IntelliJ", "User Interface :: Plugins :: IntelliJ")) create_trove_cat( (814, 554, "postscript", "PostScript", "Topic :: Formats and Protocols :: Data Formats :: PostScript")) create_trove_cat(( 815, 100, "fractals", "Fractals and Procedural Generation", "Topic :: Multimedia :: Graphics :: Fractals and Procedural Generation" )) create_trove_cat( (816, 554, "w3cvoice", "W3C Voice", "Topic :: Formats and Protocols :: Data Formats :: W3C Voice")) create_trove_cat((817, 97, "quantumcomp", "Quantum Computing", "Topic :: Scientific/Engineering :: Quantum Computing")) create_trove_cat((818, 129, "reportgen", "Report Generators", "Topic :: Office/Business :: Report Generators")) create_trove_cat((819, 581, "research", "Research", "Topic :: Education :: Library :: Research")) create_trove_cat((820, 87, "ssh", "SSH (Secure SHell)", "Topic :: Internet :: SSH (Secure SHell)")) create_trove_cat(( 821, 554, "semantic", "Semantic Web (RDF, OWL, etc.)", "Topic :: Formats and Protocols :: Data Formats :: Semantic Web (RDF, OWL, etc.)" )) create_trove_cat((822, 90, "socialbookmarking", "Social Bookmarking", "Topic :: Internet :: WWW/HTTP :: Social Bookmarking")) create_trove_cat((823, 20, "synchronization", "Synchronization", "Topic :: Communications :: Synchronization")) create_trove_cat((824, 45, "templates", "Templates", "Topic :: Software Development :: Templates")) create_trove_cat( (825, 97, "testmeasure", "Test and Measurement", "Topic :: Scientific/Engineering :: Test and Measurement")) create_trove_cat( (826, 98, "statistics", "Statistics", "Topic :: Scientific/Engineering :: Mathematics :: Statistics")) create_trove_cat((827, 129, "knowledgemanagement", "Knowledge Management", "Topic :: Office/Business :: Knowledge Management")) create_trove_cat((828, 147, "unattended", "Unattended", "Topic :: System :: Installation/Setup :: Unattended")) create_trove_cat((829, 457, "emailinterface", "Email-based interface", "User Interface :: Textual :: Email-based interface")) create_trove_cat( (830, 282, "voting", "Voting", "Topic :: Social sciences :: Voting")) create_trove_cat( (831, 27, "webconferencing", "Web Conferencing", "Topic :: Communications :: Conferencing :: Web Conferencing")) create_trove_cat( (832, 27, "videoconferencing", "Video Conferencing", "Topic :: Communications :: Conferencing :: Video Conferencing")) create_trove_cat((833, 160, "objectivec2", "Objective-C 2.0", "Programming Language :: Objective-C 2.0")) create_trove_cat( (834, 274, "georgian", "Georgian", "Translations :: Georgian")) create_trove_cat((835, 499, "adonet", "ADO.NET", "Database Environment :: Database API :: ADO.NET")) create_trove_cat( (836, 554, "xbrl", "XBRL", "Topic :: Formats and Protocols :: Data Formats :: XBRL")) create_trove_cat( (837, 461, "excel", "Excel", "User Interface :: Plugins :: Excel")) create_trove_cat( (838, 160, "visualbasicforapplications", "Visual Basic for Applications (VBA)", "Programming Language :: Visual Basic for Applications (VBA)")) create_trove_cat( (839, 160, "booprogramminglang", "Boo", "Programming Language :: Boo")) create_trove_cat( (840, 52, "git", "Git", "Topic :: Software Development :: Version Control :: Git")) create_trove_cat( (841, 52, "mercurial", "Mercurial", "Topic :: Software Development :: Version Control :: Mercurial")) create_trove_cat( (842, 52, "bazaar", "Bazaar", "Topic :: Software Development :: Version Control :: Bazaar")) create_trove_cat( (843, 14, "eupublicense", "European Union Public License", "License :: OSI-Approved Open Source :: European Union Public License" )) create_trove_cat( (844, 14, "ipafontlicense", "IPA Font License", "License :: OSI-Approved Open Source :: IPA Font License")) create_trove_cat((845, 14, "miroslicense", "MirOS License", "License :: OSI-Approved Open Source :: MirOS License")) create_trove_cat(( 846, 14, "openfontlicense11", "Open Font License 1.1 (OFL 1.1)", "License :: OSI-Approved Open Source :: Open Font License 1.1 (OFL 1.1)" )) create_trove_cat((847, 80, "realtimetactical", "Real Time Tactical", "Topic :: Games/Entertainment :: Real Time Tactical")) create_trove_cat( (848, 160, "algol68", "ALGOL 68", "Programming Language :: ALGOL 68")) create_trove_cat( (849, 92, "groupware", "Groupware", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Groupware")) create_trove_cat( (850, 576, "businesscontinuity", "Business Continuity", "Topic :: Office/Business :: Enterprise :: Business Continuity")) create_trove_cat((852, 554, "teiformat", "TEI", "Topic :: Formats and Protocols :: Data Formats :: TEI")) create_trove_cat( (853, 160, "clarion", "Clarion", "Programming Language :: Clarion")) create_trove_cat((854, 576, "sales", "Sales", "Topic :: Office/Business :: Enterprise :: Sales")) create_trove_cat( (855, 97, "buildingauto", "Building Automation", "Topic :: Scientific/Engineering :: Building Automation")) create_trove_cat((856, 129, "businessmodelling", "Modelling", "Topic :: Office/Business :: Modelling")) create_trove_cat((857, 150, "routing", "Routing", "Topic :: System :: Networking :: Routing")) create_trove_cat((858, 97, "medicalphysics", "Medical Physics", "Topic :: Scientific/Engineering :: Medical Physics")) create_trove_cat((859, 71, "edlanguage", "Languages", "Topic :: Education :: Languages")) create_trove_cat( (860, 97, "molecularmech", "Molecular Mechanics", "Topic :: Scientific/Engineering :: Molecular Mechanics")) create_trove_cat((861, 148, "loganalysis", "Log Analysis", "Topic :: System :: Logging :: Log Analysis")) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def tearDown(): ThreadLocalORMSession.close_all()
def exit(self, status): self.project.notifications_disabled = False ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() exit(status)
def setUp(): setup_basic_test() ThreadLocalORMSession.close_all() setup_global_objects()
def setUp(self): setup_basic_test() ThreadLocalORMSession.close_all() setup_global_objects() self.provider = ProjectRegistrationProvider() self.parse = self.provider.project_from_url
def setUp(): setup_unit_test() ThreadLocalORMSession.close_all() M.EmailAddress.query.remove({}) M.OpenIdNonce.query.remove({}) M.OpenIdAssociation.query.remove({})
def setUp(self): setup_basic_test() ThreadLocalORMSession.close_all() setup_global_objects() self.provider = plugin.LocalAuthenticationProvider(Request.blank('/'))
def bootstrap(command, conf, vars): """Place any commands to setup allura here""" # are we being called by the test suite? test_run = conf.get("__file__", "").endswith("test.ini") if not test_run: # when this is run via the `setup-app` cmd, some macro rendering needs this set up REGISTRY.register(ew.widget_context, ew.core.WidgetContext("http", ew.ResourceManager())) create_test_data = asbool(os.getenv("ALLURA_TEST_DATA", True)) # if this is a test_run, skip user project creation to save time make_user_projects = not test_run def make_user(*args, **kw): kw.update(make_project=make_user_projects) return create_user(*args, **kw) # Temporarily disable auth extensions to prevent unintended side-effects tg.config["auth.method"] = tg.config["registration.method"] = "local" assert tg.config["auth.method"] == "local" conf["auth.method"] = conf["registration.method"] = "local" # Clean up all old stuff ThreadLocalORMSession.close_all() c.user = c.project = c.app = None wipe_database() try: g.solr.delete(q="*:*") except: # pragma no cover log.error("SOLR server is %s", g.solr_server) log.error("Error clearing solr index") # set up mongo indexes index = EnsureIndexCommand("ensure_index") index.run([""]) if create_test_data and asbool(conf.get("cache_test_data")): if restore_test_data(): h.set_context("test", neighborhood="Projects") return log.info("Initializing search") log.info("Registering root user & default neighborhoods") M.User(_id=None, username="******", display_name="Anonymous") # never make a user project for the root user if create_test_data: root = create_user("Root", make_project=False) else: from getpass import getpass root_name = raw_input('Enter username for root user (default "root"): ').strip() if not root_name: root_name = "root" ok = False while not ok: root_password1 = getpass("Enter password: "******"Password must not be empty") continue root_password2 = getpass("Confirm password: "******"Passwords don't match") continue root = create_user(root_name, password=root_password1, make_project=False) ok = True n_projects = M.Neighborhood( name="Projects", url_prefix="/p/", features=dict(private_projects=True, max_projects=None, css="none", google_analytics=False), ) n_users = M.Neighborhood( name="Users", url_prefix="/u/", shortname_prefix="u/", anchored_tools="profile:Profile,userstats:Statistics", features=dict(private_projects=True, max_projects=None, css="none", google_analytics=False), ) assert tg.config["auth.method"] == "local" project_reg = plugin.ProjectRegistrationProvider.get() p_projects = project_reg.register_neighborhood_project(n_projects, [root], allow_register=True) p_users = project_reg.register_neighborhood_project(n_users, [root]) def set_nbhd_wiki_content(nbhd_proj, content): wiki = nbhd_proj.app_instance("wiki") page = WM.Page.query.get(app_config_id=wiki.config._id, title=wiki.root_page_name) page.text = content set_nbhd_wiki_content( p_projects, dedent( """ Welcome to the "Projects" neighborhood. It is the default neighborhood in Allura. You can edit this wiki page as you see fit. Here's a few ways to get started: [Register a new project](/p/add_project) [Neighborhood administration](/p/admin) [[projects show_total=yes]] """ ), ) set_nbhd_wiki_content( p_users, dedent( """ This is the "Users" neighborhood. All users automatically get a user-project created for them, using their username. [Neighborhood administration](/u/admin) [[projects show_total=yes]] """ ), ) if create_test_data: n_adobe = M.Neighborhood( name="Adobe", url_prefix="/adobe/", project_list_url="/adobe/", features=dict(private_projects=True, max_projects=None, css="custom", google_analytics=True), ) p_adobe = project_reg.register_neighborhood_project(n_adobe, [root]) set_nbhd_wiki_content( p_adobe, dedent( """ This is the "Adobe" neighborhood. It is just an example of having projects in a different neighborhood. [Neighborhood administration](/adobe/admin) [[projects show_total=yes]] """ ), ) # add the adobe icon file_name = "adobe_icon.png" file_path = os.path.join(allura.__path__[0], "public", "nf", "images", file_name) M.NeighborhoodFile.from_path(file_path, neighborhood_id=n_adobe._id) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() if create_test_data: # Add some test users for unum in range(10): make_user("Test User %d" % unum) log.info("Creating basic project categories") M.ProjectCategory(name="clustering", label="Clustering") cat2 = M.ProjectCategory(name="communications", label="Communications") M.ProjectCategory(name="synchronization", label="Synchronization", parent_id=cat2._id) M.ProjectCategory(name="streaming", label="Streaming", parent_id=cat2._id) M.ProjectCategory(name="fax", label="Fax", parent_id=cat2._id) M.ProjectCategory(name="bbs", label="BBS", parent_id=cat2._id) cat3 = M.ProjectCategory(name="database", label="Database") M.ProjectCategory(name="front_ends", label="Front-Ends", parent_id=cat3._id) M.ProjectCategory(name="engines_servers", label="Engines/Servers", parent_id=cat3._id) if create_test_data: log.info('Registering "regular users" (non-root) and default projects') # since this runs a lot for tests, separate test and default users and # do the minimal needed if asbool(conf.get("load_test_data")): u_admin = make_user("Test Admin") u_admin.preferences = dict(email_address="*****@*****.**") u_admin.email_addresses = ["*****@*****.**"] u_admin.set_password("foo") u_admin.claim_address("*****@*****.**") ThreadLocalORMSession.flush_all() admin_email = M.EmailAddress.get(email="*****@*****.**") admin_email.confirmed = True else: u_admin = make_user("Admin 1", username="******") # Admin1 is almost root, with admin access for Users and Projects # neighborhoods p_projects.add_user(u_admin, ["Admin"]) p_users.add_user(u_admin, ["Admin"]) n_projects.register_project("allura", u_admin, "Allura") make_user("Test User") n_adobe.register_project("adobe-1", u_admin, "Adobe project 1") p_adobe.add_user(u_admin, ["Admin"]) p0 = n_projects.register_project("test", u_admin, "Test Project") n_projects.register_project("test2", u_admin, "Test 2") p0._extra_tool_status = ["alpha", "beta"] sess = session(M.Neighborhood) # all the sessions are the same _list = (n_projects, n_users, p_projects, p_users) if create_test_data: _list += (n_adobe, p_adobe) for x in _list: # Ming doesn't detect substructural changes in newly created objects # (vs loaded from DB) state(x).status = "dirty" # TODO: Hope that Ming can be improved to at least avoid stuff below sess.flush(x) ThreadLocalORMSession.flush_all() if asbool(conf.get("load_test_data")): if asbool(conf.get("cache_test_data")): cache_test_data() else: # pragma no cover # regular first-time setup create_trove_categories = CreateTroveCategoriesCommand("create_trove_categories") create_trove_categories.run([""]) if create_test_data: p0.add_user(u_admin, ["Admin"]) log.info("Registering initial apps") with h.push_config(c, user=u_admin): p0.install_apps( [ {"ep_name": ep_name} for ep_name, app in g.entry_points["tool"].iteritems() if app._installable(tool_name=ep_name, nbhd=n_projects, project_tools=[]) ] ) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() if create_test_data: # reload our p0 project so that p0.app_configs is accurate with all the # newly installed apps p0 = M.Project.query.get(_id=p0._id) sub = p0.new_subproject("sub1", project_name="A Subproject") with h.push_config(c, user=u_admin): sub.install_app("wiki") ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def main(): u = M.User.query.get(username='******') u.display_name = 'Anonymous' ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def bootstrap(command, conf, vars): """Place any commands to setup allura here""" # are we being called by the test suite? test_run = conf.get('__file__', '').endswith('test.ini') if not test_run: # when this is run via the `setup-app` cmd, some macro rendering needs this set up REGISTRY.register(ew.widget_context, ew.core.WidgetContext('http', ew.ResourceManager())) create_test_data = asbool(os.getenv('ALLURA_TEST_DATA', True)) # if this is a test_run, skip user project creation to save time make_user_projects = not test_run def make_user(*args, **kw): kw.update(make_project=make_user_projects) return create_user(*args, **kw) # Temporarily disable auth extensions to prevent unintended side-effects tg.config['auth.method'] = tg.config['registration.method'] = 'local' assert tg.config['auth.method'] == 'local' conf['auth.method'] = conf['registration.method'] = 'local' # Clean up all old stuff ThreadLocalORMSession.close_all() c.user = c.project = c.app = None wipe_database() try: g.solr.delete(q='*:*') except: # pragma no cover log.error('SOLR server is %s', g.solr_server) log.error('Error clearing solr index') # set up mongo indexes index = EnsureIndexCommand('ensure_index') index.run(['']) if create_test_data and asbool(conf.get('cache_test_data')): if restore_test_data(): h.set_context('test', neighborhood='Projects') return log.info('Initializing search') log.info('Registering root user & default neighborhoods') M.User( _id=None, username='******', display_name='Anonymous') # never make a user project for the root user if create_test_data: root = create_user('Root', make_project=False) else: from getpass import getpass root_name = raw_input('Enter username for root user (default "root"): ').strip() if not root_name: root_name = 'root' ok = False while not ok: root_password1 = getpass('Enter password: '******'Password must not be empty') continue root_password2 = getpass('Confirm password: '******'t match") continue root = create_user(root_name, password=root_password1, make_project=False) ok = True n_projects = M.Neighborhood(name='Projects', url_prefix='/p/', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) n_users = M.Neighborhood(name='Users', url_prefix='/u/', shortname_prefix='u/', anchored_tools='profile:Profile,userstats:Statistics', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) assert tg.config['auth.method'] == 'local' project_reg = plugin.ProjectRegistrationProvider.get() p_projects = project_reg.register_neighborhood_project( n_projects, [root], allow_register=True) p_users = project_reg.register_neighborhood_project(n_users, [root]) def set_nbhd_wiki_content(nbhd_proj, content): wiki = nbhd_proj.app_instance('wiki') page = WM.Page.query.get( app_config_id=wiki.config._id, title=wiki.root_page_name) page.text = content set_nbhd_wiki_content(p_projects, dedent(''' Welcome to the "Projects" neighborhood. It is the default neighborhood in Allura. You can edit this wiki page as you see fit. Here's a few ways to get started: [Register a new project](/p/add_project) [Neighborhood administration](/p/admin) [[projects show_total=yes]] ''')) set_nbhd_wiki_content(p_users, dedent(''' This is the "Users" neighborhood. All users automatically get a user-project created for them, using their username. [Neighborhood administration](/u/admin) [[projects show_total=yes]] ''')) if create_test_data: n_adobe = M.Neighborhood( name='Adobe', url_prefix='/adobe/', project_list_url='/adobe/', features=dict(private_projects=True, max_projects=None, css='custom', google_analytics=True)) p_adobe = project_reg.register_neighborhood_project(n_adobe, [root]) set_nbhd_wiki_content(p_adobe, dedent(''' This is the "Adobe" neighborhood. It is just an example of having projects in a different neighborhood. [Neighborhood administration](/adobe/admin) [[projects show_total=yes]] ''')) # add the adobe icon file_name = 'adobe_icon.png' file_path = os.path.join( allura.__path__[0], 'public', 'nf', 'images', file_name) M.NeighborhoodFile.from_path(file_path, neighborhood_id=n_adobe._id) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() if create_test_data: # Add some test users for unum in range(10): make_user('Test User %d' % unum) log.info('Creating basic project categories') M.ProjectCategory(name='clustering', label='Clustering') cat2 = M.ProjectCategory(name='communications', label='Communications') M.ProjectCategory( name='synchronization', label='Synchronization', parent_id=cat2._id) M.ProjectCategory( name='streaming', label='Streaming', parent_id=cat2._id) M.ProjectCategory(name='fax', label='Fax', parent_id=cat2._id) M.ProjectCategory(name='bbs', label='BBS', parent_id=cat2._id) cat3 = M.ProjectCategory(name='database', label='Database') M.ProjectCategory( name='front_ends', label='Front-Ends', parent_id=cat3._id) M.ProjectCategory( name='engines_servers', label='Engines/Servers', parent_id=cat3._id) if create_test_data: log.info('Registering "regular users" (non-root) and default projects') # since this runs a lot for tests, separate test and default users and # do the minimal needed if asbool(conf.get('load_test_data')): u_admin = make_user('Test Admin') u_admin.preferences = dict(email_address='*****@*****.**') u_admin.email_addresses = ['*****@*****.**'] u_admin.set_password('foo') u_admin.claim_address('*****@*****.**') ThreadLocalORMSession.flush_all() admin_email = M.EmailAddress.get(email='*****@*****.**') admin_email.confirmed = True else: u_admin = make_user('Admin 1', username='******') # Admin1 is almost root, with admin access for Users and Projects # neighborhoods p_projects.add_user(u_admin, ['Admin']) p_users.add_user(u_admin, ['Admin']) n_projects.register_project('allura', u_admin, 'Allura') make_user('Test User') n_adobe.register_project('adobe-1', u_admin, 'Adobe project 1') p_adobe.add_user(u_admin, ['Admin']) p0 = n_projects.register_project('test', u_admin, 'Test Project') n_projects.register_project('test2', u_admin, 'Test 2') p0._extra_tool_status = ['alpha', 'beta'] sess = session(M.Neighborhood) # all the sessions are the same _list = (n_projects, n_users, p_projects, p_users) if create_test_data: _list += (n_adobe, p_adobe) for x in _list: # Ming doesn't detect substructural changes in newly created objects # (vs loaded from DB) state(x).status = 'dirty' # TODO: Hope that Ming can be improved to at least avoid stuff below sess.flush(x) ThreadLocalORMSession.flush_all() if asbool(conf.get('load_test_data')): if asbool(conf.get('cache_test_data')): cache_test_data() else: # pragma no cover # regular first-time setup create_trove_categories = CreateTroveCategoriesCommand('create_trove_categories') create_trove_categories.run(['']) if create_test_data: p0.add_user(u_admin, ['Admin']) log.info('Registering initial apps') with h.push_config(c, user=u_admin): p0.install_apps([{'ep_name': ep_name} for ep_name, app in g.entry_points['tool'].iteritems() if app._installable(tool_name=ep_name, nbhd=n_projects, project_tools=[]) ]) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() if create_test_data: # reload our p0 project so that p0.app_configs is accurate with all the # newly installed apps p0 = M.Project.query.get(_id=p0._id) sub = p0.new_subproject('sub1', project_name='A Subproject') with h.push_config(c, user=u_admin): sub.install_app('wiki') ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def exit(self, status): self.project.notifications_disabled = False ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() exit(status)
def bootstrap(command, conf, vars): """Place any commands to setup allura here""" # are we being called by the test suite? test_run = conf.get('__file__', '').endswith('test.ini') # if this is a test_run, skip user project creation to save time make_user_projects = not test_run def make_user(*args, **kw): kw.update(make_project=make_user_projects) return create_user(*args, **kw) # Temporarily disable auth extensions to prevent unintended side-effects tg.config['auth.method'] = tg.config['registration.method'] = 'local' assert tg.config['auth.method'] == 'local' conf['auth.method'] = conf['registration.method'] = 'local' # Clean up all old stuff ThreadLocalORMSession.close_all() c.queued_messages = defaultdict(list) c.user = c.project = c.app = None database = conf.get('db_prefix', '') + 'project:test' wipe_database() try: g.solr.delete(q='*:*') except: # pragma no cover log.error('SOLR server is %s', g.solr_server) log.error('Error clearing solr index') if asbool(conf.get('cache_test_data')): if restore_test_data(): h.set_context('test', neighborhood='Projects') return log.info('Initializing search') log.info('Registering root user & default neighborhoods') anonymous = M.User( _id=None, username='******', display_name='Anonymous') # never make a user project for the root user root = create_user('Root', make_project=False) n_projects = M.Neighborhood(name='Projects', url_prefix='/p/', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) n_users = M.Neighborhood(name='Users', url_prefix='/u/', shortname_prefix='u/', anchored_tools='profile:Profile,userstats:Statistics', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) n_adobe = M.Neighborhood( name='Adobe', url_prefix='/adobe/', project_list_url='/adobe/', features=dict(private_projects=True, max_projects=None, css='custom', google_analytics=True)) assert tg.config['auth.method'] == 'local' project_reg = plugin.ProjectRegistrationProvider.get() p_projects = project_reg.register_neighborhood_project( n_projects, [root], allow_register=True) p_users = project_reg.register_neighborhood_project(n_users, [root]) p_adobe = project_reg.register_neighborhood_project(n_adobe, [root]) def set_nbhd_wiki_content(nbhd_proj, content): wiki = nbhd_proj.app_instance('wiki') page = WM.Page.query.get( app_config_id=wiki.config._id, title=wiki.root_page_name) page.text = content set_nbhd_wiki_content(p_projects, dedent(''' Welcome to the "Projects" neighborhood. It is the default neighborhood in Allura. You can edit this wiki page as you see fit. Here's a few ways to get started: [Register a new project](/p/add_project) [Neighborhood administration](/p/admin) [[projects show_total=yes]] ''')) set_nbhd_wiki_content(p_users, dedent(''' This is the "Users" neighborhood. All users automatically get a user-project created for them, using their username. [Neighborhood administration](/u/admin) [[projects show_total=yes]] ''')) set_nbhd_wiki_content(p_adobe, dedent(''' This is the "Adobe" neighborhood. It is just an example of having projects in a different neighborhood. [Neighborhood administration](/adobe/admin) [[projects show_total=yes]] ''')) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() # add the adobe icon file_name = 'adobe_icon.png' file_path = os.path.join( allura.__path__[0], 'public', 'nf', 'images', file_name) M.NeighborhoodFile.from_path(file_path, neighborhood_id=n_adobe._id) # Add some test users for unum in range(10): make_user('Test User %d' % unum) log.info('Creating basic project categories') cat1 = M.ProjectCategory(name='clustering', label='Clustering') cat2 = M.ProjectCategory(name='communications', label='Communications') cat2_1 = M.ProjectCategory( name='synchronization', label='Synchronization', parent_id=cat2._id) cat2_2 = M.ProjectCategory( name='streaming', label='Streaming', parent_id=cat2._id) cat2_3 = M.ProjectCategory(name='fax', label='Fax', parent_id=cat2._id) cat2_4 = M.ProjectCategory(name='bbs', label='BBS', parent_id=cat2._id) cat3 = M.ProjectCategory(name='database', label='Database') cat3_1 = M.ProjectCategory( name='front_ends', label='Front-Ends', parent_id=cat3._id) cat3_2 = M.ProjectCategory( name='engines_servers', label='Engines/Servers', parent_id=cat3._id) log.info('Registering "regular users" (non-root) and default projects') # since this runs a lot for tests, separate test and default users and # do the minimal needed if asbool(conf.get('load_test_data')): u_admin = make_user('Test Admin') u_admin.preferences = dict(email_address='*****@*****.**') u_admin.email_addresses = ['*****@*****.**'] u_admin.set_password('foo') u_admin.claim_address('*****@*****.**') else: u_admin = make_user('Admin 1', username='******') # Admin1 is almost root, with admin access for Users and Projects # neighborhoods p_projects.add_user(u_admin, ['Admin']) p_users.add_user(u_admin, ['Admin']) p_allura = n_projects.register_project('allura', u_admin, 'Allura') u1 = make_user('Test User') p_adobe1 = n_adobe.register_project('adobe-1', u_admin, 'Adobe project 1') p_adobe.add_user(u_admin, ['Admin']) p0 = n_projects.register_project('test', u_admin, 'Test Project') p1 = n_projects.register_project('test2', u_admin, 'Test 2') p0._extra_tool_status = ['alpha', 'beta'] sess = session(M.Neighborhood) # all the sessions are the same for x in (n_adobe, n_projects, n_users, p_projects, p_users, p_adobe): # Ming doesn't detect substructural changes in newly created objects # (vs loaded from DB) state(x).status = 'dirty' # TODO: Hope that Ming can be improved to at least avoid stuff below sess.flush(x) ThreadLocalORMSession.flush_all() if asbool(conf.get('load_test_data')): if asbool(conf.get('cache_test_data')): cache_test_data() else: # pragma no cover # regular first-time setup p0.add_user(u_admin, ['Admin']) log.info('Registering initial apps') with h.push_config(c, user=u_admin): for ep_name, app in g.entry_points['tool'].iteritems(): if not app.installable: continue p0.install_app(ep_name) # reload our p0 project so that p0.app_configs is accurate with all the # newly installed apps ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() p0 = M.Project.query.get(_id=p0._id) sub = p0.new_subproject('sub1', project_name='A Subproject') with h.push_config(c, user=u_admin): sub.install_app('wiki') ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()
def bootstrap(command, conf, vars): """Place any commands to setup allura here""" # are we being called by the test suite? test_run = conf.get('__file__', '').endswith('test.ini') # if this is a test_run, skip user project creation to save time make_user_projects = not test_run def make_user(*args, **kw): kw.update(make_project=make_user_projects) return create_user(*args, **kw) # Our bootstrap doesn't play nicely with SFX project and user APIs tg.config['auth.method'] = tg.config['registration.method'] = 'local' assert tg.config['auth.method'] == 'local' conf['auth.method'] = conf['registration.method'] = 'local' # Clean up all old stuff ThreadLocalORMSession.close_all() c.queued_messages = defaultdict(list) c.user = c.project = c.app = None database = conf.get('db_prefix', '') + 'project:test' wipe_database() try: g.solr.delete(q='*:*') except: # pragma no cover log.error('SOLR server is %s', g.solr_server) log.error('Error clearing solr index') if asbool(conf.get('cache_test_data')): if restore_test_data(): from allura.lib import helpers as h h.set_context('test', neighborhood='Projects') return log.info('Initializing search') log.info('Registering root user & default neighborhoods') anonymous = M.User(_id=None, username='******', display_name='Anonymous') # never make a user project for the root user root = create_user('Root', make_project=False) n_projects = M.Neighborhood(name='Projects', url_prefix='/p/', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) n_users = M.Neighborhood( name='Users', url_prefix='/u/', shortname_prefix='u/', anchored_tools='profile:Profile,userstats:Statistics', features=dict(private_projects=True, max_projects=None, css='none', google_analytics=False)) n_adobe = M.Neighborhood(name='Adobe', url_prefix='/adobe/', project_list_url='/adobe/', features=dict(private_projects=True, max_projects=None, css='custom', google_analytics=True)) assert tg.config['auth.method'] == 'local' project_reg = plugin.ProjectRegistrationProvider.get() p_projects = project_reg.register_neighborhood_project(n_projects, [root], allow_register=True) p_users = project_reg.register_neighborhood_project(n_users, [root]) p_adobe = project_reg.register_neighborhood_project(n_adobe, [root]) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() # add the adobe icon file_name = 'adobe_icon.png' file_path = os.path.join(allura.__path__[0], 'public', 'nf', 'images', file_name) M.NeighborhoodFile.from_path(file_path, neighborhood_id=n_adobe._id) # Add some test users for unum in range(10): make_user('Test User %d' % unum) log.info('Creating basic project categories') cat1 = M.ProjectCategory(name='clustering', label='Clustering') cat2 = M.ProjectCategory(name='communications', label='Communications') cat2_1 = M.ProjectCategory(name='synchronization', label='Synchronization', parent_id=cat2._id) cat2_2 = M.ProjectCategory(name='streaming', label='Streaming', parent_id=cat2._id) cat2_3 = M.ProjectCategory(name='fax', label='Fax', parent_id=cat2._id) cat2_4 = M.ProjectCategory(name='bbs', label='BBS', parent_id=cat2._id) cat3 = M.ProjectCategory(name='database', label='Database') cat3_1 = M.ProjectCategory(name='front_ends', label='Front-Ends', parent_id=cat3._id) cat3_2 = M.ProjectCategory(name='engines_servers', label='Engines/Servers', parent_id=cat3._id) log.info('Registering "regular users" (non-root) and default projects') # since this runs a lot for tests, separate test and default users and # do the minimal needed if asbool(conf.get('load_test_data')): u_admin = make_user('Test Admin') u_admin.preferences = dict(email_address='*****@*****.**') u_admin.email_addresses = ['*****@*****.**'] u_admin.set_password('foo') u_admin.claim_address('*****@*****.**') else: u_admin = make_user('Admin 1', username='******') # Admin1 is almost root, with admin access for Users and Projects neighborhoods p_projects.add_user(u_admin, ['Admin']) p_users.add_user(u_admin, ['Admin']) p_allura = n_projects.register_project('allura', u_admin) u1 = make_user('Test User') p_adobe1 = n_adobe.register_project('adobe-1', u_admin) p_adobe.add_user(u_admin, ['Admin']) p0 = n_projects.register_project('test', u_admin) p1 = n_projects.register_project('test2', u_admin) p0._extra_tool_status = ['alpha', 'beta'] sess = session(M.Neighborhood) # all the sessions are the same for x in (n_adobe, n_projects, n_users, p_projects, p_users, p_adobe): # Ming doesn't detect substructural changes in newly created objects (vs loaded from DB) state(x).status = 'dirty' # TODO: Hope that Ming can be improved to at least avoid stuff below sess.flush(x) c.project = p0 c.user = u_admin p1 = p0.new_subproject('sub1') ThreadLocalORMSession.flush_all() if asbool(conf.get('load_test_data')): if asbool(conf.get('cache_test_data')): cache_test_data() else: # pragma no cover # regular first-time setup p0.add_user(u_admin, ['Admin']) log.info('Registering initial apps') for ep_name, app in g.entry_points['tool'].iteritems(): if not app.installable: continue p0.install_app(ep_name) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all()