--- doc/help/latexSplitter.py 2003/06/10 18:57:30 1.2 +++ doc/help/latexSplitter.py 2003/06/10 19:45:26 1.3 @@ -21,7 +21,7 @@ import anydbm 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 @@ class LatexSplitter: 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 @@ class LatexSplitter: 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()