[xiph-commits] r3213 - in arkaiv/trunk: . arkaiv/controllers arkaiv/model arkaiv/public arkaiv/templates data/templates

dcrowdy at svn.annodex.net dcrowdy at svn.annodex.net
Thu Aug 30 04:53:07 PDT 2007


Author: dcrowdy
Date: 2007-08-30 04:53:07 -0700 (Thu, 30 Aug 2007)
New Revision: 3213

Modified:
   arkaiv/trunk/TODO
   arkaiv/trunk/arkaiv/controllers/page.py
   arkaiv/trunk/arkaiv/controllers/page.pyc
   arkaiv/trunk/arkaiv/model/cmmlparser.py
   arkaiv/trunk/arkaiv/model/cmmlparser.pyc
   arkaiv/trunk/arkaiv/public/quick.css
   arkaiv/trunk/arkaiv/templates/autohandler
   arkaiv/trunk/arkaiv/templates/displayitem.mak
   arkaiv/trunk/data/templates/autohandler.py
   arkaiv/trunk/data/templates/autohandler.pyc
   arkaiv/trunk/data/templates/displayitem.mak.py
   arkaiv/trunk/data/templates/displayitem.mak.pyc
Log:
Fixed problems creating clip images when importing cmml files; cleaned up the appearance.


Modified: arkaiv/trunk/TODO
===================================================================
--- arkaiv/trunk/TODO	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/TODO	2007-08-30 11:53:07 UTC (rev 3213)
@@ -1,5 +1,7 @@
 TODO
 
+Handle whitespace in a source file name - doesn't do this at all at the moment
+
 When going to an item from a clip link on the search results page, any
 subsequent attempts to jump to clips fail.  Fix.
 

Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/arkaiv/controllers/page.py	2007-08-30 11:53:07 UTC (rev 3213)
@@ -228,20 +228,22 @@
 
         # create an image to display for the clip
         if has_video == "Yes":
-            basename = os.path.splitext(cmmlfile)[0]
-            imagedirname = basename + "_clipimages"
-            clipimagename = str(clip['starttime']) + ".png"
-            oggsource = model.getsourcepath(clip['itemid'])
-            cwd = os.getcwd()
-            os.chdir(imagedirname)  # ugly...
-            frameimage = Frame(oggsource, clip['starttime'], clipimagename)    
-            os.chdir(cwd)   # very ugly... #
+            clip['img_src'] = self.__createimageforclip(cmmlfile, clip)
+#            basename = os.path.splitext(cmmlfile)[0]
+#            imagedirname = basename + "_clipimages"
+#            clipimagename = str(clip['starttime']) + ".png"
+#            oggsource = model.getsourcepath(clip['itemid'])
+#            cwd = os.getcwd()
+#            os.chdir(imagedirname)  # ugly...
+#            frameimage = Frame(oggsource, clip['starttime'], clipimagename)    
+#            os.chdir(cwd)   # very ugly... #
+#
+#            # add that info to the dictionary - only needs to be a relative
+#            # location
+#
+#            relpath = os.path.split(imagedirname)[1]
+#            clip['img_src'] = relpath + "/" + clipimagename 
 
-            # add that info to the dictionary - only needs to be a relative
-            # location
-
-            relpath = os.path.split(imagedirname)[1]
-            clip['img_src'] = relpath + "/" + clipimagename 
         else:
             clip['img_src'] = ""
 
@@ -284,7 +286,7 @@
         # if no cmml file has been entered, then create one
         if cmmlsource=="":
             print "creating source file"
-            basecmmlname = os.path.splitext(oggsource.filename)[0] + ".cmml"
+            basecmmlname = os.path.splitext(oggsource.filename)[0].replace(' ',"") + ".cmml"
             newcmmlname = os.path.join(archive_loc, basecmmlname)
             parser = cmmlParser()
             #parser.setcmmlfilename(newcmmlname)
@@ -292,14 +294,15 @@
             parser.createnewfile(newcmmlname, fulloggpath)
 
         else:
