diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-27 22:55:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-27 22:55:27 +0000 |
commit | 1e68ac74cb516c2688e64cdc6a15480551b2f80d (patch) | |
tree | 1e78d3810e87dec71e5cb9ad08da71f1db7768f4 /Master/texmf-dist/asymptote/GUI | |
parent | 55e45a0d588de0392d2198753e45d75cd58f9e4d (diff) |
asymptote 2.25
git-svn-id: svn://tug.org/texlive/trunk@33704 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/GUI')
-rwxr-xr-x | Master/texmf-dist/asymptote/GUI/xasy2asy.py | 4 | ||||
-rwxr-xr-x | Master/texmf-dist/asymptote/GUI/xasyCodeEditor.py | 19 | ||||
-rwxr-xr-x | Master/texmf-dist/asymptote/GUI/xasyMainWin.py | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/asymptote/GUI/xasyOptions.py | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/asymptote/GUI/xasyVersion.py | 2 |
5 files changed, 20 insertions, 9 deletions
diff --git a/Master/texmf-dist/asymptote/GUI/xasy2asy.py b/Master/texmf-dist/asymptote/GUI/xasy2asy.py index 984bd1f5dd9..3a2c1bcbe7b 100755 --- a/Master/texmf-dist/asymptote/GUI/xasy2asy.py +++ b/Master/texmf-dist/asymptote/GUI/xasy2asy.py @@ -65,6 +65,10 @@ def startQuickAsy(): except: quickAsyFailed = True +def stopQuickAsy(): + if quickAsyRunning(): + fout.write("exit;\n"); + def getAsyTempDir(): return AsyTempDir diff --git a/Master/texmf-dist/asymptote/GUI/xasyCodeEditor.py b/Master/texmf-dist/asymptote/GUI/xasyCodeEditor.py index 1f7ad60328f..d09196a41be 100755 --- a/Master/texmf-dist/asymptote/GUI/xasyCodeEditor.py +++ b/Master/texmf-dist/asymptote/GUI/xasyCodeEditor.py @@ -21,21 +21,26 @@ import xasyOptions def getText(text=""): """Launch the external editor""" temp = mkstemp() - tempf = fdopen(temp[0],"r+w") + tempf = fdopen(temp[0],"w") tempf.write(text) - tempf.flush() + tempf.close() try: - cmdpath,cmd = path.split(xasyOptions.options['externalEditor']) + cmdpath,cmd = path.split(path.expandvars(xasyOptions.options['externalEditor'])) split_cmd = split(cmd) cmdpart = [path.join(cmdpath,split_cmd[0])] argpart = split_cmd[1:]+[temp[1]] arglist = cmdpart+argpart call(arglist) - except: + except Exception as e: raise Exception('Error launching external editor.') - tempf.seek(0) - text = tempf.read() - remove(temp[1]) + + try: + tempf = open(temp[1],"r") + text = tempf.read() + tempf.close() + remove(temp[1]) + except Exception as e: + raise Exception('Error reading from external editor.') return text if __name__ == '__main__': diff --git a/Master/texmf-dist/asymptote/GUI/xasyMainWin.py b/Master/texmf-dist/asymptote/GUI/xasyMainWin.py index e3a0044011a..657d24ba81b 100755 --- a/Master/texmf-dist/asymptote/GUI/xasyMainWin.py +++ b/Master/texmf-dist/asymptote/GUI/xasyMainWin.py @@ -566,6 +566,8 @@ class xasyMainWin: os.rmdir(getAsyTempDir()) except: pass + + stopQuickAsy() self.parent.destroy() def openFile(self,name): diff --git a/Master/texmf-dist/asymptote/GUI/xasyOptions.py b/Master/texmf-dist/asymptote/GUI/xasyOptions.py index 4406687cbf4..17d58d760e5 100755 --- a/Master/texmf-dist/asymptote/GUI/xasyOptions.py +++ b/Master/texmf-dist/asymptote/GUI/xasyOptions.py @@ -33,7 +33,7 @@ defaultOptions = { } if sys.platform[:3] == "win": - defaultOptions['externalEditor'] = "notepad.exe" + defaultOptions['externalEditor'] = "%PROGRAMFILES%\Windows NT\Accessories\wordpad.exe" else: defaultOptions['externalEditor'] = "emacs" diff --git a/Master/texmf-dist/asymptote/GUI/xasyVersion.py b/Master/texmf-dist/asymptote/GUI/xasyVersion.py index aefd00148e1..48b2683382f 100755 --- a/Master/texmf-dist/asymptote/GUI/xasyVersion.py +++ b/Master/texmf-dist/asymptote/GUI/xasyVersion.py @@ -1,2 +1,2 @@ #!/usr/bin/env python -xasyVersion = "2.25" +xasyVersion = "2.26" |