I another post I suggested adding the ability to pass a fileName  to
c.saveAs, as opposed to only invoking a dialogue box.

Ed replied 'Feel free to contribute such a patch.  To be considered,
the patch
should include a unit test demonstrating that the new argument works.'

link:
http://groups.google.com/group/leo-editor/browse_thread/thread/3338990b986688c7/ce7a422d32ea2063?lnk=gst&q=saveAs+mdb#ce7a422d32ea2063

I also see this option has been requested by others,  example:
http://groups.google.com/group/leo-editor/browse_thread/thread/ca82887f59ca876c/05651f2bd10fa153?lnk=gst&q=saveAs+filename#05651f2bd10fa153

I am willing to give creating a patch a try but need some guidance.

I believe all that is needed is to allow arguments to c.saveAs(), that
currently has only takes c and event=  as arguments, as so

def SaveAs2 (c,event=None):

This part of the code, is surely relevant as well

fileName = ''.join(c.k.givenArgs) or g.app.gui.runSaveFileDialog(

If I create a function

def SaveAs2 (c, fileName=None, event=None):

and use

fileName = fileName  or g.app.gui.runSaveFileDialog(

I get what I desired

I.e.   SaveAs2 (c, fileName= 'newName.leo')   saves to the newName.leo
without a dialogue

However, I wonder if  c.k.givenArgs  is a prefered method.  But I
don't understand how c.k works.   Ed or anyone else have guidance
here ?

Also tell me as a neophyte Leo code contributor how to push to the
right branch.  I assume I modify LeoPyRef.leo, or do I edit the file
leoCommands.py that contain the saveAs code.
I am more clueless on the unit testing step.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to