-            newcmmlname = os.path.join(archive_loc, cmmlsource.filename)
+            newcmmlname = os.path.join(archive_loc, cmmlsource.filename.replace(' ',""))
             permanent_file = open(newcmmlname, 'w')
             shutil.copyfileobj(cmmlsource.file, permanent_file)
             cmmlsource.file.close()
             permanent_file.close()
            
             # Now the ogg file...
-        newoggname = os.path.join(archive_loc, oggsource.filename)
+        # FIXME whitespace is dealt with in a very clumsy manner
+        newoggname = os.path.join(archive_loc, oggsource.filename.replace(' ', ""))
         permanent_file = open(newoggname, 'w')
         shutil.copyfileobj(oggsource.file, permanent_file)
         oggsource.file.close()
@@ -312,14 +315,6 @@
         if not os.path.isdir(imagedirname):
             os.makedirs(imagedirname, mode=0755)
 
-#        cmd = "mplayer -vo png:z=6 -vf scale -zoom -xy 96 -ao null -ss '1000' -frames 2 " + newoggname 
-#        cwd = os.getcwd()
-#        os.chdir(imagedirname)
-#
-#        runit = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE
-#, stderr=subprocess.PIPE)
-#        out, err = runit.communicate()
-#        os.chdir(cwd)   # very ugly... better image creation needed allround really.
                 
         # Get the title for the item (head title)
         parser = cmmlParser()
@@ -345,9 +340,18 @@
 
         # Now extract any clip information and add it to the database
 	    # get a list of dictionary objects
-        cliplist = parser.getclipsfromcmml(newcmmlname)  
+
+        o = OggzInfo(newoggname)
+        cliplist = parser.getclipsfromcmml()  
         for clipdict in cliplist:
             clipdict['itemid'] = newitemid
+            if o.has_video():
+                # get a still image for the correct frame
+                print "getting a clip image"
+                #clipdict['img_src'] = ""
+                clipdict['img_src'] = self.__createimageforclip(newcmmlname, clipdict)
+            else:
+                clipdict['img_src'] = ""
             model.addclip(clipdict)
 
         # Extract meta info from the head and add to database
@@ -421,14 +425,16 @@
         directory = request.params['mediadir']
         files = os.listdir(directory)
         for file in files:
-            if os.path.splitext(file)[1] == ".cmml":
-                oggfilename = directory + os.path.splitext(file)[0] + ".ogg"
-                cmmlfilename = directory + file
-                print "importing: " + cmmlfilename + " " + oggfilename
-                self.__localdirimport(cmmlfilename, oggfilename)
-            else:
-                print "moving right past: " + file
-
+            try:
+                if os.path.splitext(file)[1] == ".cmml":
+                    oggfilename = directory + os.path.splitext(file)[0] + ".ogg"
+                    cmmlfilename = directory + file
+                    print "importing: " + cmmlfilename + " " + oggfilename
+                    self.__localdirimport(cmmlfilename, oggfilename)
+                else:
+                    print "moving right past: " + file
+            except:
+                print " problem with " + file
         return
  
     def __localdirimport(self, cmmlfilename, oggfilename): 
@@ -468,7 +474,7 @@
         headid = model.addhead(headinfo)
         # Now extract any clip information and add it to the database
         # get a list of dictionary objects
-        cliplist = parser.getclipsfromcmml(newcmmlname)  
+        cliplist = parser.getclipsfromcmml()  
         for clipdict in cliplist:
             clipdict['itemid'] = newitemid
             model.addclip(clipdict)
@@ -497,4 +503,27 @@
         model.additemtocollection(headinfo['itemid'], collection)
         return		
 
+    def __createimageforclip(self, cmmlfile, clipinfo):
+#        print "cmmlfile: " + cmmlfile
+#        print clipinfo
+        basename = os.path.splitext(cmmlfile)[0]
+#        print basename
+        imagedirname = basename + "_clipimages"
+        clipimagename = str(clipinfo['starttime']) + ".png"
+#        print "clip name: " + clipimagename
+        oggsource = model.getsourcepath(clipinfo['itemid'])
+#        print oggsource
+        cwd = os.getcwd()
+#        print cwd
+        os.chdir(imagedirname)  # ugly...
+        frameimage = Frame(oggsource, int(clipinfo['starttime']), clipimagename)    
+        print "after frameimage"
+        os.chdir(cwd)   # very ugly... #
 
