← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Expose netclassptr constructor to python interface

 

Miles,

I merged your patch into the master branch.  There were a few coding
policy[1] violations and commit message formatting[2] which I fixed.
Even though you modified a swig file, this was still C++ code which
should follow the coding policy.  There was trailing white space and
missing spaces between the function parenthesis and the arguments (line
61 of your patch).  Thank you for your contribution to KiCad.

Cheers,

Wayne

[1]
http://docs.kicad-pcb.org/doxygen/md_Documentation_development_coding-style-policy.html
[2] http://docs.kicad-pcb.org/doxygen/commit_messages.html

On 4/13/2017 6:30 AM, miles mccoo wrote:
> 
> 
> Hello,
> 
> This is my second contribution. It's a simple one line addition to
> netclass.i to expose the netclassptr constructor, enabling python
> scripts to add new netclasses.
> 
> In my first contribution, I made a couple errors in the contribution
> process which Wayne graciously fixed for me. I did look at those
> differences and I believe I'm adhering better now.
> 
> If I missed something this time, please be specific. I plan on
> contributing again and want to make things as easy as possible.
> 
> 
> 
> In case anyone would like to exercise the code, this will do it. The new
> api is in red:
> import pcbnew
> 
> board = pcbnew.GetBoard()
> ds = board.GetDesignSettings()
> # ugly. exposes a public member not via an accessor method
> nc = ds.m_NetClasses  
> foo = pcbnew.NETCLASSPTR("foo")
> nc.Add(foo)
> 
> 
> 
> Miles
> 
> PS this is only a one-liner and I feel a little goofy for it. I wanted
> to get it out there before it got lost in the pile other stuff I'm doing. 
> 
> 
> _______________________________________________
> 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
> 



References