[xiph-commits] r3934 - in arkaiv/trunk: . arkaiv/controllers arkaiv/lib arkaiv/templates arkaiv/tests/functional data/templates

dcrowdy at svn.annodex.net dcrowdy at svn.annodex.net
Wed May 27 19:37:54 PDT 2009


Author: dcrowdy
Date: 2009-05-27 19:37:53 -0700 (Wed, 27 May 2009)
New Revision: 3934

Added:
   arkaiv/trunk/arkaiv/controllers/collection.py
   arkaiv/trunk/arkaiv/controllers/help.py
   arkaiv/trunk/arkaiv/tests/functional/test_collection.py
   arkaiv/trunk/arkaiv/tests/functional/test_help.py
Modified:
   arkaiv/trunk/arkaiv/controllers/page.py
   arkaiv/trunk/arkaiv/controllers/page.pyc
   arkaiv/trunk/arkaiv/lib/helpers.pyc
   arkaiv/trunk/arkaiv/templates/autohandler
   arkaiv/trunk/arkaiv/templates/collectionexpanded.mak
   arkaiv/trunk/arkaiv/templates/help.mak
   arkaiv/trunk/data/templates/autohandler.py
   arkaiv/trunk/data/templates/autohandler.pyc
   arkaiv/trunk/data/templates/collectionexpanded.mak.py
   arkaiv/trunk/data/templates/collectionexpanded.mak.pyc
   arkaiv/trunk/production.ini
Log:
Separated collection and help as separate controllers


Added: arkaiv/trunk/arkaiv/controllers/collection.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/collection.py	                        (rev 0)
+++ arkaiv/trunk/arkaiv/controllers/collection.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -0,0 +1,30 @@
+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+
+from arkaiv.lib.base import BaseController, render, model
+
+log = logging.getLogger(__name__)
+
+class CollectionController(BaseController):
+
+    def index(self):
+        # Not really used
+        return render('/collections.mak')
+
+    def list(self):
+        c.collections = model.getcollections()
+        return render('/collections.mak')
+
+    def displaycollection(self):
+        collid = request.params['id']
+        c.collname = request.params['name']
+        c.items = model.getitemsincollection(collid)
+        return render('/collectionexpanded.mak')
+
+    def addcollection(self):
+        model.addnewcollection(request.params['newcollection'])
+        c.collections = model.getcollections()
+        return render('/collections.mak')
+

Added: arkaiv/trunk/arkaiv/controllers/help.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/help.py	                        (rev 0)
+++ arkaiv/trunk/arkaiv/controllers/help.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -0,0 +1,15 @@
+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+
+from arkaiv.lib.base import BaseController, render
+
+log = logging.getLogger(__name__)
+
+class HelpController(BaseController):
+
+    def index(self):
+        # Return a rendered template
+        return render('/help.mak')
+

Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/arkaiv/controllers/page.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -48,10 +48,6 @@
         c.items = model.getallitems()
         return render('/mainpage.mak')
 
-    def collections(self):
-        c.collections = model.getcollections()
-        return render('/collections.mak')
-
     def displayadd(self):
         # Get the list of collections
         collectionlist = model.getcollections()
@@ -62,13 +58,6 @@
 
         return render('/addform.mak')
 
-
-    def displaycollection(self):
-        collid = request.params['id']
-        c.collname = request.params['name']
-        c.items = model.getitemsincollection(collid)
-        return render('/collectionexpanded.mak')
-
     def addannodexform(self):
         collectionlist = model.getcollections()
         c.collectioninfo = ""
@@ -179,6 +168,7 @@
             return render('/playlistview.mak')
 
     def addannodexindirform(self):
+        # Currently unused - useful if importing a load of material locally
         collectionlist = model.getcollections()
         c.collectioninfo = ""
         for collection in collectionlist:
@@ -187,10 +177,6 @@
 
         return render('/addannodexindirform.mak')
 
-    def addcollection(self):
-        model.addnewcollection(request.params['newcollection'])
-        c.collections = model.getcollections()
-        return render('/collections.mak')
   
     def displayitem(self):
 
@@ -686,9 +672,6 @@
         model.additemtocollection(headinfo['itemid'], collection)
         return		
 
-    def displayhelp(self):
-        return render('/help.mak')
-
     def deletemeta(self):
         metaid = request.params['metaid']
         itemid = request.params['itemid']

Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/lib/helpers.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/templates/autohandler
===================================================================
--- arkaiv/trunk/arkaiv/templates/autohandler	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/arkaiv/templates/autohandler	2009-05-28 02:37:53 UTC (rev 3934)
@@ -10,11 +10,11 @@
 <h1>Arkaiv</h1>
 <div id="navcontainer">
 <ul id="navlist">
