← Back to team overview

kicad-developers team mailing list archive

Re: Trouble with BOM plugin execution on Windows

 

Ok. I see nobody cares about this issue, except me. As I understand,
applying that flag for all commands is to radical for other Windows users.
But for me very important ability to start pythonw scripts with gui. May
you apply the attached patch?

Regards, Konstantin.

2016-03-14 22:41 GMT+02:00 Wayne Stambaugh <stambaughw@xxxxxxxxx>:

> If memory serves, we removed the wxEXEC_SHOW_CONSOLE option from the
> wxExecute() function call because it always shows a console window on
> Windows.  Users were complaining about the console flashing while the
> command was executed.  This was a long time ago so I may be thinking of
> something else.  Your use case is probably not typical as you are
> launching a GUI app from a console created by wxExecute() where
> typically KiCad runs an external script to manipulate the netlist for
> post processing so showing the console is annoying.  I'm not sure
> changing this is desirable but I'm not opposed to it either.  Is it OK
> if I forward all of the complaints about the console being temporarily
> displayed to you?  Anyone else have any input on this?
>
> On 3/14/2016 2:34 PM, Константин Барановский wrote:
> > Can anyone comment this issue?
> >
> >
> > 2016-03-07 16:04 GMT+02:00 Константин Барановский
> > <baranovskiykonstantin@xxxxxxxxx <mailto:baranovskiykonstantin@xxxxxxxxx
> >>:
> >
> >     Fixed bom_all_exec.patch to according to the coding style.
> >
> >     2016-03-04 15:09 GMT+02:00 Константин Барановский
> >     <baranovskiykonstantin@xxxxxxxxx
> >     <mailto:baranovskiykonstantin@xxxxxxxxx>>:
> >
> >         Hi!
> >
> >         I just now noticed that BOM plugins from eeschema are executed
> >         in background on Windows OS. And if create plugin that executes
> >         an app with GUI, it does not be shown.
> >         In my case, I am launch the python app using pythonw and it runs
> >         (I can see it in task manager) but does not shows. I found
> >         solution for this problem in using flag wxEXEC_SHOW_CONSOLE.
> >         That flag applies only for Windows and ignored under the other
> >         platforms.
> >         pythonw used only for launching the apps with GUI and must be
> >         executed with that flag.
> >         But if someone will try to use another GUI app (based on python
> >         or standalone, does not matter) as BOM plugin, it still does not
> >         be shown.
> >         So, maybe need to use wxEXEC_SHOW_CONSOLE by default?
> >
> >         In attachment placed two patches:
> >         bom_pythonw_exec.patch - applied flag only for the pythonw;
> >         bom_all_exec.patch - applied flag for all commands.
> >
> >         Regards, Konstantin.
> >
> >
> >
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
=== modified file 'eeschema/netform.cpp'
--- eeschema/netform.cpp	2015-07-01 10:55:41 +0000
+++ eeschema/netform.cpp	2016-03-04 12:20:32 +0000
@@ -91,6 +91,7 @@
     if( executeCommandLine && res && !m_netListerCommand.IsEmpty() )
     {
         wxString prj_dir = Prj().GetProjectPath();
+        int flags = wxEXEC_SYNC;
 
         // build full command line from user's format string, e.g.:
         // "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I"
@@ -101,10 +102,15 @@
                 prj_dir.SubString( 0, prj_dir.Len() - 2 )       // strip trailing '/'
                 );
 
+        if( commandLine.StartsWith( wxT( "pythonw" ) ) || commandLine.StartsWith( wxT( "\"pythonw" ) ) )
+        {
+            flags |= wxEXEC_SHOW_CONSOLE;
+        }
+
         if( aReporter )
         {
             wxArrayString output, errors;
-            int diag = wxExecute( commandLine, output, errors, wxEXEC_SYNC );
+            int diag = wxExecute( commandLine, output, errors, flags );
 
             wxString msg;
 
@@ -142,7 +148,7 @@
             }
         }
         else
-            ProcessExecute( commandLine, wxEXEC_SYNC );
+            ProcessExecute( commandLine, flags );
     }
 
     return res;


Follow ups

References