[open-allure-ds] 4 new revisions pushed by jg07...@gmail.com on 2011-11-26 01:09 GMT

3 views
Skip to first unread message

open-al...@googlecode.com

unread,
Nov 25, 2011, 8:10:20 PM11/25/11
to open-al...@googlegroups.com
4 new revisions:

Revision: a74fb9c53251
Author: John Graves
Date: Fri Nov 11 23:49:48 2011
Log: Comment out use of swift (temporary)
http://code.google.com/p/open-allure-ds/source/detail?r=a74fb9c53251

Revision: 468fbd5b30c5
Author: John Graves
Date: Fri Nov 25 16:43:11 2011
Log: Access titanpad as well as etherpad
http://code.google.com/p/open-allure-ds/source/detail?r=468fbd5b30c5

Revision: 3bfd79c74dc6
Author: John Graves
Date: Fri Nov 25 16:53:15 2011
Log: Add static image files
http://code.google.com/p/open-allure-ds/source/detail?r=3bfd79c74dc6

Revision: 5a9036d0bd68
Author: John Graves
Date: Fri Nov 25 17:09:02 2011
Log: Merge odp2wts.py from Mac
http://code.google.com/p/open-allure-ds/source/detail?r=5a9036d0bd68

==============================================================================
Revision: a74fb9c53251
Author: John Graves
Date: Fri Nov 11 23:49:48 2011
Log: Comment out use of swift (temporary)
http://code.google.com/p/open-allure-ds/source/detail?r=a74fb9c53251

Added:
/odp2wts/silence22kHz.ogg
Modified:
/odp2wts/odp2wts.py
/wikitospeech/BeautifulSoup.pyc
/wikitospeech/objects.pyc
/wikitospeech/scriptParser.pyc
/wikitospeech/voice.pyc

=======================================
--- /dev/null
+++ /odp2wts/silence22kHz.ogg Fri Nov 11 23:49:48 2011
Binary file, no diff available.
=======================================
--- /odp2wts/odp2wts.py Sun Oct 2 02:19:15 2011
+++ /odp2wts/odp2wts.py Fri Nov 11 23:49:48 2011
@@ -250,7 +250,7 @@

if ((0 != len(odpFile)) and (os.path.exists(odpFilePath))):
# Save file name to config file
- config['Files']['lastOdpFile'] = lastOdpFile
+ config['Files']['lastOdpFile'] = odpFilePath
config.write()

odpName = odpFile.replace(".odp","")
@@ -341,23 +341,7 @@
f.write('del '+imageFilePrefix+onImgStr+'.wav\n')
else:
# For Mac OSX
-# f.write("/usr/bin/say -o "+imageFilePrefix+onImgStr+'.aiff "')
-# lines = item.split("\n")
-# for linenum, line in enumerate(lines):
-# line.replace('"',' ').replace('`',' ').replace(';',' ')
-# if not line.startswith("["):
-# f.write(line+" ")
-# elif linenum>0:
-# break
-# # f.write(item)
-# f.write('"\n')
-# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.aiff "'+
-# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.ogg"\n')
-# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.aiff "'+
-# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.mp3"\n')
-# f.write("rm "+imageFilePrefix+onImgStr+'.aiff\n')
-
- f.write("swift -n Marta -e utf-8 -m text
-o "+imageFilePrefix+onImgStr+'.wav "')
+ f.write("/usr/bin/say -o "+imageFilePrefix+onImgStr+'.aiff "')
lines = item.split("\n")
for linenum, line in enumerate(lines):
line.replace('"',' ').replace('`',' ').replace(';',' ')
@@ -367,11 +351,27 @@
break
# f.write(item)
f.write('"\n')
- f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
+ f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.aiff "'+
odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.ogg"\n')
- f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
+ f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.aiff "'+
odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.mp3"\n')
- f.write("rm "+imageFilePrefix+onImgStr+'.wav\n')
+ f.write("rm "+imageFilePrefix+onImgStr+'.aiff\n')
+
+# f.write("swift -n Marta -e utf-8 -m text
-o "+imageFilePrefix+onImgStr+'.wav "')
+# lines = item.split("\n")
+# for linenum, line in enumerate(lines):
+# line.replace('"',' ').replace('`',' ').replace(';',' ')
+# if not line.startswith("["):
+# f.write(line+" ")
+# elif linenum>0:
+# break
+# # f.write(item)
+# f.write('"\n')
+# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
+# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.ogg"\n')
+# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
+# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.mp3"\n')
+# f.write("rm "+imageFilePrefix+onImgStr+'.wav\n')

def writeHtmlHeader(htmlFile):
htmlFile.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"' + "\n")
@@ -492,7 +492,7 @@
'();\n')
htmlFile.write('}\n')