+        # add that info to the dictionary - only needs to be a relative
+        # location
+        relpath = os.path.split(imagedirname)[1]
+        imagefile = relpath + "/" + clipimagename
+#        print imagefile
+        return imagefile
+

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

Modified: arkaiv/trunk/arkaiv/model/cmmlparser.py
===================================================================
--- arkaiv/trunk/arkaiv/model/cmmlparser.py	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/arkaiv/model/cmmlparser.py	2007-08-30 11:53:07 UTC (rev 3213)
@@ -87,11 +87,11 @@
 
         return title
 
-    def getclipsfromcmml(self, cmmlfilename):
-        Etree = ElementTree
-        doc = Etree.parse(cmmlfilename)
-        root = doc.getroot()
-        clips = root.getiterator('clip')
+    def getclipsfromcmml(self):
+        """ returns a dictionary of clips from the object's cmmlfile
+
+        """
+        clips = self.root.getiterator('clip')
         cliplist = []
         for clip in clips:
             clipdict = {}
@@ -99,9 +99,9 @@
             clipdict['starttime'] = clip.get('start')    
             desc = clip.find('desc')
             clipdict['desc'] = desc.text
-            clipdict['a_href'] = None
-            clipdict['a_text'] = None
-            clipdict['img_src'] = None
+            clipdict['a_href'] = None  # FIXME
+            clipdict['a_text'] = None  # FIXME
+            clipdict['img_src'] = None # FIXME
 
             cliplist.append(clipdict)
 
@@ -142,7 +142,7 @@
             newclip.set('start', str(clip['start_time']))
             newclip.set('id', clip['id'])
             img = Etree.SubElement(newclip, 'img')
-            img.set('src', clip['img_src'])
+            img.set('src', str(clip['img_src']))
             desc = Etree.SubElement(newclip, 'desc')
             desc.text = clip['desc']
         

Modified: arkaiv/trunk/arkaiv/model/cmmlparser.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/public/quick.css
===================================================================
--- arkaiv/trunk/arkaiv/public/quick.css	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/arkaiv/public/quick.css	2007-08-30 11:53:07 UTC (rev 3213)
@@ -1,42 +1,107 @@
 body {
-    font-family: sans-serif;
-    background-color: #888;
+    font-family: Helvetica, Verdana, Arial, sans-serif;
+    font-size: small;
+    background-color: #efefef;
     margin: 25px;
 }
+a:link{
+    color: #369;
+}
+a:visited{
+    color: #00f;
+}
+a:hover{
+    color: #000;
+}
+a:active{
+    color: #666;
+}
+
+
 div.content{
     font-family: sans-serif;
     margin: 0;
     margin-bottom: 10px;
-    background-color: #d3e0ea;
+    background-color: #ccc; /*#d3e0ea */
     border: 5px solid #333;
-    padding: 5px 25px 25px 25px;
+/*    padding: 5px 25px 25px 25px;*/
 }
 #video{
     float: left;
-    width: 60%;
-    background-color: #d3e0ea;
+    width: 50%;
+/*    max-width: 350px*/
+    background-color: #ccc;
     font-family: sans-serif;
-    font-size: small
+    font-size: small;
+    /*padding: 10px 20px 10px 40px;*/
+    padding-left: 10px;
 }
 #clips{
     float: left;
-    width: 40%;
+    width: 45%;
     height: 500px;
     overflow: scroll;
     font-family: sans-serif;
     font-size: small
+    padding-left: 10px;
 }
 
 div.sourceinfo{
     font-size: small
 }
+
 h1.main{
     width: 100%;
     border-bottom: 1px solid #000;
 }
+
 p.footer{
     width: 100%;
     padding-top: 3px;
-    border-top: 1px solid #000;
+    /*border-top: 1px solid #000;*/
 }
 
