mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
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.
This commit is contained in:
parent
f59c6fa125
commit
c0452da1b8
1 changed files with 11 additions and 1 deletions
|
|
@ -454,6 +454,16 @@ def domenu_save_as_applet(self, *args):
|
|||
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 @@ def domenu_save_as_applet(self, *args):
|
|||
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue