Changeset 3210
- Timestamp:
- 2007-08-29 17:30:37 (1 year ago)
- Files:
-
- arkaiv/trunk/README.txt (modified) (2 diffs)
- arkaiv/trunk/TODO (modified) (2 diffs)
- arkaiv/trunk/arkaiv/controllers/page.py (modified) (2 diffs)
- arkaiv/trunk/arkaiv/controllers/page.pyc (modified) (previous)
- arkaiv/trunk/arkaiv/model/framer.py (added)
- arkaiv/trunk/arkaiv/templates/displayitem.mak (modified) (1 diff)
- arkaiv/trunk/data/templates/displayitem.mak.py (modified) (2 diffs)
- arkaiv/trunk/data/templates/displayitem.mak.pyc (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
arkaiv/trunk/README.txt
r3208 r3210 11 11 python-lxml 12 12 sqlite3 13 Python gst (0.10) 13 14 14 15 Recent annodex libraries - including python-annodex and mod_annodex for apache 15 16 - see http://www.annodex.net 16 17 17 18 18 Pylons 0.9.6 … … 34 34 35 35 INSTALLATION 36 37 Only tested under linux so far. 36 38 37 39 Unpack the tarball, enter the directory, and edit production.ini to suit your arkaiv/trunk/TODO
r3206 r3210 1 1 TODO 2 2 3 When going to an item from a clip link on the search results page, any 4 subsequent attempts to jump to clips fail. Fix. 5 3 6 Better screen layout in the main display page needed 4 5 Clips should have an image generated for the link display6 7 7 8 Just been at a coding gathering at Silvia Pfeiffer's house, and Marcin Lubonski … … 20 21 21 22 DONE 23 24 Thu Aug 30 09:43:10 EST 2007 25 26 Clips should have an image generated for the link display 22 27 23 28 Mon Aug 27 11:09:20 EST 2007 arkaiv/trunk/arkaiv/controllers/page.py
r3209 r3210 27 27 #from arkaiv.model.anxparser import anxParser 28 28 from arkaiv.model.cmmlparser import cmmlParser 29 from arkaiv.model.framer import Frame 29 30 30 31 log = logging.getLogger(__name__) … … 230 231 basename = os.path.splitext(cmmlfile)[0] 231 232 imagedirname = basename + "_clipimages" 232 233 clipimagename = str(clip['starttime']) + ".png" 233 234 oggsource = model.getsourcepath(clip['itemid']) 234 235 # create an image using mplayer236 cmd = "mplayer -vo png:z=6 -vf scale -zoom -xy 96 -ao null -ss '" + str(clip['starttime']) + "' -frames 2 " + oggsource237 235 cwd = os.getcwd() 238 os.chdir(imagedirname) 239 240 runit = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE 241 , stderr=subprocess.PIPE) 242 out, err = runit.communicate() 243 # and the file we want will be called 00000002.png... 244 # so rename to something more descriptive 245 clipimagename = str(clip['starttime']) + ".png" 246 shutil.move("00000002.png", clipimagename) 247 os.chdir(cwd) # very ugly... better image creation needed allround really. 248 249 # add that info to the dictionary - only needs to be a relative location 236 os.chdir(imagedirname) # ugly... 237 frameimage = Frame(oggsource, clip['starttime'], clipimagename) 238 os.chdir(cwd) # very ugly... # 239 240 # add that info to the dictionary - only needs to be a relative 241 # location 242 250 243 relpath = os.path.split(imagedirname)[1] 251 244 clip['img_src'] = relpath + "/" + clipimagename arkaiv/trunk/arkaiv/templates/displayitem.mak
r3209 r3210 145 145 % for clipinfo in c.cliplist: 146 146 <tr> 147 % if c.sourcedict['has_video'] == "Yes": 147 148 <td><a onclick="javascript:SetLocation('${c.sourcedict['urlpath']}?id=${clipinfo['id']}')"><img src="${c.sourcedict['clipimageurl']}${clipinfo['img_src']}"></a></td> 149 % endif 150 % if c.sourcedict['has_video'] == "No": 151 <td><a onclick="javascript:SetLocation('${c.sourcedict['urlpath']}?id=${clipinfo['id']}')"><img src="/public/blank.png"></a></td> 152 % endif 148 153 <td>${clipinfo['start_time']}</td> 149 154 <td>${clipinfo['id']}</td> arkaiv/trunk/data/templates/displayitem.mak.py
r3209 r3210 2 2 UNDEFINED = runtime.UNDEFINED 3 3 _magic_number = 2 4 _modified_time = 1188 390221.02959394 _modified_time = 1188430842.531039 5 5 _template_filename='/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/displayitem.mak' 6 6 _template_uri='/displayitem.mak' … … 141 141 for clipinfo in c.cliplist: 142 142 # SOURCE LINE 146 143 context.write(u'<tr>\n <td><a onclick="javascript:SetLocation(\'')143 context.write(u'<tr>\n') 144 144 # SOURCE LINE 147 145 context.write(unicode(c.sourcedict['urlpath'])) 146 context.write(u'?id=') 147 context.write(unicode(clipinfo['id'])) 148 context.write(u'\')"><img src="') 149 context.write(unicode(c.sourcedict['clipimageurl'])) 150 context.write(unicode(clipinfo['img_src'])) 151 context.write(u'"></a></td>\n <td>') 152 # SOURCE LINE 148 145 if c.sourcedict['has_video'] == "Yes": 146 # SOURCE LINE 148 147 context.write(u' <td><a onclick="javascript:SetLocation(\'') 148 context.write(unicode(c.sourcedict['urlpath'])) 149 context.write(u'?id=') 150 context.write(unicode(clipinfo['id'])) 151 context.write(u'\')"><img src="') 152 context.write(unicode(c.sourcedict['clipimageurl'])) 153 context.write(unicode(clipinfo['img_src'])) 154 context.write(u'"></a></td>\n') 155 # SOURCE LINE 150 156 if c.sourcedict['has_video'] == "No": 157 # SOURCE LINE 151 158 context.write(u' <td><a onclick="javascript:SetLocation(\'') 159 context.write(unicode(c.sourcedict['urlpath'])) 160 context.write(u'?id=') 161 context.write(unicode(clipinfo['id'])) 162 context.write(u'\')"><img src="/public/blank.png"></a></td>\n') 163 # SOURCE LINE 153 164 context.write(u' <td>') 153 165 context.write(unicode(clipinfo['start_time'])) 154 166 context.write(u'</td>\n <td>') 155 # SOURCE LINE 1 49167 # SOURCE LINE 154 156 168 context.write(unicode(clipinfo['id'])) 157 169 context.write(u'</td>\n <td>') 158 # SOURCE LINE 15 0170 # SOURCE LINE 155 159 171 context.write(unicode(clipinfo['desc'])) 160 172 context.write(u'</td>\n <td>') 161 # SOURCE LINE 15 1173 # SOURCE LINE 156 162 174 context.write(unicode(clipinfo['a_href'])) 163 175 context.write(u'</td>\n\n\n') 164 # SOURCE LINE 15 4176 # SOURCE LINE 159 165 177 context.write(unicode( h.form(h.url(action='deleteclip'), multipart=True) )) 166 178 context.write(u'\n<td>') 167 # SOURCE LINE 1 55179 # SOURCE LINE 160 168 180 context.write(unicode( h.submit('Delete') )) 169 181 context.write(u' </td>\n') 170 # SOURCE LINE 1 56182 # SOURCE LINE 161 171 183 context.write(unicode( h.hidden_field('clipid', value=clipinfo['ixc']) )) 172 184 context.write(u'\n') 173 # SOURCE LINE 1 57185 # SOURCE LINE 162 174 186 context.write(unicode( h.hidden_field('itemid', value=c.itemid) )) 175 187 context.write(u'\n') 176 # SOURCE LINE 1 58188 # SOURCE LINE 163 177 189 context.write(unicode( h.end_form() )) 178 190 context.write(u' \n\n\n</tr> \n') 179 # SOURCE LINE 16 3191 # SOURCE LINE 168 180 192 context.write(u'</table>\n\nAdd new clip:\n') 181 # SOURCE LINE 1 66193 # SOURCE LINE 171 182 194 context.write(unicode( h.form(h.url(action='addclip'), multipart=True) )) 183 195 context.write(u'\n<table style="font-size:small">\n<tr>\n <td>Start time</td>\n <td>') 184 # SOURCE LINE 17 0196 # SOURCE LINE 175 185 197 context.write(unicode( h.text_field('starttime', size=5) )) 186 198 context.write(u'</td>\n <td>a_text</td>\n <td>') 187 # SOURCE LINE 17 2199 # SOURCE LINE 177 188 200 context.write(unicode( h.text_field('a_text') )) 189 201 context.write(u'</td>\n</tr>\n<tr>\n <td>Id</td>\n <td>') 190 # SOURCE LINE 1 76202 # SOURCE LINE 181 191 203 context.write(unicode( h.text_field('id', size=5) )) 192 204 context.write(u'</td>\n <td>a_href</td>\n <td>') 193 # SOURCE LINE 1 78205 # SOURCE LINE 183 194 206 context.write(unicode( h.text_field('a_href') )) 195 207 context.write(u'</td>\n</tr>\n<tr>\n <td>img_src</td>\n <td>') 196 # SOURCE LINE 18 2208 # SOURCE LINE 187 197 209 context.write(unicode( h.text_field('img_src', size=5) )) 198 210 context.write(u'</td>\n <td>desc</td>\n <td>') 199 # SOURCE LINE 18 4211 # SOURCE LINE 189 200 212 context.write(unicode( h.text_field('desc') )) 201 213 context.write(u'</td>\n</tr>\n</table>\n') 202 # SOURCE LINE 1 87214 # SOURCE LINE 192 203 215 context.write(unicode( h.hidden_field('headindex', value = c.headdict['ixh']) )) 204 216 context.write(u'\n') 205 # SOURCE LINE 1 88206 context.write(unicode( h.hidden_field('itemid', value=c.itemid) )) 207 context.write(u'\n') 208 # SOURCE LINE 1 89217 # SOURCE LINE 193 218 context.write(unicode( h.hidden_field('itemid', value=c.itemid) )) 219 context.write(u'\n') 220 # SOURCE LINE 194 209 221 context.write(unicode( h.hidden_field('hasvideo', value=c.sourcedict['has_video']) )) 210 222 context.write(u'\n\n') 211 # SOURCE LINE 19 1223 # SOURCE LINE 196 212 224 context.write(unicode( h.submit('Add') )) 213 225 context.write(u' \n') 214 # SOURCE LINE 19 2226 # SOURCE LINE 197 215 227 context.write(unicode( h.end_form() )) 216 228 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.setPlayPosition(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')