+#navcontainer ul {
+	padding-left: 0;
+	margin-left: 0;
+	background-color: #036;
+	color: #fff;
+	float: left;
+	/*height: 40px;*/
+	font-size: 18px;
+	width: 100%;
+	font-family: Helvetica, Verdana, Arial, sans-serif;
+}
+
+#navcontainer ul li { display: inline; }
+
+#navcontainer ul li a {
+	padding: 0.7em 1em;
+	/* padding: 11px 15px; */
+	background-color: #036;
+	color: #fff;
+	text-decoration: none;
+	float: left;
+	border-right: 1px solid #fff;
+}
+
+#navcontainer ul li .searchpadding {
+	/* padding: 0.6em 1em;*/
+	padding: 10px 15px 11px 15px;
+ 	background-color: #036;
+	color: #fff;
+	text-decoration: none;
+	float: left;
+	border-right: 1px solid #fff;
+}
+
+#navcontainer ul li a:hover {
+	background-color: #369;
+	color: #fff;
+}
+
+#navcontainer ul li a:active {
+	background-color: #fb0;
+	color: #fff;
+}
+

Modified: arkaiv/trunk/arkaiv/templates/autohandler
===================================================================
--- arkaiv/trunk/arkaiv/templates/autohandler	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/arkaiv/templates/autohandler	2007-08-30 11:53:07 UTC (rev 3213)
@@ -6,22 +6,24 @@
 
     </head>
     <body>
-        <p class="header">
+<p class="header">
 <h1>Arkaiv</h1>
-<table cellpadding="10">
-<tr>
-<td>${ h.link_to("All Items", h.url(action="mainpage")) } </td>
-<td>${ h.link_to("Collections", h.url(action="collections")) } </td>
-<td>${ h.link_to("Add annodex media", h.url(action="addannodexform")) }</td>
-<td>
-${ h.form(h.url(action='search'), multipart=True) } 
+<div id="navcontainer">
+<ul id="navlist">
+  <li>${ h.link_to("All Items", h.url(action="mainpage")) }</li>
+  <li>${ h.link_to("Collections", h.url(action="collections")) }</li>
+  <li>${ h.link_to("Add annodex media", h.url(action="addannodexform")) }</li>
+  <li><span class="searchpadding">
+${ h.form(h.url(action='search'), multipart=True) }
 ${ h.text_field('searchterms', value="Search") } 
 <!--${ h.submit('Submit') }-->
 ${ h.end_form() } 
-</td>
-</tr>
-</table>
-        </p>
+  </span>
+  </li>
+</ul>
+</div>
+</p>
+
         <!--div class="content"-->
 ${next.body()}
         <p class="footer">

Modified: arkaiv/trunk/arkaiv/templates/displayitem.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/displayitem.mak	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/arkaiv/templates/displayitem.mak	2007-08-30 11:53:07 UTC (rev 3213)
@@ -137,10 +137,9 @@
 <table style="font-size:small">
 <tr>
   <td></td>
-  <td>Start time</td>
-  <td>Id</td>
-  <td>Description</td>
-  <td>a_href</td> 
+  <td>Time</td>
+  <td></td>
+  <td></td> 
 </tr>
 % for clipinfo in c.cliplist:
 <tr>
@@ -148,10 +147,9 @@
    <td><a onclick="javascript:SetLocation('${c.sourcedict['urlpath']}?id=${clipinfo['id']}')"><img src="${c.sourcedict['clipimageurl']}${clipinfo['img_src']}"></a></td>
 % endif
 %     if c.sourcedict['has_video'] == "No":
-   <td><a onclick="javascript:SetLocation('${c.sourcedict['urlpath']}?id=${clipinfo['id']}')"><img src="/public/blank.png"></a></td>
+   <td><a onclick="javascript:SetLocation('${c.sourcedict['urlpath']}?id=${clipinfo['id']}')"><img src="/images/blank.png"></a></td>
 % endif
     <td>${clipinfo['start_time']}</td>
