[Idle-dev] IDLE's save-before-run requirement

Wesley Chun wesc@deirdre.org
Mon, 18 Jun 2001 17:10:43 -0700 (PDT)


the subject of this message is basically to get some feedback on
having to save a script within IDLE before running it.  when i'm
making a good number of small changes to my file, doing separate
sets of keystrokes started to get old, so i hacked together a
small patch that allows you to "save-n-run."

i thought i'd get Guido's opinion b4submitting a PEP.  he suggested
i also get some more comments from here.  below is basically what i
proposed and his response.

please direct any comments to me (and/or the group).  thanks!

-wesley

> >    b4 i waste people's time by filing a PEP on IDLE,
> >    have you had any comments regarding having to save
> >    a file before being able to run it?  i find myself
> >    having to do multiple sets of keystrokes every time
> >    i make a small edit, so i just hacked up a new key
> >    binding that does a save-n-run (Shift-F5).  i fi-
> >    gure, if it's not a good idea, at least it would be
> >    a good exercise in the Tkinter chapter!  :-)
> >
> >    any thoughts?  anyway, here's a quick 1-line diff:
> >
> > ScriptBinding.py:
> >
> > 16a17,19
> > > - Save and Run module (Shift-F5) does the same but saves *and*
> > > executes the module's code in the __main__ namespace.
> > >
> > 41a45
> > >         '<<save-and-run-script>>': ['<Shift-F5>'],
> > 48a53
> > >                   ('Save & Run script', '<<save-and-run-script>>'),
> > 150a156,166
> > >     def save_and_run_script_event(self, event):
> > >         if not self.editwin.get_saved():
> > >             name = (self.editwin.short_title() or
> > >                     self.editwin.long_title() or
> > >                     "Untitled")
> > >           if name == 'Untitled':
> > >               self.editwin.io.save_as(event)
> > >           else:
> > >               self.editwin.io.save(event)
> > >       self.run_script_event(event)
>
> Nice patch.
>
> The problem is that IDLE development has virtually come to a halt -- I
> just can't find the time to work on it, and there are other good
> development environments available.  I have some ideas for reworking
> the whole save/run machinery, but no code; and I have working code
> that runs the program in a subprocess, but there's a security issue
> that makes me hesitant to check it in...
>
> I wouldn't create a PEP for IDLE -- just discuss your ideas on
> idle-sig.  Maybe enough people are interested to get me coding
> again, or to get someone else to volunteer...
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)