[open-allure-ds] push by jg07...@gmail.com - Symbolic links from static directory for png files on 2011-09-13 08:58 GMT

0 views
Skip to first unread message

open-al...@googlecode.com

unread,
Sep 13, 2011, 4:59:25 AM9/13/11
to open-al...@googlegroups.com
Revision: cd18d1a0712c
Author: John Graves
Date: Tue Sep 13 01:58:05 2011
Log: Symbolic links from static directory for png files
http://code.google.com/p/open-allure-ds/source/detail?r=cd18d1a0712c

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

=======================================
--- /odp2wts/odp2wts.py Mon Sep 12 22:31:41 2011
+++ /odp2wts/odp2wts.py Tue Sep 13 01:58:05 2011
@@ -17,6 +17,7 @@
20110909 Allow over 20 slides in MP4Box to cat for Mac
20110910 Coping with unavailable mklink in Windows and path names
containing spaces
20110913 Remove [] from script output and wrap ctypes import with win32
test
+20110913 Moved space to end of justText line
"""
__version__ = "0.1.19"

@@ -180,14 +181,14 @@
for item in textSpans2:
# deal with single quote and double quotes and dashes
# \u2018 LEFT SINGLE QUOTATION MARK
- justText = justText + " " + \
+ justText = justText + \
str(item.replace(u'\u2019',
u'\u0027').replace(u'\u201c',
u'\u0022').replace(u'\u201d',
u'\u0022').replace(u'\u2013',
u'\u002D').replace(u'ï',
u'i').replace(u'\u2018',
- u'\u0027'))
+ u'\u0027')) + " "
textItems.append(justText)
joinedItems = "\n".join(textItems)
return joinedItems
=======================================
--- /wikitospeech/Wiki-to-Speech.py Thu Sep 8 18:39:39 2011
+++ /wikitospeech/Wiki-to-Speech.py Tue Sep 13 01:58:05 2011
@@ -20,6 +20,7 @@
Ensure static directory exists
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
"""
import cherrypy
import os.path
@@ -33,7 +34,7 @@
import sys
import voice

-__version__ = "0.1.17"
+__version__ = "0.1.19"

if not os.path.exists('static'):
os.makedirs('static')
=======================================
--- /wikitospeech/scriptParser.py Tue Sep 6 20:19:51 2011
+++ /wikitospeech/scriptParser.py Tue Sep 13 01:58:05 2011
@@ -5,7 +5,7 @@
# Author: John Graves
#
# Created: 17 April 2011
-# Modified: 19 August 2011
+# Modified: 13 September 2011
# Copyright: (c) John 2011
# Licence: MIT license

#-------------------------------------------------------------------------------
@@ -14,6 +14,8 @@
import objects
import os
import re
+import subprocess
+import sys
import urllib
from time import gmtime, strftime

@@ -137,6 +139,20 @@
# 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")]
+ # script source directory
+ scriptDir, scriptFile = os.path.split(name)
+ savePath = os.getcwd()
+ os.chdir('static')
+ for png in pngs:
+ if os.path.isfile(png):
+ subprocess.Popen(["rm",png],shell=True)
+ subprocess.Popen(["ln","-s",scriptDir+os.sep+png,png])
+ os.chdir(savePath)
+
sequence = parseText(text)
return sequence

Reply all
Reply to author
Forward
0 new messages