-  <li>${ h.link_to("All Items", h.url_for(action="mainpage")) }</li>
-  <li>${ h.link_to("Collections", h.url_for(action="collections")) }</li>
-  <li>${ h.link_to("Add media", h.url_for(action="addannodexform")) }</li>
-  <li>${ h.link_to("Playlists", h.url_for(action="playlistpage")) }</li>
-  <li>${ h.link_to("Help", h.url_for(action="displayhelp")) }</li>
+  <li>${ h.link_to("All Items", h.url_for(controller='page', action="mainpage")) }</li>
+  <li>${ h.link_to("Collections", h.url_for(controller='collection', action='list')) }</li>
+  <li>${ h.link_to("Add media", h.url_for(controller='page', action="addannodexform")) }</li>
+  <li>${ h.link_to("Playlists", h.url_for(controller='page', action="playlistpage")) }</li>
+  <li>${ h.link_to("Help", h.url_for(controller='help', action='index')) }</li>
   <li><span class="searchpadding">
 ${ h.form(h.url_for(action='search'), multipart=True) }
 ${ h.text_field('searchterms', value="Search") } 

Modified: arkaiv/trunk/arkaiv/templates/collectionexpanded.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/collectionexpanded.mak	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/arkaiv/templates/collectionexpanded.mak	2009-05-28 02:37:53 UTC (rev 3934)
@@ -5,7 +5,7 @@
 
 % for item in c.items:
 <li>
-    ${ h.link_to(item['name'], h.url_for(action="displayitem", edit="no", id=item['index'])) }
+    ${ h.link_to(item['name'], h.url_for(controller='page', action='displayitem', edit="no", id=item['index'])) }
 </li>
 % endfor
 

Modified: arkaiv/trunk/arkaiv/templates/help.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/help.mak	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/arkaiv/templates/help.mak	2009-05-28 02:37:53 UTC (rev 3934)
@@ -1,24 +1,32 @@
 <%inherit file="/autohandler"/> 
 <h2>Help</h2>
 
-<h3>Shortcut keys</h3>
+The general flow or operation with Arkaiv is as follows:
+<ul>
+<li>Import media (only as ogg files with a .ogg extension at the moment).
+<li>Annotate that media with either general tags, or clips that reference specific points in the stream.
+<li>Search for particular keywords
+<li>Add these to playlists if desired
+</ul>
 
-When an item is displayed and played, the following shortcuts work:
+##<h3>Shortcut keys</h3>
+##
+##When an item is displayed and played, the following shortcuts work:
+##
+##<table style="font-size:small">
+##<tr>
+##<td>Key</td>
+##<td>Description</td>
+##</tr>
+##<tr>
+##<td>p</td><td>Toggle play/pause</td>
+##</tr>
+##<tr>
+##<td>t</td> <td>Display the time for the current point in playback</td>
+##</tr>
+##<tr>
+##<td>s</td><td> Add the current playback point time position to the start textbox for adding clips</td>
+##</tr>
+##</table>
 
-<table style="font-size:small">
-<tr>
-<td>Key</td>
-<td>Description</td>
-</tr>
-<tr>
-<td>p</td><td>Toggle play/pause</td>
-</tr>
-<tr>
-<td>t</td> <td>Display the time for the current point in playback</td>
-</tr>
-<tr>
-<td>s</td><td> Add the current playback point time position to the start textbox for adding clips</td>
-</tr>
-</table>
 
-

Added: arkaiv/trunk/arkaiv/tests/functional/test_collection.py
===================================================================
--- arkaiv/trunk/arkaiv/tests/functional/test_collection.py	                        (rev 0)
+++ arkaiv/trunk/arkaiv/tests/functional/test_collection.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -0,0 +1,7 @@
+from arkaiv.tests import *
+
+class TestCollectionController(TestController):
+
+    def test_index(self):
+        response = self.app.get(url(controller='collection', action='index'))
+        # Test response...

Added: arkaiv/trunk/arkaiv/tests/functional/test_help.py
===================================================================
--- arkaiv/trunk/arkaiv/tests/functional/test_help.py	                        (rev 0)
+++ arkaiv/trunk/arkaiv/tests/functional/test_help.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -0,0 +1,7 @@
+from arkaiv.tests import *
+
+class TestHelpController(TestController):
+
+    def test_index(self):
+        response = self.app.get(url(controller='help', action='index'))
+        # Test response...