-    <td>${clipinfo['id']}</td>
     <td>${clipinfo['desc']}</td>
     <td>${clipinfo['a_href']}</td>
 

Modified: arkaiv/trunk/data/templates/autohandler.py
===================================================================
--- arkaiv/trunk/data/templates/autohandler.py	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/data/templates/autohandler.py	2007-08-30 11:53:07 UTC (rev 3213)
@@ -1,7 +1,7 @@
 from mako import runtime, filters, cache
 UNDEFINED = runtime.UNDEFINED
 _magic_number = 2
-_modified_time = 1188364190.6814849
+_modified_time = 1188463289.27105
 _template_filename=u'/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/autohandler'
 _template_uri=u'/autohandler'
 _template_cache=cache.Cache(__name__, _modified_time)
@@ -19,19 +19,19 @@
         context.write(u'<html>\n    <head>\n        <title>Arkaiv</title>\n            <link rel="stylesheet" href="/quick.css"></link>\n')
         # SOURCE LINE 5
         context.write(unicode( h.javascript_include_tag('/javascripts/effects.js', builtins=True) ))
-        context.write(u' \n\n    </head>\n    <body>\n        <p class="header">\n<h1>Arkaiv</h1>\n<table cellpadding="10">\n<tr>\n<td>')
+        context.write(u' \n\n    </head>\n    <body>\n<p class="header">\n<h1>Arkaiv</h1>\n<div id="navcontainer">\n<ul id="navlist">\n  <li>')
         # SOURCE LINE 13
         context.write(unicode( h.link_to("All Items", h.url(action="mainpage")) ))
-        context.write(u' </td>\n<td>')
+        context.write(u'</li>\n  <li>')
         # SOURCE LINE 14
         context.write(unicode( h.link_to("Collections", h.url(action="collections")) ))
-        context.write(u' </td>\n<td>')
+        context.write(u'</li>\n  <li>')
         # SOURCE LINE 15
         context.write(unicode( h.link_to("Add annodex media", h.url(action="addannodexform")) ))
-        context.write(u'</td>\n<td>\n')
+        context.write(u'</li>\n  <li><span class="searchpadding">\n')
         # SOURCE LINE 17
         context.write(unicode( h.form(h.url(action='search'), multipart=True) ))
-        context.write(u' \n')
+        context.write(u'\n')
         # SOURCE LINE 18
         context.write(unicode( h.text_field('searchterms', value="Search") ))
         context.write(u' \n<!--')
@@ -40,8 +40,8 @@
         context.write(u'-->\n')
         # SOURCE LINE 20
         context.write(unicode( h.end_form() ))
-        context.write(u' \n</td>\n</tr>\n</table>\n        </p>\n        <!--div class="content"-->\n')
-        # SOURCE LINE 26
+        context.write(u' \n  </span>\n  </li>\n</ul>\n</div>\n</p>\n\n        <!--div class="content"-->\n')
+        # SOURCE LINE 28
         context.write(unicode(next.body()))
         context.write(u'\n        <p class="footer">\n        </p>\n        <!--/div-->\n    </body>\n</html>\n\n')
         return ''

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

Modified: arkaiv/trunk/data/templates/displayitem.mak.py
===================================================================
--- arkaiv/trunk/data/templates/displayitem.mak.py	2007-08-30 00:49:32 UTC (rev 3212)
+++ arkaiv/trunk/data/templates/displayitem.mak.py	2007-08-30 11:53:07 UTC (rev 3213)
@@ -1,7 +1,7 @@
 from mako import runtime, filters, cache
 UNDEFINED = runtime.UNDEFINED
 _magic_number = 2
-_modified_time = 1188430842.531039
+_modified_time = 1188439839.8722601
 _template_filename='/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/displayitem.mak'
 _template_uri='/displayitem.mak'
 _template_cache=cache.Cache(__name__, _modified_time)
@@ -136,14 +136,14 @@
         context.write(u'</td>\n</tr>\n<tr>\n<td>Has audio: </td><td>')
         # SOURCE LINE 127
         context.write(unicode(c.sourcedict['has_audio']))
