Eeschema: Dialog BOM: minor fix in help doc, and a minor enhancement (the plugin name with %P in name is correctly found to display its help and to edit it)

This commit is contained in:
jean-pierre charras 2015-06-29 18:34:31 +02:00
parent 15cc245a83
commit 272f1b35b6
3 changed files with 17 additions and 4 deletions

View File

@ -558,6 +558,14 @@ wxString DIALOG_BOM::getPluginFileName( const wxString& aCommand )
}
}
// Using a format like %P is possible in plugin name, so expand it
wxString prj_dir = Prj().GetProjectPath();
if( prj_dir.EndsWith( '/' ) || prj_dir.EndsWith( '\\' ) )
prj_dir.RemoveLast();
pluginName.Replace( wxT( "%P" ), prj_dir.GetData(), true );
return pluginName;
}

View File

@ -158,7 +158,7 @@ a Python script is used, the command line is something like
(depending on the Python script):</font></font></p>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><i>python</i>
<i>f:/kicad\bin/plugins/bom-in-python/myconverter.py</i>
<i>f:/kicad/bin/plugins/bom-in-python/myconverter.py</i>
&ldquo;<i>%I&rdquo;&ldquo;%O&rdquo;<br>or<br>python</i>
<i>/usr/local/kicad/bin/plugins/bom-in-python/myconverter .xsl &ldquo;%I&rdquo;
&ldquo;%O&rdquo; </i></font></font>
@ -173,8 +173,7 @@ supported formatting parameters are.</font></font></p>
<li/>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><b>%B</b>
=&gt; base filename and path of selected output file, minus path and
extension.</font></font></p>
=&gt; base filename of selected output file, minus path and extension.</font></font></p>
<li/>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><b>%P</b>
@ -280,4 +279,4 @@ python is installed on your PC, and python scripts are located in
</p>
</body>
</html>
</html>

View File

@ -50,6 +50,12 @@
wxString NETLIST_EXPORTER::MakeCommandLine( const wxString& aFormatString,
const wxString& aTempfile, const wxString& aFinalFile, const wxString& aProjectPath )
{
// Expand format symbols in the command line:
// %B => base filename of selected output file, minus path and extension.
// %P => project directory name, without trailing '/' or '\'.
// %I => full filename of the input file (the intermediate net file).
// %O => complete filename and path (but without extension) of the user chosen output file.
wxString ret = aFormatString;
wxFileName in = aTempfile;
wxFileName out = aFinalFile;