Modified: arkaiv/trunk/data/templates/autohandler.py
===================================================================
--- arkaiv/trunk/data/templates/autohandler.py	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/data/templates/autohandler.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -3,8 +3,8 @@
 __M_dict_builtin = dict
 __M_locals_builtin = locals
 _magic_number = 5
-_modified_time = 1239258391.0692451
-_template_filename=u'/home/dcrowdy/src/arkaiv/trunk/arkaiv/templates/autohandler'
+_modified_time = 1243477198.1538479
+_template_filename=u'/home/dcrowdy/src/arkaiv/working/trunk/arkaiv/templates/autohandler'
 _template_uri=u'/autohandler'
 _template_cache=cache.Cache(__name__, _modified_time)
 _source_encoding=None
@@ -24,19 +24,19 @@
         __M_writer(unicode( h.javascript_include_tag('/javascripts/effects.js', builtins=True) ))
         __M_writer(u' \n\n    </head>\n    <body onkeypress=\'keyPressed(event)\'>\n<p class="header">\n<h1>Arkaiv</h1>\n<div id="navcontainer">\n<ul id="navlist">\n  <li>')
         # SOURCE LINE 13
-        __M_writer(unicode( h.link_to("All Items", h.url_for(action="mainpage")) ))
+        __M_writer(unicode( h.link_to("All Items", h.url_for(controller='page', action="mainpage")) ))
         __M_writer(u'</li>\n  <li>')
         # SOURCE LINE 14
-        __M_writer(unicode( h.link_to("Collections", h.url_for(action="collections")) ))
+        __M_writer(unicode( h.link_to("Collections", h.url_for(controller='collection', action='list')) ))
         __M_writer(u'</li>\n  <li>')
         # SOURCE LINE 15
-        __M_writer(unicode( h.link_to("Add media", h.url_for(action="addannodexform")) ))
+        __M_writer(unicode( h.link_to("Add media", h.url_for(controller='page', action="addannodexform")) ))
         __M_writer(u'</li>\n  <li>')
         # SOURCE LINE 16
-        __M_writer(unicode( h.link_to("Playlists", h.url_for(action="playlistpage")) ))
+        __M_writer(unicode( h.link_to("Playlists", h.url_for(controller='page', action="playlistpage")) ))
         __M_writer(u'</li>\n  <li>')
         # SOURCE LINE 17
-        __M_writer(unicode( h.link_to("Help", h.url_for(action="displayhelp")) ))
+        __M_writer(unicode( h.link_to("Help", h.url_for(controller='help', action='index')) ))
         __M_writer(u'</li>\n  <li><span class="searchpadding">\n')
         # SOURCE LINE 19
         __M_writer(unicode( h.form(h.url_for(action='search'), multipart=True) ))

Modified: arkaiv/trunk/data/templates/autohandler.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/data/templates/collectionexpanded.mak.py
===================================================================
--- arkaiv/trunk/data/templates/collectionexpanded.mak.py	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/data/templates/collectionexpanded.mak.py	2009-05-28 02:37:53 UTC (rev 3934)
@@ -3,7 +3,7 @@
 __M_dict_builtin = dict
 __M_locals_builtin = locals
 _magic_number = 5
-_modified_time = 1240194978.3412549
+_modified_time = 1243477597.0847819
 _template_filename='/home/dcrowdy/src/arkaiv/working/trunk/arkaiv/templates/collectionexpanded.mak'
 _template_uri='/collectionexpanded.mak'
 _template_cache=cache.Cache(__name__, _modified_time)
@@ -39,7 +39,7 @@
             # SOURCE LINE 7
             __M_writer(u'<li>\n    ')
             # SOURCE LINE 8
-            __M_writer(unicode( h.link_to(item['name'], h.url_for(action="displayitem", edit="no", id=item['index'])) ))
+            __M_writer(unicode( h.link_to(item['name'], h.url_for(controller='page', action='displayitem', edit="no", id=item['index'])) ))
             __M_writer(u'\n</li>\n')
         # SOURCE LINE 11
         __M_writer(u'\n\n')

Modified: arkaiv/trunk/data/templates/collectionexpanded.mak.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/production.ini
===================================================================
--- arkaiv/trunk/production.ini	2009-05-27 22:09:08 UTC (rev 3933)
+++ arkaiv/trunk/production.ini	2009-05-28 02:37:53 UTC (rev 3934)
@@ -10,7 +10,7 @@
 error_email_from = paste at localhost
 media_path_base = /var/www/
 archive_loc = /var/www/arkaiv/
-media_url_base = http://localhost/
+media_url_base = http://137.111.156.142/
 
 [server:main]
 use = egg:Paste#http



More information about the commits mailing list