]> granicus.if.org Git - python/commitdiff
Create applets slightly differently: by saving the sourcecode to a
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 12 Feb 2003 15:38:37 +0000 (15:38 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 12 Feb 2003 15:38:37 +0000 (15:38 +0000)
temporary location. This is needed to makethings work with the new
buildtools based on bundlebuilder.

Mac/Tools/IDE/PyEdit.py

index aa2f8086115dbbcd1dbb39aeca9dfcf79b9b84c9..7212622445b36992cb3468d7a0401b649298652d 100644 (file)
@@ -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()