-        context.write(u'</td>\n</tr>\n</table>\n\n<!--/div!-->\n</div>\n\n<div id="clips">\nClips:\n<br />\n<table style="font-size:small">\n<tr>\n  <td></td>\n  <td>Start time</td>\n  <td>Id</td>\n  <td>Description</td>\n  <td>a_href</td> \n</tr>\n')
-        # SOURCE LINE 145
+        context.write(u'</td>\n</tr>\n</table>\n\n<!--/div!-->\n</div>\n\n<div id="clips">\nClips:\n<br />\n<table style="font-size:small">\n<tr>\n  <td></td>\n  <td>Time</td>\n  <td></td>\n  <td></td> \n</tr>\n')
+        # SOURCE LINE 144
         for clipinfo in c.cliplist:
-            # SOURCE LINE 146
+            # SOURCE LINE 145
             context.write(u'<tr>\n')
-            # SOURCE LINE 147
+            # SOURCE LINE 146
             if c.sourcedict['has_video'] == "Yes":
-                # SOURCE LINE 148
+                # SOURCE LINE 147
                 context.write(u'   <td><a onclick="javascript:SetLocation(\'')
                 context.write(unicode(c.sourcedict['urlpath']))
                 context.write(u'?id=')
@@ -152,78 +152,75 @@
                 context.write(unicode(c.sourcedict['clipimageurl']))
                 context.write(unicode(clipinfo['img_src']))
                 context.write(u'"></a></td>\n')
-            # SOURCE LINE 150
+            # SOURCE LINE 149
             if c.sourcedict['has_video'] == "No":
-                # SOURCE LINE 151
+                # SOURCE LINE 150
                 context.write(u'   <td><a onclick="javascript:SetLocation(\'')
                 context.write(unicode(c.sourcedict['urlpath']))
                 context.write(u'?id=')
                 context.write(unicode(clipinfo['id']))
-                context.write(u'\')"><img src="/public/blank.png"></a></td>\n')
-            # SOURCE LINE 153
+                context.write(u'\')"><img src="/images/blank.png"></a></td>\n')
+            # SOURCE LINE 152
             context.write(u'    <td>')
             context.write(unicode(clipinfo['start_time']))
             context.write(u'</td>\n    <td>')
-            # SOURCE LINE 154
-            context.write(unicode(clipinfo['id']))
-            context.write(u'</td>\n    <td>')
-            # SOURCE LINE 155
+            # SOURCE LINE 153
             context.write(unicode(clipinfo['desc']))
             context.write(u'</td>\n    <td>')
-            # SOURCE LINE 156
+            # SOURCE LINE 154
             context.write(unicode(clipinfo['a_href']))
             context.write(u'</td>\n\n\n')
-            # SOURCE LINE 159
+            # SOURCE LINE 157
             context.write(unicode( h.form(h.url(action='deleteclip'), multipart=True) ))
             context.write(u'\n<td>')
-            # SOURCE LINE 160
+            # SOURCE LINE 158
             context.write(unicode( h.submit('Delete') ))
             context.write(u' </td>\n')
-            # SOURCE LINE 161
+            # SOURCE LINE 159
             context.write(unicode( h.hidden_field('clipid', value=clipinfo['ixc']) ))
             context.write(u'\n')
-            # SOURCE LINE 162
+            # SOURCE LINE 160
             context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
             context.write(u'\n')
-            # SOURCE LINE 163
+            # SOURCE LINE 161
             context.write(unicode( h.end_form() ))
             context.write(u' \n\n\n</tr> \n')
-        # SOURCE LINE 168
+        # SOURCE LINE 166
         context.write(u'</table>\n\nAdd new clip:\n')
-        # SOURCE LINE 171
+        # SOURCE LINE 169
         context.write(unicode( h.form(h.url(action='addclip'), multipart=True) ))
         context.write(u'\n<table style="font-size:small">\n<tr>\n    <td>Start time</td>\n  <td>')