- if answer.action > 0:
+ if (answer.action > 0 and position+answer.action <
len(questionFileNames)):
htmlFile.write('function advance'+
str(answerNum)+
'()\n{\n')
=======================================
--- /wikitospeech/BeautifulSoup.pyc Wed Aug 24 19:13:11 2011
+++ /wikitospeech/BeautifulSoup.pyc Fri Nov 11 23:49:48 2011
Binary file, no diff available.
=======================================
--- /wikitospeech/objects.pyc Wed Aug 24 19:13:11 2011
+++ /wikitospeech/objects.pyc Fri Nov 11 23:49:48 2011
Binary file, no diff available.
=======================================
--- /wikitospeech/scriptParser.pyc Wed Aug 24 19:13:11 2011
+++ /wikitospeech/scriptParser.pyc Fri Nov 11 23:49:48 2011
@@ -1,5 +1,6 @@
Ñò
-SžUNc @ s´ d d k l Z d d k Z d d k Z d d k Z d d k Z d d k l Z l Z d „ Z d „ Z
d „ Z
+ WtNc @ sØ d d k l Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l
Z
l
+ Z
d „ Z d „ Z d „ Z
d
„ Z e d j o e d ƒ n d S(
@@ -64,8 +65,11 @@
t } qx qx q× | d j o | } | | _ qx q× qÞ | d | i d
ƒ !| _ qâ | i
ƒ } | t j o× t | ƒ d j oÀ | i d ƒ pP | i d ƒ p@ |
i d ƒ p0 | i d ƒ p | i d ƒ p | i d ƒ oL t |
i ƒ d j o) | i i
+t statict .s .pngt rmt lns -s( R8 R t
readlinest syst platformR R R; R" t pathR* t getcwdt chdirt listdirt
| ƒ t i ƒ } | | _ n | | _ qÇ | i i
| ƒ qÞ qâ t | ƒ d j oÁ | i d ƒ p0 | i d ƒ p |
i d ƒ p | i d ƒ oL t | i ƒ d j o) | i i
+ 5
+ ( c C sù | d i ƒ i d ƒ p | d i d ƒ o
| ƒ t i ƒ } | | _ n | | _ qÞ | i d ƒ }
d |
j o | i i
@@ -83,7 +87,20 @@
| ƒ n g }
| i D] } |
| i i ƒ q
- ~
+ !i
+ ƒ | _ | |
+ d i
+ ƒ } t | ƒ d j o‹ x4 | i d ƒ o# | i d 7 _ | d i
+ ƒ } qþ W| i d ƒ o7 | i d
+ ƒ } | d | !| _ | | d i
+ ƒ } n | | _ n | i d j o
+ d | _ n | i i
+ | ƒ t i ƒ } q t | i ƒ d j o) | i i
+ | ƒ t i ƒ } | | _ q qx qx Wt | i ƒ d j o | i i
+ | ƒ n g }
+ | i D] } |
+ | i i ƒ qB ~
+ } x t | i ƒ D]p \ } } xa | i D]V } | i d j o@ |
i i ƒ | j o& | i | i ƒ | | _ d | _ qÝ q‡ q‡ Wqq Wt |
| ƒ | i S( Ni s .pngs [path=R
} x t | i ƒ D]p \ } } xa | i D]V } | i d j o@ |
i i ƒ | j o& | i | i ƒ | | _ d | _ q¹ qc qc WqM Wt |
| ƒ | i S( Ni s .pngs [path=R
t #t [t ;t =i t ]t
questionst ont offt pathR s .htmls .jpgs .JPGs .PNGiÿÿÿÿs [next]( t lowerR R t FalseR6 t objectst SequenceR t Questiont AnswerR; R) t
questionTextst appendt pathToImageFilesR t tagt
@@ -98,7 +115,7 @@



-
+



@@ -127,10 +144,10 @@
responseSideLinks
responseTexts

action( R6 R8 R9 R R R' R\ R RU RV RT RR R[ RW RY RZ RX R< ( R` R_ R@ t it qRA t jt a( ( s, D:\open-allure-ds\openallure\scriptParser.pyR^
s(
+ s(

" " " 0 t __main__s
20110819b.txt( R RN R" R

R$ t timeR R R R R R R R+ R^ t __name__( ( ( s, D:\open-allure-ds\openallure\scriptParser.pyt <module> s
-
- % {
+ % }

=======================================
--- /wikitospeech/voice.pyc Wed Aug 24 19:13:11 2011
+++ /wikitospeech/voice.pyc Fri Nov 11 23:49:48 2011
@@ -1,5 +1,5 @@
Ñò
-SžUNc @ s{ d Z d d k Z d d k Z d d k Z d d k l Z l Z d e f d „ ƒ YZ d „ Z
e
+\[[Nc @ s{ d Z d d k Z d d k Z d d k Z d d k l Z l Z d e f d „ ƒ YZ d „ Z
e
d j o e ƒ n d S( sŒ
voice.py
a component of openallure.py

==============================================================================
Revision: 468fbd5b30c5
Author: John Graves
Date: Fri Nov 25 16:43:11 2011
Log: Access titanpad as well as etherpad
http://code.google.com/p/open-allure-ds/source/detail?r=468fbd5b30c5

Modified:
/odp2wts/objects.py
/odp2wts/odp2app.py
/odp2wts/odp2wts.py
/odp2wts/scriptParser.py
/wikitospeech/Wiki-to-Speech.py
/wikitospeech/forms.py
/wikitospeech/scriptParser.py

=======================================
--- /odp2wts/objects.py Mon Sep 26 00:58:04 2011
+++ /odp2wts/objects.py Fri Nov 25 16:43:11 2011
@@ -14,7 +14,8 @@
self.answers = []
self.language = ""
self.linkToShow = ""
- self.pathToImageFiles= ""
+ self.pathToImageFiles = ""
+ self.sourceLink = "" # For citations

class Answer(object):
"""Object containing an answer with optional response"""
=======================================
--- /odp2wts/odp2app.py Sun Oct 2 02:19:15 2011
+++ /odp2wts/odp2app.py Fri Nov 25 16:43:11 2011
@@ -1,26 +1,52 @@
-"""
-This is a setup.py script generated by py2applet
-
-Usage:
- python setup.py py2app
-"""
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+# Name: odp2app.py
+# Purpose: Compile odp2wts.py into Mac OSX Application
+#
+# Author: John Graves
+#
+# Created: 26 November 2011
+# Copyright: (c) John Graves 2011
+# License: MIT License
+#-------------------------------------------------------------------------------

from setuptools import setup
+import operator
import os
+import shutil
import stat
-
-APP = ['odp2wts.py']
-DATA_FILES = ['CHANGES.txt','ethics_notice.txt',
-'README.txt','LICENSE.txt','soxi','MP4Box','ffmpeg','silence22kHz.ogg']
-OPTIONS = {'argv_emulation': True}
-
-setup(
- app=APP,
- data_files=DATA_FILES,
- options={'py2app': OPTIONS},
- setup_requires=['py2app'],
-)
-
-os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/soxi",stat.S_IRWXU)
-os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/ffmpeg",stat.S_IRWXU)
-os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/MP4Box",stat.S_IRWXU)
+import sys
+
+
+class BuildApp:
+ def __init__(self):
+ self.APP = ['odp2wts.py']
+ self.DATA_FILES = ['CHANGES.txt','ethics_notice.txt',
+ 'README.txt','LICENSE.txt','soxi','MP4Box','ffmpeg','silence22kHz.ogg']
+ self.OPTIONS = {'argv_emulation': True}
+ #Dist directory
+ self.dist_dir ='dist'
+
+ def run(self):
+ if os.path.isdir(self.dist_dir): #Erase previous destination dir
+ shutil.rmtree(self.dist_dir)
+
+ setup(
+ app=self.APP,
+ data_files=self.DATA_FILES,
+ options={'py2app': self.OPTIONS},
+ setup_requires=['py2app'],
+ )
+
+ if os.path.isdir('build'): #Clean up build dir
+ shutil.rmtree('build')
+
+if __name__ == '__main__':
+ if operator.lt(len(sys.argv), 2):
+ sys.argv.append('py2app')
+ BuildApp().run() #Run generation
+ raw_input("Press any key to continue") #Pause to let user see that
things ends
+
os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/soxi",stat.S_IRWXU)
+
os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/ffmpeg",stat.S_IRWXU)
+
os.chmod(os.getcwd()+os.sep+"dist/odp2wts.app/Contents/Resources/MP4Box",stat.S_IRWXU)
=======================================
--- /odp2wts/odp2wts.py Fri Nov 11 23:49:48 2011
+++ /odp2wts/odp2wts.py Fri Nov 25 16:43:11 2011
@@ -32,12 +32,14 @@
Fourth; No, just the third. > q/img1q2a2.mp3, > q/img1q2r2.mp3

[questions=off]
+
+20111112 If script has [Source=http:// ...] add this link to the question
page
"""
-__version__ = "0.1.24"
+__version__ = "0.1.26"

import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
-from configobj import ConfigObj
+from ConfigParser import ConfigParser
import codecs
import easygui
import math
@@ -88,15 +90,15 @@

# Check for last .odp file in config file
lastOdpFile = '~/*.odp'
+config = ConfigParser()
try:
- config = ConfigObj(iniDirectory+os.sep+'odp2wts.ini'),
- lastOdpFile = config['Files']['lastOdpFile']
+ config.read(iniDirectory+os.sep+'odp2wts.ini')
+ lastOdpFile = config.get("Files","lastOdpFile")
except:
- config = ConfigObj()
- config.filename = iniDirectory+os.sep+'odp2wts.ini'
- config['Files'] = {}
- config['Files']['lastOdpFile'] = lastOdpFile
- config.write()
+ config.add_section("Files")
+ config.set("Files","lastOdpFile","")
+ with open(iniDirectory+os.sep+'odp2wts.ini', 'wb') as configfile:
+ config.write(configfile)

if not os.path.isfile(lastOdpFile):
lastOdpFile = None
@@ -250,8 +252,9 @@

if ((0 != len(odpFile)) and (os.path.exists(odpFilePath))):
# Save file name to config file
- config['Files']['lastOdpFile'] = odpFilePath
- config.write()
+ config.set("Files","lastOdpFile",odpFilePath)
+ with open(iniDirectory+os.sep+'odp2wts.ini', 'wb') as configfile:
+ config.write(configfile)

odpName = odpFile.replace(".odp","")
odp = ZipFile(odpFilePath,'r')
@@ -356,28 +359,12 @@
f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.aiff "'+
odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.mp3"\n')
f.write("rm "+imageFilePrefix+onImgStr+'.aiff\n')
-
-# f.write("swift -n Marta -e utf-8 -m text
-o "+imageFilePrefix+onImgStr+'.wav "')
-# lines = item.split("\n")
-# for linenum, line in enumerate(lines):
-# line.replace('"',' ').replace('`',' ').replace(';',' ')
-# if not line.startswith("["):
-# f.write(line+" ")
-# elif linenum>0:
-# break
-# # f.write(item)
-# f.write('"\n')
-# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
-# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.ogg"\n')
-# f.write("~/bin/sox "+imageFilePrefix+onImgStr+'.wav "'+
-# odpFileSubdirectory+os.sep+imageFilePrefix+onImgStr+'.mp3"\n')
-# f.write("rm "+imageFilePrefix+onImgStr+'.wav\n')

def writeHtmlHeader(htmlFile):
htmlFile.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"' + "\n")
htmlFile.write('"http://www.w3.org/TR/html4/transitional.dtd">' + "\n")
htmlFile.write("<html>\n<head>\n")
- htmlFile.write('<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">' + "\n")
+ htmlFile.write('<meta HTTP-EQUIV=CONTENT-TYPE CONTENT="text/html;
charset=utf-8">' + "\n")
htmlFile.write('<title>Wiki-to-Speech</title>\n')

def writeHtmlHeader2(htmlFile):
@@ -431,38 +418,41 @@
audioFileTimes):
"""
<script language="javascript" type="text/javascript">
+ var t;
function respond0()
{
- document.getElementById('a0').innerHTML = 'Third'
- document.getElementById('a0').style.color = 'grey';
- location.href = "img3.htm"
+ clearTimeout(t)
+ document.getElementById("a0").innerHTML = "Separators of plus
and quotes";
+ document.getElementById("a0").style.color = "grey";
+ document.getElementById('playaudio').innerHTML='<audio
controls autoplay><source src="img8q1r0.mp3" /><source src="img8q1r0.ogg"
/>Your browser does not support the <code>audio</code>
element.</audio><!--[if lte IE 8]><embed src="img8q1r0.mp3"
autostart="true"><![endif]-->';
}
function respond1()
{
- document.getElementById('a1').innerHTML = 'Fourth'
- document.getElementById('a1').style.color = 'grey';
- document.getElementById('playaudio').innerHTML = '<audio
controls autoplay><source src="img2q2r1.mp3" /><source src="img2q2r1.ogg"
/>Your browser does not support the <code>audio</code> element.</audio>'
- var t=setTimeout("advance1()",2000);
- }
- function advance1() {
- location.href = "img3.htm"
+ clearTimeout(t)
+ document.getElementById('playaudio').innerHTML='<audio
controls autoplay><source src="img8q1r1.mp3" /><source src="img8q1r1.ogg"
/>Your browser does not support the <code>audio</code>
element.</audio><!--[if lte IE 8]><embed src="img8q1r1.mp3"
autostart="true"><![endif]-->';
+ t=setTimeout("advance1()",12762);
+ }
+ function advance1()
+ {
+ location.href="img8q2.htm";
}

</script>
"""
- htmlFile.write('<script language="javascript"
type="text/javascript">\n')
+ htmlFile.write('<script language="javascript"
type="text/javascript">\nvar t;\n')
for answerNum, answer in enumerate(question.answers):
if len(answer.answerText)>0:
htmlFile.write('function respond'+
str(answerNum)+
- '()\n{\n')
- htmlFile.write(' document.getElementById("a'+
- str(answerNum)+'").innerHTML = "'+
- answer.answerText+
- '";\n')
- htmlFile.write(' document.getElementById("a'+
- str(answerNum)+
- '").style.color = "grey";\n')
+ '()\n{\n clearTimeout(t);\n')
+ if not answer.action > 0:
+ htmlFile.write(' document.getElementById("a'+
+ str(answerNum)+'").innerHTML = "'+
+ answer.answerText+
+ '";\n')
+ htmlFile.write(' document.getElementById("a'+
+ str(answerNum)+
+ '").style.color = "grey";\n')

if len(answer.responseText)>0:
if position==0:
@@ -479,9 +469,12 @@
pathToAudio +
'.ogg" />')
htmlFile.write( \
- "Your browser does not support the <code>audio</code>
element.</audio>';\n")
+ "<embed src=" +
+ '"' + pathToAudio +
+ '.mp3' +
+ '" autostart="true"></audio>' + "';\n")
if answer.action > 0:
- htmlFile.write(' var t=setTimeout("advance'+
+ htmlFile.write(' t=setTimeout("advance'+
str(answerNum)+
'()",'+
str(audioFileTimes[pathToAudio]+1000)+
@@ -556,10 +549,7 @@
f.write("~/bin/sox ")
for item in oggList:
f.write(imageFilePrefix+item+".ogg ")
- if sys.platform.startswith("win"):
- f.write('"'+savePath+os.sep+'silence.ogg" ')
- else:
- f.write('"'+savePath+os.sep+'silence22kHz.ogg" ')
+ f.write('"'+savePath+os.sep+'silence.ogg" ')
f.write("all.ogg\n")
f.close()

@@ -677,6 +667,11 @@
'<img src="' +
questionFileNames[position] + '.' + imageFileSuffix +
'" style="border:0px"></a><br>\n')
+
+ # Add source link, if any
+ if 0<len(question.sourceLink):
+ htmlFile.write( \
+ '<a href="' + question.sourceLink + '">' +
question.sourceLink + '</a><br>\n')

else:
htmlFile.write("""<br><br><hr><br><center>
=======================================
--- /odp2wts/scriptParser.py Sun Oct 2 02:15:19 2011
+++ /odp2wts/scriptParser.py Fri Nov 25 16:43:11 2011
@@ -5,7 +5,7 @@
# Author: John Graves
#
# Created: 17 April 2011
-# Modified: 29 September 2011
+# Modified: 12 November 2011
# Copyright: (c) John 2011
# Licence: MIT license

#-------------------------------------------------------------------------------
@@ -182,6 +182,7 @@
if equalsAt>1: # set parameters
parameterName = line[1:equalsAt].strip().lower()
parameterValue =
line[equalsAt+1:line.find("]")].strip().lower()
+ parameterValueOrig =
line[equalsAt+1:line.find("]")].strip()
if parameterName == "questions":
if parameterValue == "on":
questionMode = True
@@ -194,6 +195,9 @@
pathToImageFiles = parameterValue
question.pathToImageFiles = pathToImageFiles
continue
+ elif parameterName == "source":
+ question.sourceLink = parameterValueOrig # Need to
preserve case for YouTube video IDs
+ continue
else: # question tag
question.tag = line[1:line.find("]")]

=======================================
--- /wikitospeech/Wiki-to-Speech.py Mon Sep 26 00:58:04 2011
+++ /wikitospeech/Wiki-to-Speech.py Fri Nov 25 16:43:11 2011
@@ -21,6 +21,7 @@
20110825 Add __version__ to title
20110909 Added question number to showQuestion (so going back should work)
20110913 Make symbolic links from static directory to location of
script.txt png images
+20111126 Titanpad in addition to iEtherpad. Jump to 0.1.26 to sync with
odp2wts (SlideSpeech)
"""
import cherrypy
import os.path
@@ -34,7 +35,7 @@
import sys
import voice

-__version__ = "0.1.21"
+__version__ = "0.1.26"

if not os.path.exists('static'):
os.makedirs('static')
=======================================
--- /wikitospeech/forms.py Thu Sep 8 18:40:53 2011
+++ /wikitospeech/forms.py Fri Nov 25 16:43:11 2011
@@ -7,7 +7,8 @@
Wiki-to-Speech Script:<br>
<input type="text" name="name" size="80" /><br>
<input type="submit" value="Open"/><br><br>
- <small>Version {0}</small><br>
+ <small>Version {0}<br>
+ Enter <i>exit</i> to stop localhost server</small><br>
<italic>{1}</italic>
</form></center><br><hr></body></html>'''.format(version,
errorMessage)

=======================================
--- /wikitospeech/scriptParser.py Mon Sep 26 00:58:04 2011
+++ /wikitospeech/scriptParser.py Fri Nov 25 16:43:11 2011
@@ -44,6 +44,8 @@
if name.startswith("http"):
if name.find("etherpad")>0:
sequence = parseEtherpad(name)
+ elif name.find("titanpad")>0:
+ sequence = parseEtherpad(name)
else:
sequence = parseHtml(name)
else:
@@ -139,7 +141,7 @@
# No parsing of .txt
return None
text = f.readlines()
-
+
if not sys.platform.startswith("win"):
# find slide images in .txt file and make symbolic links if
possible
pngs = [item.strip() for item in text if item.endswith(".png\n")]
@@ -154,7 +156,7 @@
subprocess.Popen(["rm",png])
subprocess.Popen(["ln","-s",scriptDir+os.sep+png,png])
os.chdir(savePath)
-
+
sequence = parseText(text)
return sequence

@@ -188,7 +190,7 @@
questionMode = False
continue
elif parameterName == "path":
- if(not parameterValue.endswith(os.sep)):
+ if((not parameterValue.endswith(os.sep) or (not
parameterValue.endswith("\\")))):
parameterValue += os.sep
pathToImageFiles = parameterValue
question.pathToImageFiles = pathToImageFiles

==============================================================================
Revision: 3bfd79c74dc6
Author: John Graves
Date: Fri Nov 25 16:53:15 2011
Log: Add static image files
http://code.google.com/p/open-allure-ds/source/detail?r=3bfd79c74dc6

Added:
/wikitospeech/static/img0.png
/wikitospeech/static/img1.png
/wikitospeech/static/img2.png
/wikitospeech/static/img3.png
/wikitospeech/static/wiziq/img0.png
/wikitospeech/static/wiziq/img1.png
/wikitospeech/static/wiziq/img2.png

=======================================
--- /dev/null
+++ /wikitospeech/static/img0.png Fri Nov 25 16:53:15 2011
@@ -0,0 +1,1 @@
+/Users/johngraves/20110913/test/test/img0.png
=======================================
--- /dev/null
+++ /wikitospeech/static/img1.png Fri Nov 25 16:53:15 2011
@@ -0,0 +1,1 @@
+/Users/johngraves/20110913/test/test/img1.png
=======================================
--- /dev/null
+++ /wikitospeech/static/img2.png Fri Nov 25 16:53:15 2011
@@ -0,0 +1,1 @@
+/Users/johngraves/20110913/test/test/img2.png
=======================================
--- /dev/null
+++ /wikitospeech/static/img3.png Fri Nov 25 16:53:15 2011
@@ -0,0 +1,1 @@
+/Users/johngraves/20110913/test/test/img3.png
=======================================
--- /dev/null
+++ /wikitospeech/static/wiziq/img0.png Fri Nov 25 16:53:15 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /wikitospeech/static/wiziq/img1.png Fri Nov 25 16:53:15 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /wikitospeech/static/wiziq/img2.png Fri Nov 25 16:53:15 2011
Binary file, no diff available.

==============================================================================
Revision: 5a9036d0bd68
Author: John Graves
Date: Fri Nov 25 17:09:02 2011
Log: Merge odp2wts.py from Mac
http://code.google.com/p/open-allure-ds/source/detail?r=5a9036d0bd68

Modified:
/odp2wts/odp2wts.py
/odp2wts/scriptParser.py

=======================================
--- /odp2wts/odp2wts.py Fri Nov 25 16:43:11 2011
+++ /odp2wts/odp2wts.py Fri Nov 25 17:09:02 2011
@@ -20,6 +20,15 @@
20110915 Added boilerplate script comments including version number
20110916 Read Unicode
20110917 Write out bits of Question/Answer/Response
+20111118 Show image along with question. Requires slide with comment first.
+ Example:
+ Comment on Slide4
+ [questions=on]
+ Question for slide 4:
+ Answer 1 ; Response 1
+ [questions=off]
+
+ NOTE: last slide must not have questions

img1.png > img1.htm > img1.mp3
[questions=on]
@@ -34,8 +43,9 @@
[questions=off]

20111112 If script has [Source=http:// ...] add this link to the question
page
+20111121 Turn off debug2.txt and put quotes around calls in makeVid.bat
"""
-__version__ = "0.1.26"
+__version__ = "0.1.27"

import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
@@ -674,8 +684,14 @@
'<a href="' + question.sourceLink + '">' +
question.sourceLink + '</a><br>\n')

else:
- htmlFile.write("""<br><br><hr><br><center>
-<table width="400" style="text-align:left"><tbody>
+ htmlFile.write("<br><br><hr><br><center>\n")
+ if len(question.linkToShow)>0:
+ # src but no link
+ htmlFile.write( \
+ '<img src="' +
+ question.linkToShow +
+ '" style="border:0px"><br>\n')
+ htmlFile.write("""<table width="400"
style="text-align:left"><tbody>
<tr><td>""")

htmlFile.write(" ".join(question.questionTexts)+ "</td></tr>\n" )

@@ -805,7 +821,7 @@
f.write("echo off\ncls\n")
f.write("if exist output.mp4 (del output.mp4)\n")
if os.path.isfile(savePath+os.sep+"MP4Box.exe"):
- catCommand = savePath+os.sep+"MP4Box"
+ catCommand = '"'+savePath+os.sep+'MP4Box"'
else:
catCommand = "MP4Box"
for i, file in enumerate(sortedOgg):
@@ -835,7 +851,7 @@
# Convert the images to a video of that slide with voice over
# NOTE: Little trick here -- Windows wants to substitute the batch
file name
# into %0 so we use %1 and pass %0 as the first parameter
- f.write(savePath+os.sep+"ffmpeg -i "+stem+'.mp3 -r 10
-i "'+stem+'_%15d.jpg" -ab 64k '+stem+".mp4\n")
+ f.write('"'+savePath+os.sep+'ffmpeg" -i '+stem+'.mp3 -r 10
-i "'+stem+'_%15d.jpg" -ab 64k '+stem+".mp4\n")
# Delete the symlinks
for j in range(tenthsOfSeconds):
f.write("del "+stem+'_'+str(j).zfill(5)+'.jpg\n')
=======================================
--- /odp2wts/scriptParser.py Fri Nov 25 16:43:11 2011
+++ /odp2wts/scriptParser.py Fri Nov 25 17:09:02 2011
@@ -286,7 +286,7 @@
answer.action =
tags.index(answer.responseSideLink.lower()) - qnum
answer.responseSideLink = ""

- dumpSequence(seq, questionMode)
+ #dumpSequence(seq, questionMode)

return seq.sequence

Reply all
Reply to author
Forward
0 new messages