[LON-CAPA-cvs] cvs: doc /help latexSplitter.py
bowersj2
lon-capa-cvs@mail.lon-capa.org
Tue, 10 Jun 2003 19:45:26 -0000
bowersj2 Tue Jun 10 15:45:26 2003 EDT
Modified files:
/doc/help latexSplitter.py
Log:
Botched previous commit; needed to be a bit higher.
Index: doc/help/latexSplitter.py
diff -u doc/help/latexSplitter.py:1.2 doc/help/latexSplitter.py:1.3
--- doc/help/latexSplitter.py:1.2 Tue Jun 10 14:57:30 2003
+++ doc/help/latexSplitter.py Tue Jun 10 15:45:26 2003
@@ -21,7 +21,7 @@
import sys
import string
-dirprefix = "/home/httpd/html/adm/help/"
+dirprefix = "/home/jerf/loncapa/loncom/html/adm/help/tex/"
class LatexSplitter:
def __init__(self, master):
@@ -52,12 +52,14 @@
def splitAndSave(self):
selection = self.text.get("sel.first", "sel.last")
topic = string.strip(self.topic.get("1.0", "end"))
- filename = dirprefix + string.replace(topic, " ", "_") + ".tex"
+ labelname = string.replace(topic, " ", "_")
+ filename = dirprefix + labelname + ".tex"
try:
f = file(filename, 'w')
except:
return
+ f.write("\\label{%s}\n\n" % labelname)
f.write(selection)
f.close()
@@ -65,8 +67,7 @@
self.text.delete("sel.first", "sel.last")
f = file("latexSplitterTempResults", 'w')
- f.write("\\label{%s}\n\n" % filename)
- f.write(self.text.get("1.0", END))
+ f.write(self.text.get("1.0", END))
f.close()
root = Tk()