[#122] Renamed forum plugin to discussion

Jenny Steele Jenny Steele 2010-03-30

<< < 1 2 (Page 2 of 2)
copied ForgeForum/forgeforum/templates/search.html -> ForgeDiscussion/forgediscussion/templates/search.html
copied ForgeForum/forgeforum/templates/tag_forum.html -> ForgeDiscussion/forgediscussion/templates/tag_forum.html
copied ForgeForum/forgeforum/tests/functional/__init__.py -> ForgeDiscussion/forgediscussion/tests/functional/__init__.py
copied ForgeForum/forgeforum/tests/functional/test_forum.py -> ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
copied ForgeForum/forgeforum/tests/__init__.py -> ForgeDiscussion/forgediscussion/tests/__init__.py
copied ForgeForum/forgeforum/tests/test_forum_roles.py -> ForgeDiscussion/forgediscussion/tests/test_forum_roles.py
copied ForgeForum/forgeforum/widgets/templates/__init__.py -> ForgeDiscussion/forgediscussion/widgets/templates/__init__.py
copied ForgeForum/forgeforum/widgets/templates/forum_header.html -> ForgeDiscussion/forgediscussion/widgets/templates/forum_header.html
copied ForgeForum/forgeforum/widgets/templates/forum_summary.html -> ForgeDiscussion/forgediscussion/widgets/templates/forum_summary.html
copied ForgeForum/forgeforum/widgets/templates/thread_header.html -> ForgeDiscussion/forgediscussion/widgets/templates/thread_header.html
copied ForgeForum/forgeforum/widgets/__init__.py -> ForgeDiscussion/forgediscussion/widgets/__init__.py
copied ForgeForum/forgeforum/widgets/forum_widgets.py -> ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
copied ForgeForum/forgeforum/__init__.py -> ForgeDiscussion/forgediscussion/__init__.py
copied ForgeForum/forgeforum/forum_main.py -> ForgeDiscussion/forgediscussion/forum_main.py
copied ForgeForum/forgeforum/version.py -> ForgeDiscussion/forgediscussion/version.py
copied ForgeForum/sandbox-test.ini -> ForgeDiscussion/sandbox-test.ini
copied ForgeForum/setup.cfg -> ForgeDiscussion/setup.cfg
copied ForgeForum/setup.py -> ForgeDiscussion/setup.py
copied ForgeForum/test.ini -> ForgeDiscussion/test.ini
ForgeForum/forgeforum/templates/search.html to ForgeDiscussion/forgediscussion/templates/search.html
--- a/ForgeForum/forgeforum/templates/search.html
+++ b/ForgeDiscussion/forgediscussion/templates/search.html
@@ -13,7 +13,7 @@
     <title>Search</title>
   </head>
   <body>
-    <h1>ForgeForum Search</h1>
+    <h1 class="title">ForgeDiscussion Search</h1>
     <form method="GET" action="search">
       <input type="text" name="q" value="$q"/><br/>
       Search history? <input type="checkbox" name="history" checked="${history or None}"/><br/>
ForgeForum/forgeforum/templates/tag_forum.html to ForgeDiscussion/forgediscussion/templates/tag_forum.html
--- a/ForgeForum/forgeforum/templates/tag_forum.html
+++ b/ForgeDiscussion/forgediscussion/templates/tag_forum.html
@@ -9,11 +9,11 @@
 
   <head>
     <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title>ForgeForum Index Page</title>
+    <title>ForgeDiscussion Index Page</title>
   </head>
   
   <body>
-    <h1>$forum.name</h1>
+    <h1 class="title">$forum.name</h1>
     <h2>Tags: 
       <py:for each="t in tags">$t, </py:for>
       <form method="GET" action="." style="display:inline">
ForgeForum/forgeforum/tests/functional/test_forum.py to ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
--- a/ForgeForum/forgeforum/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -8,19 +8,19 @@
 
 from ming.orm.ormsession import ThreadLocalORMSession
 
-from forgeforum.tests import TestController
+from forgediscussion.tests import TestController
 from pyforge import model as M
 from pyforge.command import reactor
 from pyforge.lib import helpers as h
 
-from forgeforum import model as FM
+from forgediscussion import model as FM
 
 class TestForumReactors(TestController):
 
     def setUp(self):
         TestController.setUp(self)
-        self.app.get('/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
+        self.app.get('/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'test',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum',
@@ -30,7 +30,7 @@
         r = self.app.get(r.location)
         assert 'error' not in r
         assert 'Test Forum' in r
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'test1',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum 1',
@@ -50,7 +50,7 @@
         cmd.options.proc = 1
         configs = cmd.command()
         self.cmd = cmd
-        h.set_context('test', 'Forum')
+        h.set_context('test', 'Discussion')
         self.user_id = M.User.query.get(username='root')._id
 
     def test_has_access(self):
@@ -58,44 +58,44 @@
         assert True == c.app.has_access(M.User.query.get(username='root'), 'test')
 
     def test_post(self):
-        self._post('Forum.msg.test', 'Test Thread', 'Nothing here')
+        self._post('Discussion.msg.test', 'Test Thread', 'Nothing here')
 
     def test_bad_post(self):
         self._post('Forumtest', 'Test Thread', 'Nothing here')
 
     def test_notify(self):
-        self._post('Forum.msg.test', 'Test Thread', 'Nothing here',
+        self._post('Discussion.msg.test', 'Test Thread', 'Nothing here',
                    message_id='test_notify@sf.net')
-        self._post('Forum.msg.test', 'Test Reply', 'Nothing here, either',
+        self._post('Discussion.msg.test', 'Test Reply', 'Nothing here, either',
                    message_id='test_notify1@sf.net',
                    in_reply_to=[ 'test_notify@sf.net' ])
         self._notify('test_notify@sf.net')
         self._notify('test_notify1@sf.net')
 
     def test_reply(self):
-        self._post('Forum.msg.test', 'Test Thread', 'Nothing here',
+        self._post('Discussion.msg.test', 'Test Thread', 'Nothing here',
                    message_id='test_reply@sf.net')
-        self._post('Forum.msg.test', 'Test Reply', 'Nothing here, either',
+        self._post('Discussion.msg.test', 'Test Reply', 'Nothing here, either',
                    message_id='test_reply1@sf.net',
                    in_reply_to=[ 'test_reply@sf.net' ])
         assert FM.ForumThread.query.find().count() == 1
         assert FM.ForumPost.query.find().count() == 2
 
     def test_attach(self):
-        self._post('Forum.msg.test', 'Attachment Thread', 'This is a text file',
+        self._post('Discussion.msg.test', 'Attachment Thread', 'This is a text file',
                    message_id='test.attach.100@sf.net',
                    filename='test.txt',
                    content_type='text/plain')
-        self._post('Forum.msg.test', 'Test Thread', 'Nothing here',
+        self._post('Discussion.msg.test', 'Test Thread', 'Nothing here',
                    message_id='test.attach.100@sf.net')
-        self._post('Forum.msg.test', 'Attachment Thread', 'This is a text file',
+        self._post('Discussion.msg.test', 'Attachment Thread', 'This is a text file',
                    message_id='test.attach.100@sf.net',
                    content_type='text/plain')
 
     def test_threads(self):
-        self._post('Forum.msg.test', 'Test', 'test')
+        self._post('Discussion.msg.test', 'Test', 'test')
         thd = FM.ForumThread.query.find().first()
-        url = str('/Forum/test/thread/%s/' % thd._id)
+        url = str('/Discussion/test/thread/%s/' % thd._id)
         r = self.app.get(url)
         # Test moderate
         r = self.app.post(url + 'moderate',
@@ -107,19 +107,19 @@
         assert len(r.html.findAll('tr')) == 1
 
     def test_posts(self):
-        self._post('Forum.msg.test', 'Test', 'test')
+        self._post('Discussion.msg.test', 'Test', 'test')
         thd = FM.ForumThread.query.find().first()
-        thd_url = str('/Forum/test/thread/%s/' % thd._id)
+        thd_url = str('/Discussion/test/thread/%s/' % thd._id)
         r = self.app.get(thd_url)
         p = FM.ForumPost.query.find().first()
-        url = str('/Forum/test/thread/%s/%s/' % (thd._id, p.slug))
+        url = str('/Discussion/test/thread/%s/%s/' % (thd._id, p.slug))
         r = self.app.get(url)
         r = self.app.post(url, params=dict(subject='New Subject', text='Asdf'))
         assert 'Asdf' in self.app.get(url)
         r = self.app.get(url, params=dict(version=1))
         r = self.app.post(url + 'reply',
                           params=dict(subject='Reply', text='text'))
-        self._post('Forum.msg.test', 'Test Reply', 'Nothing here, either',
+        self._post('Discussion.msg.test', 'Test Reply', 'Nothing here, either',
                    message_id='test_posts@sf.net',
                    in_reply_to=[ p._id ])
         reply = FM.ForumPost.query.find().all()[-1]
@@ -158,7 +158,7 @@
         message_id = kw.pop('message_id', '%s@test.com' % random.random())
         msg.data = dict(kw,
                         project_id=c.project._id,
-                        mount_point='Forum',
+                        mount_point='Discussion',
                         headers=dict(Subject=subject),
                         user_id=self.user_id,
                         payload=body,
@@ -166,13 +166,13 @@
         callback(msg.data, msg)
 
     def _notify(self, post_id, **kw):
-        callback = self.cmd.route_react('Forum.new_post', c.app.notify_subscribers)
+        callback = self.cmd.route_react('Discussion.new_post', c.app.notify_subscribers)
         msg = mock.Mock()
         msg.ack = lambda:None
-        msg.delivery_info = dict(routing_key='Forum.new_post')
+        msg.delivery_info = dict(routing_key='Discussion.new_post')
         msg.data = dict(kw,
                         project_id=c.project._id,
-                        mount_point='Forum',
+                        mount_point='Discussion',
                         post_id=post_id)
         callback(msg.data, msg)
 
@@ -180,9 +180,67 @@
 
     def setUp(self):
         TestController.setUp(self)
-        self.app.get('/Forum/')
-        r = self.app.get('/admin/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
+        self.app.get('/Discussion/')
+        r = self.app.get('/admin/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
+                          params={'new_forum.shortname':'TestForum',
+                                  'new_forum.create':'on',
+                                  'new_forum.name':'Test Forum',
+                                  'new_forum.description':'',
+                                  'new_forum.parent':'',
+                                  })
+        r = self.app.get(r.location)
+        assert 'error' not in r
+        assert 'TestForum' in r
+        h.set_context('test', 'Discussion')
+        frm = FM.Forum.query.get(shortname='TestForum')
+        r = self.app.get('/admin/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
+                          params={'new_forum.shortname':'ChildForum',
+                                  'new_forum.create':'on',
+                                  'new_forum.name':'Child Forum',
+                                  'new_forum.description':'',
+                                  'new_forum.parent':str(frm._id),
+                                  })
+        r = self.app.get(r.location)
+        assert 'error' not in r
+        assert 'ChildForum' in r
+
+    def test_forum_search(self):
+        r = self.app.get('/Discussion/search')
+        r = self.app.get('/Discussion/search', params=dict(q='foo'))
+
+    def test_forum_subscribe(self):
+        r = self.app.get('/Discussion/subscribe', params={
+                'forum-0.shortname':'TestForum',
+                'forum-0.subscribed':'on',
+                })
+        r = self.app.get('/Discussion/subscribe', params={
+                'forum-0.shortname':'TestForum',
+                'forum-0.subscribed':'',
+                })
+
+    def test_forum_index(self):
+        r = self.app.get('/Discussion/TestForum/')
+        r = self.app.get('/Discussion/TestForum/ChildForum/')
+
+    def test_posting(self):
+        r = self.app.get('/Discussion/TestForum/post', params=dict(
+                subject='Test Thread',
+                text='This is a *test thread*'))
+        r = self.app.get(r.location)
+        assert 'Message posted' in r
+        r = self.app.get('/Discussion/TestForum/moderate/')
+
+class TestForumAdmin(TestController):
+
+    def setUp(self):
+        TestController.setUp(self)
+        self.app.get('/Discussion/')
+
+    def test_forum_CRUD(self):
+        r = self.app.get('/admin/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'TestForum',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum',
@@ -194,65 +252,7 @@
         assert 'TestForum' in r
         h.set_context('test', 'Forum')
         frm = FM.Forum.query.get(shortname='TestForum')
-        r = self.app.get('/admin/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
-                          params={'new_forum.shortname':'ChildForum',
-                                  'new_forum.create':'on',
-                                  'new_forum.name':'Child Forum',
-                                  'new_forum.description':'',
-                                  'new_forum.parent':str(frm._id),
-                                  })
-        r = self.app.get(r.location)
-        assert 'error' not in r
-        assert 'ChildForum' in r
-
-    def test_forum_search(self):
-        r = self.app.get('/Forum/search')
-        r = self.app.get('/Forum/search', params=dict(q='foo'))
-
-    def test_forum_subscribe(self):
-        r = self.app.get('/Forum/subscribe', params={
-                'forum-0.shortname':'TestForum',
-                'forum-0.subscribed':'on',
-                })
-        r = self.app.get('/Forum/subscribe', params={
-                'forum-0.shortname':'TestForum',
-                'forum-0.subscribed':'',
-                })
-
-    def test_forum_index(self):
-        r = self.app.get('/Forum/TestForum/')
-        r = self.app.get('/Forum/TestForum/ChildForum/')
-
-    def test_posting(self):
-        r = self.app.get('/Forum/TestForum/post', params=dict(
-                subject='Test Thread',
-                text='This is a *test thread*'))
-        r = self.app.get(r.location)
-        assert 'Message posted' in r
-        r = self.app.get('/Forum/TestForum/moderate/')
-
-class TestForumAdmin(TestController):
-
-    def setUp(self):
-        TestController.setUp(self)
-        self.app.get('/Forum/')
-
-    def test_forum_CRUD(self):
-        r = self.app.get('/admin/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
-                          params={'new_forum.shortname':'TestForum',
-                                  'new_forum.create':'on',
-                                  'new_forum.name':'Test Forum',
-                                  'new_forum.description':'',
-                                  'new_forum.parent':'',
-                                  })
-        r = self.app.get(r.location)
-        assert 'error' not in r
-        assert 'TestForum' in r
-        h.set_context('test', 'Forum')
-        frm = FM.Forum.query.get(shortname='TestForum')
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.create':'',
                                   'forum-0.delete':'',
                                   'forum-0.id':str(frm._id),
@@ -262,7 +262,7 @@
         assert 'error' not in r
         assert 'New Test Forum' in r
         assert 'My desc' in r
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.create':'',
                                   'forum-0.delete':'on',
                                   'forum-0.id':str(frm._id),
@@ -274,8 +274,8 @@
         assert 'My desc' not in r
 
     def test_forum_CRUD_hier(self):
-        r = self.app.get('/admin/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.get('/admin/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'TestForum',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum',
@@ -285,10 +285,10 @@
         r = self.app.get(r.location)
         assert 'error' not in r
         assert 'TestForum' in r
-        h.set_context('test', 'Forum')
+        h.set_context('test', 'Discussion')
         frm = FM.Forum.query.get(shortname='TestForum')
-        r = self.app.get('/admin/Forum/')
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.get('/admin/Discussion/')
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'ChildForum',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Child Forum',
@@ -298,7 +298,7 @@
         r = self.app.get(r.location)
         assert 'error' not in r
         assert 'ChildForum' in r
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.create':'',
                                   'forum-0.delete':'on',
                                   'forum-0.id':str(frm._id),
@@ -310,7 +310,7 @@
         assert 'ChildForum' not in r
 
     def test_bad_forum_names(self):
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'Test.Forum',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum',
@@ -319,7 +319,7 @@
                                   })
         r = self.app.get(r.location)
         assert 'error' in r
-        r = self.app.post('/admin/Forum/update_forums',
+        r = self.app.post('/admin/Discussion/update_forums',
                           params={'new_forum.shortname':'Test/Forum',
                                   'new_forum.create':'on',
                                   'new_forum.name':'Test Forum',
ForgeForum/forgeforum/tests/test_forum_roles.py to ForgeDiscussion/forgediscussion/tests/test_forum_roles.py
--- a/ForgeForum/forgeforum/tests/test_forum_roles.py
+++ b/ForgeDiscussion/forgediscussion/tests/test_forum_roles.py
@@ -6,7 +6,7 @@
 def setUp():
     helpers.setup_basic_test()
     helpers.setup_global_objects()
-    g.set_app('Forum')
+    g.set_app('Discussion')
 
 def test_role_assignments():
     role_developer = M.ProjectRole.query.get(name='Developer')._id
ForgeForum/forgeforum/widgets/forum_widgets.py to ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
--- a/ForgeForum/forgeforum/widgets/forum_widgets.py
+++ b/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
@@ -6,10 +6,10 @@
 from pyforge.lib import validators as V
 from pyforge.lib.widgets import discuss as DW
 
-from forgeforum import model as M
+from forgediscussion import model as M
 
 class _ForumSummary(ew.Widget):
-    template='forgeforum.widgets.templates.forum_summary'
+    template='forgediscussion.widgets.templates.forum_summary'
     params=['value', 'show_label', 'label', 'name']
     name=None
     value=None
@@ -90,13 +90,13 @@
         delete=ew.SubmitButton(label='Delete Post')
 
 class ForumHeader(DW.DiscussionHeader):
-    template='forgeforum.widgets.templates.forum_header'
+    template='forgediscussion.widgets.templates.forum_header'
     widgets=dict(DW.DiscussionHeader.widgets,
                  announcements_table=AnnouncementsTable(),
                  forum_subscription_form=ForumSubscriptionForm())
 
 class ThreadHeader(DW.ThreadHeader):
-    template='forgeforum.widgets.templates.thread_header'
+    template='forgediscussion.widgets.templates.thread_header'
     show_subject=True
     show_moderate=True
     widgets=dict(DW.ThreadHeader.widgets,
ForgeForum/forgeforum/forum_main.py to ForgeDiscussion/forgediscussion/forum_main.py
--- a/ForgeForum/forgeforum/forum_main.py
+++ b/ForgeDiscussion/forgediscussion/forum_main.py
@@ -17,14 +17,14 @@
 from pyforge.model import ProjectRole
 
 # Local imports
-from forgeforum import model
-from forgeforum import version
+from forgediscussion import model
+from forgediscussion import version
 from .controllers import RootController
 
 
 log = logging.getLogger(__name__)
 
-class ForgeForumApp(Application):
+class ForgeDiscussionApp(Application):
     __version__ = version.__version__
     permissions = ['configure', 'read', 'unmoderated_post', 'post', 'moderate', 'admin']
     config_options = Application.config_options + [
@@ -60,7 +60,7 @@
             log.error("Can't find forum %s (routing key was %s)",
                           shortname, routing_key)
             return
-        super(ForgeForumApp, self).message_auditor(
+        super(ForgeDiscussionApp, self).message_auditor(
             routing_key, data, f, subject=data['headers'].get('Subject', '[No Subject]'))
 
     @audit('Forum.forum_stats.#')
@@ -152,7 +152,7 @@
         
     @property
     def templates(self):
-         return pkg_resources.resource_filename('forgeforum', 'templates')
+         return pkg_resources.resource_filename('forgediscussion', 'templates')
 
     def install(self, project):
         'Set up any default permissions and roles here'
@@ -180,7 +180,7 @@
     def _check_security(self):
         require(has_artifact_access('admin', app=self.app), 'Admin access required')
 
-    @expose('forgeforum.templates.admin')
+    @expose('forgediscussion.templates.admin')
     def index(self):
         return dict(app=self.app)
 
ForgeForum/setup.py to ForgeDiscussion/setup.py
--- a/ForgeForum/setup.py
+++ b/ForgeDiscussion/setup.py
@@ -1,9 +1,9 @@
 from setuptools import setup, find_packages
 import sys, os
 
-from forgeforum.version import __version__
+from forgediscussion.version import __version__
 
-setup(name='ForgeForum',
+setup(name='ForgeDiscussion',
       version=__version__,
       description="",
       long_description="""\
@@ -26,6 +26,6 @@
       entry_points="""
       # -*- Entry points: -*-
       [pyforge]
-      Forum=forgeforum.forum_main:ForgeForumApp
+      Discussion=forgediscussion.forum_main:ForgeDiscussionApp
       """,
       )
<< < 1 2 (Page 2 of 2)