diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-12 15:38:37 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-12 15:38:37 (GMT) |
commit | c0452da1b89ec8a71b778d3bd60ed748d4e6a5b1 (patch) | |
tree | 6793abe93260ef6e51bfdf48d581d9eb995595e3 /Mac | |
parent | f59c6fa1256c4ddfcef95df8dd3f808c902fecc2 (diff) | |
download | cpython-c0452da1b89ec8a71b778d3bd60ed748d4e6a5b1.zip cpython-c0452da1b89ec8a71b778d3bd60ed748d4e6a5b1.tar.gz cpython-c0452da1b89ec8a71b778d3bd60ed748d4e6a5b1.tar.bz2 |
Create applets slightly differently: by saving the sourcecode to a
temporary location. This is needed to makethings work with the new
buildtools based on bundlebuilder.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Tools/IDE/PyEdit.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index aa2f808..7212622 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -454,6 +454,16 @@ class Editor(W.Window): code = compile(pytext, filename, "exec") except (SyntaxError, EOFError): raise buildtools.BuildError, "Syntax error in script %s" % `filename` + + import tempfile + tmpdir = tempfile.mkdtemp() + + if filename[-3:] != ".py": + filename = filename + ".py" + filename = os.path.join(tmpdir, os.path.split(filename)[1]) + fp = open(filename, "w") + fp.write(pytext) + fp.close() # Try removing the output file try: @@ -461,7 +471,7 @@ class Editor(W.Window): except os.error: pass template = buildtools.findtemplate() - buildtools.process_common(template, None, code, rsrcname, destname, 0, 1) + buildtools.process(template, filename, destname, rsrcname=rsrcname, progress=None) def domenu_gotoline(self, *args): self.linefield.selectall() |