-        # SOURCE LINE 175
+        # SOURCE LINE 173
         context.write(unicode( h.text_field('starttime', size=5) ))
         context.write(u'</td>\n    <td>a_text</td>\n  <td>')
-        # SOURCE LINE 177
+        # SOURCE LINE 175
         context.write(unicode( h.text_field('a_text') ))
         context.write(u'</td>\n</tr>\n<tr>\n    <td>Id</td>\n  <td>')
-        # SOURCE LINE 181
+        # SOURCE LINE 179
         context.write(unicode( h.text_field('id', size=5) ))
         context.write(u'</td>\n    <td>a_href</td>\n  <td>')
-        # SOURCE LINE 183
+        # SOURCE LINE 181
         context.write(unicode( h.text_field('a_href') ))
         context.write(u'</td>\n</tr>\n<tr>\n    <td>img_src</td>\n  <td>')
-        # SOURCE LINE 187
+        # SOURCE LINE 185
         context.write(unicode( h.text_field('img_src', size=5) ))
         context.write(u'</td>\n    <td>desc</td>\n  <td>')
-        # SOURCE LINE 189
+        # SOURCE LINE 187
         context.write(unicode( h.text_field('desc') ))
         context.write(u'</td>\n</tr>\n</table>\n')
-        # SOURCE LINE 192
+        # SOURCE LINE 190
         context.write(unicode( h.hidden_field('headindex', value = c.headdict['ixh']) ))
         context.write(u'\n')
-        # SOURCE LINE 193
+        # SOURCE LINE 191
         context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
         context.write(u'\n')
-        # SOURCE LINE 194
+        # SOURCE LINE 192
         context.write(unicode( h.hidden_field('hasvideo', value=c.sourcedict['has_video']) ))
         context.write(u'\n\n')
-        # SOURCE LINE 196
+        # SOURCE LINE 194
         context.write(unicode( h.submit('Add') ))
         context.write(u' \n')
-        # SOURCE LINE 197
+        # SOURCE LINE 195
         context.write(unicode( h.end_form() ))
         context.write(u' \n</div>\n<script>\nvar plugin = document.embeds[0];\nvar input  = document.api.ifield;\nvar goto  = document.api.gotofield;\nvar output = document.api.ofield;\n\nfunction Play() {\n  plugin.play();\n  addOutput("Play!");\n}\n\nfunction Pause() {\n  plugin.pause();\n  addOutput("Pause!");\n}\n\nfunction SetLocation(location) {\n//  plugin.setPlayPosition(location);\n  plugin.setCurrentMovie(location);\n  addOutput("Current movie: " + plugin.getCurrentMovie());\n  addOutput("setting a location: " + location + " ms");\n}\n\nfunction GetPlayPosition() {\n  addOutput("Play position: " + plugin.getPlayPosition() + " ms");\n}\n\nfunction skip(dir) {\n//    addOutput("we get here")\n    i = getInput();\n    addOutput("i is " + i);\n    if (i <= 0) i = 1000;\n    addOutput("dir is " + dir);\n    t = plugin.getPlayPosition() + (i * dir);\n    addOutput("t is " + t);\n    addOutput("Skipping by " + i + " to " + t + " ms - " +\n            (plugin.setPlayPositi
 on(t) ? "succeeded" : "failed"));\n}\n\nfunction getInput() {\n  i = parseInt(input.value);\n  return isNaN(i) ? 0 : i;\n}\n\nfunction getGoto() {\n  i = parseInt(goto.value);\n  return isNaN(i) ? 0 : i;\n}\n\n\nfunction GotoPosition() {\n  i = getGoto();\n  i = i * 1000;\n  plugin.setPlayPosition(i);\n}\n\nvar outLines = 0;\n\nfunction addOutput(str) {\n  if (outLines == 0) {\n    output.value = str;\n  } else {\n    output.value = str + "\\n" + output.value;\n  }\n  outLines++;\n  if (outLines == 11) {\n    i = output.value.lastIndexOf("\\n");\n    output.value = output.value.substr(0, i);\n    outLines--;\n  }\n}\n</script>\n\n')
         return ''

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



More information about the commits mailing list