Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-28 Thread Kaspar Emanuel
Thanks JP! This fixes the invocation error. It does behave differently to
the previous version in that it doesn't throw parse errors if a library has
invalid kicad_mod files in it. I have been using this function to make sure
footprints are valid so it wouldn't work for that any more.  Looking at
your patch the try/catch for IOError is probably not needed and removing it
would restore the old behaviour.

On 28 June 2017 at 08:03, jp charras  wrote:

> Le 27/06/2017 à 17:03, Kaspar Emanuel a écrit :
> > I am just looking at writing a fix at
> > https://github.com/KiCad/kicad-source-mirror/blob/
> 37f8c83c5bc5e8a61cc25d69de569dee7eea0e9f/pcbnew/swig/module.i#L69
> >
> > If you can see a quick fix you could probably save me a lot of time as I
> am planning on getting my
> > KiCad build set up again and submitting a patch.
> >
>
> Hi Kasper,
> Please, test this patch.
>
>
> --
> Jean-Pierre CHARRAS
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-28 Thread jp charras
Le 27/06/2017 à 17:03, Kaspar Emanuel a écrit :
> I am just looking at writing a fix at
> https://github.com/KiCad/kicad-source-mirror/blob/37f8c83c5bc5e8a61cc25d69de569dee7eea0e9f/pcbnew/swig/module.i#L69
> 
> If you can see a quick fix you could probably save me a lot of time as I am 
> planning on getting my
> KiCad build set up again and submitting a patch.
> 

Hi Kasper,
Please, test this patch.


-- 
Jean-Pierre CHARRAS
 pcbnew/swig/module.i | 73 +++-
 1 file changed, 50 insertions(+), 23 deletions(-)

diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
index b03c73c..600011e 100644
--- a/pcbnew/swig/module.i
+++ b/pcbnew/swig/module.i
@@ -60,39 +60,66 @@
 %}
 }
 
+%extend PLUGIN
+{
+// This version of FootprintEnumerate is for Python scripts, because the 
c++
+// VERSION of FootprintEnumerate is not easy to handle in these Python 
scripts
+
+wxArrayString footprintPyEnumerate( const wxString& aLibraryPath )
+{
+wxArrayString footprintNames;
+
+try
+{
+self->FootprintEnumerate( footprintNames, aLibraryPath );
+}
+catch( const IO_ERROR& error )
+{
+}
+
+return footprintNames;
+}
+
+%pythoncode
+%{
+def FootprintEnumerate(self, libname):
+return self.footprintPyEnumerate( libname )
+%}
+}
 
 %pythoncode
 %{
-def GetPluginForPath(lpath):
-return IO_MGR.PluginFind(IO_MGR.LEGACY)
+def GetPluginForPath(libname):
+plugin_type = IO_MGR.GuessPluginTypeFromLibPath( libname );
+return IO_MGR.PluginFind(plugin_type)
 
-def FootprintEnumerate(lpath):
-plug = GetPluginForPath(lpath)
-return plug.FootprintEnumerate(lpath)
+def FootprintEnumerate(libname):
+plug = GetPluginForPath(libname)
+return plug.FootprintEnumerate(libname)
 
-def FootprintLoad(lpath,name):
-plug = GetPluginForPath(lpath)
-return plug.FootprintLoad(lpath,name)
+def FootprintLoad(libname,name):
+plug = GetPluginForPath(libname)
+return plug.FootprintLoad(libname,name)
 
-def FootprintSave(lpath,module):
-plug = GetPluginForPath(lpath)
-return plug.FootprintSave(lpath,module)
+def FootprintSave(libname,module):
+plug = GetPluginForPath(libname)
+return plug.FootprintSave(libname,module)
 
-def FootprintDelete(lpath,name):
-plug = GetPluginForPath(lpath)
-plug.FootprintDelete(lpath,name)
+def FootprintDelete(libname,name):
+plug = GetPluginForPath(libname)
+plug.FootprintDelete(libname,name)
 
-def FootprintLibCreate(lpath):
-plug = GetPluginForPath(lpath)
-plug.FootprintLibCreate(lpath)
+def FootprintLibCreate(libname):
+plug = GetPluginForPath(libname)
+plug.FootprintLibCreate(libname)
 
-def FootprintLibDelete(lpath):
-plug = GetPluginForPath(lpath)
-plug.FootprintLibDelete(lpath)
+def FootprintLibDelete(libname):
+plug = GetPluginForPath(libname)
+plug.FootprintLibDelete(libname)
 
-def FootprintIsWritable(lpath):
-plug = GetPluginForPath(lpath)
-plug.FootprintLibIsWritable(lpath)
+def FootprintIsWritable(libname):
+plug = GetPluginForPath(libname)
+plug.FootprintLibIsWritable(libname)
 %}
 
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Wayne Stambaugh
Something doesn't seem right in module.i.  This line:

def GetPluginForPath(lpath):
return IO_MGR.PluginFind(IO_MGR.LEGACY)

in the %pyhton section would suggest that the only plugin available to
this code is the legacy plugin.  Why would you not want get any valid
plugin type?  This seems unnecessarily limited.

I don't think it will be a quick fix.  Solving the FootprintEnumerate()
issue will most likely require some C++ coding to directly call the
plugin FootprintEnumerate() method in the pcbnew library and convert the
wxArrayString contents into a python string list.

On 6/27/2017 11:03 AM, Kaspar Emanuel wrote:
> I am just looking at writing a fix at
> https://github.com/KiCad/kicad-source-mirror/blob/37f8c83c5bc5e8a61cc25d69de569dee7eea0e9f/pcbnew/swig/module.i#L69
> 
> If you can see a quick fix you could probably save me a lot of time as I
> am planning on getting my KiCad build set up again and submitting a patch.
> 
> On 27 June 2017 at 15:59, Maciej Sumiński  > wrote:
> 
> On 06/27/2017 04:49 PM, Kaspar Emanuel wrote:
> > On 27 June 2017 at 07:56, Maciej Sumiński  > wrote:
> >
> > PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
> >> of returning wxArrayString, it takes one as a reference and fills
> it out.
> >>
> > Thanks Orson, looks like Python bindings for that function are
> currently
> > broken then. I think I can use the binding for
> PLUGIN::FootprintLoad for my
> > purposes though it doesn’t throw any sensible exceptions when it can’t
> > parse a footprint.
> 
> I am afraid such breaks may happen more often. We still do not have well
> defined Python interface providing an abstraction layer to C++ code and
> it is hard to develop new features without modifying interfaces from
> time to time.
> 
> I have fixed the methods reported by Maurice and Simon because they were
> declared in SWIG files, so I consider them a part of the official Python
> interface (perhaps incorrectly).
> 
> Regards,
> Orson
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> 
> Post to : kicad-developers@lists.launchpad.net
> 
> Unsubscribe : https://launchpad.net/~kicad-developers
> 
> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Kaspar Emanuel
I am just looking at writing a fix at
https://github.com/KiCad/kicad-source-mirror/blob/37f8c83c5bc5e8a61cc25d69de569dee7eea0e9f/pcbnew/swig/module.i#L69

If you can see a quick fix you could probably save me a lot of time as I am
planning on getting my KiCad build set up again and submitting a patch.

On 27 June 2017 at 15:59, Maciej Sumiński  wrote:

> On 06/27/2017 04:49 PM, Kaspar Emanuel wrote:
> > On 27 June 2017 at 07:56, Maciej Sumiński 
> wrote:
> >
> > PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
> >> of returning wxArrayString, it takes one as a reference and fills it
> out.
> >>
> > Thanks Orson, looks like Python bindings for that function are currently
> > broken then. I think I can use the binding for PLUGIN::FootprintLoad for
> my
> > purposes though it doesn’t throw any sensible exceptions when it can’t
> > parse a footprint.
>
> I am afraid such breaks may happen more often. We still do not have well
> defined Python interface providing an abstraction layer to C++ code and
> it is hard to develop new features without modifying interfaces from
> time to time.
>
> I have fixed the methods reported by Maurice and Simon because they were
> declared in SWIG files, so I consider them a part of the official Python
> interface (perhaps incorrectly).
>
> Regards,
> Orson
>
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Maciej Sumiński
On 06/27/2017 04:49 PM, Kaspar Emanuel wrote:
> On 27 June 2017 at 07:56, Maciej Sumiński  wrote:
> 
> PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
>> of returning wxArrayString, it takes one as a reference and fills it out.
>>
> Thanks Orson, looks like Python bindings for that function are currently
> broken then. I think I can use the binding for PLUGIN::FootprintLoad for my
> purposes though it doesn’t throw any sensible exceptions when it can’t
> parse a footprint.

I am afraid such breaks may happen more often. We still do not have well
defined Python interface providing an abstraction layer to C++ code and
it is hard to develop new features without modifying interfaces from
time to time.

I have fixed the methods reported by Maurice and Simon because they were
declared in SWIG files, so I consider them a part of the official Python
interface (perhaps incorrectly).

Regards,
Orson



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Kaspar Emanuel
On 27 June 2017 at 07:56, Maciej Sumiński  wrote:

PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
> of returning wxArrayString, it takes one as a reference and fills it out.
>
Thanks Orson, looks like Python bindings for that function are currently
broken then. I think I can use the binding for PLUGIN::FootprintLoad for my
purposes though it doesn’t throw any sensible exceptions when it can’t
parse a footprint.
​
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Wayne Stambaugh
I changed this so that we could provide partial footprint library
loading for plugins that support one file per item.  This is an
unfortunate side effect of using exceptions.  In order to provide the
partial list of parsed footprint files, I had to pass a reference to the
array.  Nothing gets returned when an exception is thrown.

Don't be surprised when there are Python API changes in the development
branch.  It is going to happen from time to time.  The API shouldn't
change for a stable release series.

On 6/27/2017 2:56 AM, Maciej Sumiński wrote:
> Hi Kaspar,
> 
> This change is not related to the connectivity branch merge.
> 
> PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
> of returning wxArrayString, it takes one as a reference and fills it out.
> 
> Regards,
> Orson
> 
> 1.
> https://github.com/KiCad/kicad-source-mirror/commit/3cec63e9b92d2a1ca2d62c2c344a6274c06b5744#diff-0c21b12f202b8b1c75014639447406bbL200
> 
> On 06/26/2017 07:27 PM, Kaspar Emanuel wrote:
>> Since people seem to be able to give the updates from off the top of their
>> heads, what do I need to update this footprint loading script
>> ?
>> I am getting:
>>
>> Traceback (most recent call last):
>>   File "load_all.py", line 22, in 
>> list_of_footprints = src_plugin.FootprintEnumerate(libpath)
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 4386, in
>> FootprintEnumerate
>> return _pcbnew.PLUGIN_FootprintEnumerate(self, *args)
>> NotImplementedError: Wrong number or type of arguments for overloaded
>> function 'PLUGIN_FootprintEnumerate'.
>>   Possible C/C++ prototypes are:
>> PLUGIN::FootprintEnumerate(wxArrayString &,wxString const
>> &,PROPERTIES const *)
>>
>> PLUGIN::FootprintEnumerate(wxArrayString &,wxString const &)
>>
>> ​
>>
>> On 26 June 2017 at 17:30, Maciej Sumiński  wrote:
>>
>>> Great, thank you both for testing! I have just pushed the patch.
>>>
>>> Maurice, you are right about the comment. It was already there, but
>>> should have been removed.
>>>
>>> Regards,
>>> Orson
>>>
>>> On 06/26/2017 05:16 PM, easyw wrote:
 Hi,

 I solved with a trick
 try:
 board_drawings=board.GetDrawings()
 except:
 board_drawings=board.DrawingsList()

 for drw in board_drawings:

 for one plugin, and with a similar trick for the other;
 but your solution is cleaner.

 is the
 diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
 correct?

 I see there is a block comment before @line 45
 /*
 %extend MODULE
 ...

 Applying the patch I cannot make any plugins running
 but if I de-comment that block it works...


 Thx
 Maurice


 On 06/26/2017 2:24 PM, Maciej Sumiński wrote:
> Hi Maurice,
>
> This is due to the recent commit that enables iterators for DLISTs. We
> have forgotten that such change impacts the Python interface.
>
> I propose to keep the old interface, otherwise we will face many reports
> when a script works correctly with the stable release, but not with
> nightlies.
>
> Would you check if the attached patch fixes the problem? If so, I will
> push it.
>
> Regards,
> Orson
>
> On 06/26/2017 10:23 AM, easyw wrote:
>> Hi,
>> I can confirm the same error on windows 10.
>>
>> I get also an other kind of error in my annular plugin that worked
>> till now
>>
>> "for pad in module.Pads():
>> TypeError 'SwigPyObject' object is not iterable"
>>
>> BR
>> Maurice
>>
>> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>>> Hi,
>>> I just updated KiCad on Linux Mint using the Launchpad PPA to test the
>>> new connection algorithm. However, a SWIG error starts to pop up in my
>>> python plugins.
>>> Right now I can produce the error, when calling GetDrawings on the
>>> board
>>> object (which worked a few days ago). It looks like the SWIG wrappers
>>> are desynchronized from the C++-code. Is that (at all) possible?
>>>
>>> This is the Traceback I get:
>>>
>>> 
>>> Traceback (most recent call last):
>>>
>>>   File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>>> line 160, in Run
>>> boardItem = self.boardObj.GetDrawings().GetFirst()
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>>> GetDrawings
>>> def GetDrawings(self):return self.m_Drawings
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>>> 
>>> __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>>> _swig_getattr

Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-27 Thread Maciej Sumiński
Hi Kaspar,

This change is not related to the connectivity branch merge.

PLUGIN::FootprintEnumerate() signature has changed [1] and now instead
of returning wxArrayString, it takes one as a reference and fills it out.

Regards,
Orson

1.
https://github.com/KiCad/kicad-source-mirror/commit/3cec63e9b92d2a1ca2d62c2c344a6274c06b5744#diff-0c21b12f202b8b1c75014639447406bbL200

On 06/26/2017 07:27 PM, Kaspar Emanuel wrote:
> Since people seem to be able to give the updates from off the top of their
> heads, what do I need to update this footprint loading script
> ?
> I am getting:
> 
> Traceback (most recent call last):
>   File "load_all.py", line 22, in 
> list_of_footprints = src_plugin.FootprintEnumerate(libpath)
>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 4386, in
> FootprintEnumerate
> return _pcbnew.PLUGIN_FootprintEnumerate(self, *args)
> NotImplementedError: Wrong number or type of arguments for overloaded
> function 'PLUGIN_FootprintEnumerate'.
>   Possible C/C++ prototypes are:
> PLUGIN::FootprintEnumerate(wxArrayString &,wxString const
> &,PROPERTIES const *)
> 
> PLUGIN::FootprintEnumerate(wxArrayString &,wxString const &)
> 
> ​
> 
> On 26 June 2017 at 17:30, Maciej Sumiński  wrote:
> 
>> Great, thank you both for testing! I have just pushed the patch.
>>
>> Maurice, you are right about the comment. It was already there, but
>> should have been removed.
>>
>> Regards,
>> Orson
>>
>> On 06/26/2017 05:16 PM, easyw wrote:
>>> Hi,
>>>
>>> I solved with a trick
>>> try:
>>> board_drawings=board.GetDrawings()
>>> except:
>>> board_drawings=board.DrawingsList()
>>>
>>> for drw in board_drawings:
>>>
>>> for one plugin, and with a similar trick for the other;
>>> but your solution is cleaner.
>>>
>>> is the
>>> diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
>>> correct?
>>>
>>> I see there is a block comment before @line 45
>>> /*
>>> %extend MODULE
>>> ...
>>>
>>> Applying the patch I cannot make any plugins running
>>> but if I de-comment that block it works...
>>>
>>>
>>> Thx
>>> Maurice
>>>
>>>
>>> On 06/26/2017 2:24 PM, Maciej Sumiński wrote:
 Hi Maurice,

 This is due to the recent commit that enables iterators for DLISTs. We
 have forgotten that such change impacts the Python interface.

 I propose to keep the old interface, otherwise we will face many reports
 when a script works correctly with the stable release, but not with
 nightlies.

 Would you check if the attached patch fixes the problem? If so, I will
 push it.

 Regards,
 Orson

 On 06/26/2017 10:23 AM, easyw wrote:
> Hi,
> I can confirm the same error on windows 10.
>
> I get also an other kind of error in my annular plugin that worked
> till now
>
> "for pad in module.Pads():
> TypeError 'SwigPyObject' object is not iterable"
>
> BR
> Maurice
>
> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>> Hi,
>> I just updated KiCad on Linux Mint using the Launchpad PPA to test the
>> new connection algorithm. However, a SWIG error starts to pop up in my
>> python plugins.
>> Right now I can produce the error, when calling GetDrawings on the
>> board
>> object (which worked a few days ago). It looks like the SWIG wrappers
>> are desynchronized from the C++-code. Is that (at all) possible?
>>
>> This is the Traceback I get:
>>
>> 
>> Traceback (most recent call last):
>>
>>   File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>> line 160, in Run
>> boardItem = self.boardObj.GetDrawings().GetFirst()
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>> GetDrawings
>> def GetDrawings(self):return self.m_Drawings
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>> 
>> __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>> _swig_getattr
>> return _swig_getattr_nondynamic(self, class_type, name, 0)
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>> _swig_getattr_nondynamic
>> return object.__getattr__(self, name)
>>
>> AttributeError: type object 'object' has no attribute '__getattr__'
>>
>> Best Regards
>> Simon
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>
> 

Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Kaspar Emanuel
Since people seem to be able to give the updates from off the top of their
heads, what do I need to update this footprint loading script
?
I am getting:

Traceback (most recent call last):
  File "load_all.py", line 22, in 
list_of_footprints = src_plugin.FootprintEnumerate(libpath)
  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 4386, in
FootprintEnumerate
return _pcbnew.PLUGIN_FootprintEnumerate(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded
function 'PLUGIN_FootprintEnumerate'.
  Possible C/C++ prototypes are:
PLUGIN::FootprintEnumerate(wxArrayString &,wxString const
&,PROPERTIES const *)

PLUGIN::FootprintEnumerate(wxArrayString &,wxString const &)

​

On 26 June 2017 at 17:30, Maciej Sumiński  wrote:

> Great, thank you both for testing! I have just pushed the patch.
>
> Maurice, you are right about the comment. It was already there, but
> should have been removed.
>
> Regards,
> Orson
>
> On 06/26/2017 05:16 PM, easyw wrote:
> > Hi,
> >
> > I solved with a trick
> > try:
> > board_drawings=board.GetDrawings()
> > except:
> > board_drawings=board.DrawingsList()
> >
> > for drw in board_drawings:
> >
> > for one plugin, and with a similar trick for the other;
> > but your solution is cleaner.
> >
> > is the
> > diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
> > correct?
> >
> > I see there is a block comment before @line 45
> > /*
> > %extend MODULE
> > ...
> >
> > Applying the patch I cannot make any plugins running
> > but if I de-comment that block it works...
> >
> >
> > Thx
> > Maurice
> >
> >
> > On 06/26/2017 2:24 PM, Maciej Sumiński wrote:
> >> Hi Maurice,
> >>
> >> This is due to the recent commit that enables iterators for DLISTs. We
> >> have forgotten that such change impacts the Python interface.
> >>
> >> I propose to keep the old interface, otherwise we will face many reports
> >> when a script works correctly with the stable release, but not with
> >> nightlies.
> >>
> >> Would you check if the attached patch fixes the problem? If so, I will
> >> push it.
> >>
> >> Regards,
> >> Orson
> >>
> >> On 06/26/2017 10:23 AM, easyw wrote:
> >>> Hi,
> >>> I can confirm the same error on windows 10.
> >>>
> >>> I get also an other kind of error in my annular plugin that worked
> >>> till now
> >>>
> >>> "for pad in module.Pads():
> >>> TypeError 'SwigPyObject' object is not iterable"
> >>>
> >>> BR
> >>> Maurice
> >>>
> >>> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>  Hi,
>  I just updated KiCad on Linux Mint using the Launchpad PPA to test the
>  new connection algorithm. However, a SWIG error starts to pop up in my
>  python plugins.
>  Right now I can produce the error, when calling GetDrawings on the
>  board
>  object (which worked a few days ago). It looks like the SWIG wrappers
>  are desynchronized from the C++-code. Is that (at all) possible?
> 
>  This is the Traceback I get:
> 
>  
>  Traceback (most recent call last):
> 
>    File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>  line 160, in Run
>  boardItem = self.boardObj.GetDrawings().GetFirst()
> 
>    File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>  GetDrawings
>  def GetDrawings(self):return self.m_Drawings
> 
>    File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>  
>  __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
> 
>    File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>  _swig_getattr
>  return _swig_getattr_nondynamic(self, class_type, name, 0)
> 
>    File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>  _swig_getattr_nondynamic
>  return object.__getattr__(self, name)
> 
>  AttributeError: type object 'object' has no attribute '__getattr__'
> 
>  Best Regards
>  Simon
> 
>  ___
>  Mailing list: https://launchpad.net/~kicad-developers
>  Post to : kicad-developers@lists.launchpad.net
>  Unsubscribe : https://launchpad.net/~kicad-developers
>  More help   : https://help.launchpad.net/ListHelp
> 
> >>>
> >>> ___
> >>> Mailing list: https://launchpad.net/~kicad-developers
> >>> Post to : kicad-developers@lists.launchpad.net
> >>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>> More help   : https://help.launchpad.net/ListHelp
> >>
> >>
> >>
> >> ___
> >> Mailing list: https://launchpad.net/~kicad-developers
> >> Post to : kicad-developers@lists.launchpad.net
> >> Unsubscribe : 

Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Maciej Sumiński
Great, thank you both for testing! I have just pushed the patch.

Maurice, you are right about the comment. It was already there, but
should have been removed.

Regards,
Orson

On 06/26/2017 05:16 PM, easyw wrote:
> Hi,
> 
> I solved with a trick
> try:
> board_drawings=board.GetDrawings()
> except:
> board_drawings=board.DrawingsList()
> 
> for drw in board_drawings:
> 
> for one plugin, and with a similar trick for the other;
> but your solution is cleaner.
> 
> is the
> diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
> correct?
> 
> I see there is a block comment before @line 45
> /*
> %extend MODULE
> ...
> 
> Applying the patch I cannot make any plugins running
> but if I de-comment that block it works...
> 
> 
> Thx
> Maurice
> 
> 
> On 06/26/2017 2:24 PM, Maciej Sumiński wrote:
>> Hi Maurice,
>>
>> This is due to the recent commit that enables iterators for DLISTs. We
>> have forgotten that such change impacts the Python interface.
>>
>> I propose to keep the old interface, otherwise we will face many reports
>> when a script works correctly with the stable release, but not with
>> nightlies.
>>
>> Would you check if the attached patch fixes the problem? If so, I will
>> push it.
>>
>> Regards,
>> Orson
>>
>> On 06/26/2017 10:23 AM, easyw wrote:
>>> Hi,
>>> I can confirm the same error on windows 10.
>>>
>>> I get also an other kind of error in my annular plugin that worked
>>> till now
>>>
>>> "for pad in module.Pads():
>>> TypeError 'SwigPyObject' object is not iterable"
>>>
>>> BR
>>> Maurice
>>>
>>> On 06/25/2017 5:46 PM, Simon Küppers wrote:
 Hi,
 I just updated KiCad on Linux Mint using the Launchpad PPA to test the
 new connection algorithm. However, a SWIG error starts to pop up in my
 python plugins.
 Right now I can produce the error, when calling GetDrawings on the
 board
 object (which worked a few days ago). It looks like the SWIG wrappers
 are desynchronized from the C++-code. Is that (at all) possible?

 This is the Traceback I get:

 
 Traceback (most recent call last):

   File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
 line 160, in Run
 boardItem = self.boardObj.GetDrawings().GetFirst()

   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
 GetDrawings
 def GetDrawings(self):return self.m_Drawings

   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
 
 __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)

   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
 _swig_getattr
 return _swig_getattr_nondynamic(self, class_type, name, 0)

   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
 _swig_getattr_nondynamic
 return object.__getattr__(self, name)

 AttributeError: type object 'object' has no attribute '__getattr__'

 Best Regards
 Simon

 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp

>>>
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Simon Küppers
Hi Orson,
The Patch works for me. Nice Thanks!

Best Regards
Simon

Am 26.06.2017 um 14:24 schrieb Maciej Sumiński:
> Hi Maurice,
> 
> This is due to the recent commit that enables iterators for DLISTs. We
> have forgotten that such change impacts the Python interface.
> 
> I propose to keep the old interface, otherwise we will face many reports
> when a script works correctly with the stable release, but not with
> nightlies.
> 
> Would you check if the attached patch fixes the problem? If so, I will
> push it.
> 
> Regards,
> Orson
> 
> On 06/26/2017 10:23 AM, easyw wrote:
>> Hi,
>> I can confirm the same error on windows 10.
>>
>> I get also an other kind of error in my annular plugin that worked till now
>>
>> "for pad in module.Pads():
>> TypeError 'SwigPyObject' object is not iterable"
>>
>> BR
>> Maurice
>>
>> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>>> Hi,
>>> I just updated KiCad on Linux Mint using the Launchpad PPA to test the
>>> new connection algorithm. However, a SWIG error starts to pop up in my
>>> python plugins.
>>> Right now I can produce the error, when calling GetDrawings on the board
>>> object (which worked a few days ago). It looks like the SWIG wrappers
>>> are desynchronized from the C++-code. Is that (at all) possible?
>>>
>>> This is the Traceback I get:
>>>
>>> 
>>> Traceback (most recent call last):
>>>
>>>   File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>>> line 160, in Run
>>> boardItem = self.boardObj.GetDrawings().GetFirst()
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>>> GetDrawings
>>> def GetDrawings(self):return self.m_Drawings
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>>> 
>>> __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>>> _swig_getattr
>>> return _swig_getattr_nondynamic(self, class_type, name, 0)
>>>
>>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>>> _swig_getattr_nondynamic
>>> return object.__getattr__(self, name)
>>>
>>> AttributeError: type object 'object' has no attribute '__getattr__'
>>>
>>> Best Regards
>>> Simon
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread easyw

Hi,

I solved with a trick
try:
board_drawings=board.GetDrawings()
except:
board_drawings=board.DrawingsList()

for drw in board_drawings:

for one plugin, and with a similar trick for the other;
but your solution is cleaner.

is the
diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
correct?

I see there is a block comment before @line 45
/*
%extend MODULE
...

Applying the patch I cannot make any plugins running
but if I de-comment that block it works...


Thx
Maurice


On 06/26/2017 2:24 PM, Maciej Sumiński wrote:

Hi Maurice,

This is due to the recent commit that enables iterators for DLISTs. We
have forgotten that such change impacts the Python interface.

I propose to keep the old interface, otherwise we will face many reports
when a script works correctly with the stable release, but not with
nightlies.

Would you check if the attached patch fixes the problem? If so, I will
push it.

Regards,
Orson

On 06/26/2017 10:23 AM, easyw wrote:

Hi,
I can confirm the same error on windows 10.

I get also an other kind of error in my annular plugin that worked till now

"for pad in module.Pads():
TypeError 'SwigPyObject' object is not iterable"

BR
Maurice

On 06/25/2017 5:46 PM, Simon Küppers wrote:

Hi,
I just updated KiCad on Linux Mint using the Launchpad PPA to test the
new connection algorithm. However, a SWIG error starts to pop up in my
python plugins.
Right now I can produce the error, when calling GetDrawings on the board
object (which worked a few days ago). It looks like the SWIG wrappers
are desynchronized from the C++-code. Is that (at all) possible?

This is the Traceback I get:


Traceback (most recent call last):

  File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
line 160, in Run
boardItem = self.boardObj.GetDrawings().GetFirst()

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
GetDrawings
def GetDrawings(self):return self.m_Drawings

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in

__getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
_swig_getattr
return _swig_getattr_nondynamic(self, class_type, name, 0)

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
_swig_getattr_nondynamic
return object.__getattr__(self, name)

AttributeError: type object 'object' has no attribute '__getattr__'

Best Regards
Simon

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp




___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Maciej Sumiński
Hi Maurice,

This is due to the recent commit that enables iterators for DLISTs. We
have forgotten that such change impacts the Python interface.

I propose to keep the old interface, otherwise we will face many reports
when a script works correctly with the stable release, but not with
nightlies.

Would you check if the attached patch fixes the problem? If so, I will
push it.

Regards,
Orson

On 06/26/2017 10:23 AM, easyw wrote:
> Hi,
> I can confirm the same error on windows 10.
> 
> I get also an other kind of error in my annular plugin that worked till now
> 
> "for pad in module.Pads():
> TypeError 'SwigPyObject' object is not iterable"
> 
> BR
> Maurice
> 
> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>> Hi,
>> I just updated KiCad on Linux Mint using the Launchpad PPA to test the
>> new connection algorithm. However, a SWIG error starts to pop up in my
>> python plugins.
>> Right now I can produce the error, when calling GetDrawings on the board
>> object (which worked a few days ago). It looks like the SWIG wrappers
>> are desynchronized from the C++-code. Is that (at all) possible?
>>
>> This is the Traceback I get:
>>
>> 
>> Traceback (most recent call last):
>>
>>   File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>> line 160, in Run
>> boardItem = self.boardObj.GetDrawings().GetFirst()
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>> GetDrawings
>> def GetDrawings(self):return self.m_Drawings
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>> 
>> __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>> _swig_getattr
>> return _swig_getattr_nondynamic(self, class_type, name, 0)
>>
>>   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>> _swig_getattr_nondynamic
>> return object.__getattr__(self, name)
>>
>> AttributeError: type object 'object' has no attribute '__getattr__'
>>
>> Best Regards
>> Simon
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

From 6dce744039e6991438e615d3cd5f84d9cb07b437 Mon Sep 17 00:00:00 2001
From: Maciej Suminski 
Date: Mon, 26 Jun 2017 14:22:32 +0200
Subject: [PATCH] Fix the BOARD & MODULE classes SWIG interface

---
 pcbnew/swig/board.i  | 3 +--
 pcbnew/swig/module.i | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pcbnew/swig/board.i b/pcbnew/swig/board.i
index 62cbaed73..05d04d516 100644
--- a/pcbnew/swig/board.i
+++ b/pcbnew/swig/board.i
@@ -115,9 +115,8 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
 %{
 
 def GetModules(self): return self.m_Modules
-def GetDrawings(self):return self.m_Drawings
+def GetDrawings(self):return self.DrawingsList()
 def GetTracks(self):  return self.m_Track
-def GetFullRatsnest(self):return self.m_FullRatsnest
 
 def Save(self,filename):
 return SaveBoard(filename,self,IO_MGR.KICAD)
diff --git a/pcbnew/swig/module.i b/pcbnew/swig/module.i
index b27376654..14274dde0 100644
--- a/pcbnew/swig/module.i
+++ b/pcbnew/swig/module.i
@@ -48,6 +48,9 @@
 %pythoncode
 %{
 
+def Pads(self):return self.PadsList()
+def GraphicalItems(self):  return self.GraphicalItemsList()
+
 #def SaveToLibrary(self,filename):
 #  return SaveModuleToLibrary(filename,self)
 
-- 
2.12.0



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Simon Küppers
Due to me not being able to imagine that problems regarding drawings
could be related to the connectivity algorithm, I started digging around
a bit.
I searched around the sourcecode for a while and it looks a bit
confusing regarding some of the Getter functions for returning objects
from the board object.
The now non-functional method GetDrawings() is actually implemented in
pcbnew/swig/board.i and is thus just available from Python.

I guess the reason it broke yesterday is that Tomasz pushed something
along his connectivity algorithm that is not (or is it?) related to the
connectivity algorithm. Have a look at this commit from 26. Sep 2016
that got pushed along with the stuff yesterday.
https://github.com/KiCad/kicad-source-mirror/commit/08314082dbdfdd634b6cdcaeb000b0e4c23adf26#diff-ce7955f5bf51c6f27b918fe0a0fc2b39

It looks like m_Drawings is now private (before it was public), hence
the reason for the python-only GetDrawings() failing (I presume).
With this change Tomasz also added DrawingsList() instead, with a hint
that it will again be deprecated and we should use Drawings() instead.
However as jsreynaud pointed out, a Python compatible
DLIST_ITERATOR_WRAPPER does not yet exist (or I cannot figure it out).

I am unsure whether the changes that Tomasz did were intentional
(because they are from last year and I cannot see the relation to the
connectivity algorithm) and whether we should completely switch over to
DrawingsList() and remove GetDrawings() from pcbnew/swig/board.i with
respect to python.

Maybe Tomasz can elaborate, because he seem to know some stuff about the
mentioned and planned board item storage refactoring.

Thanks everyone and Best Regards
Simon

Am 26.06.2017 um 12:27 schrieb reynaud:
> The new connectivity algorithm was pushed this last days. Big
> improvements, speed... But some changes in internal API...
> For the moment python API is (mostly) directly mapped to internal API...
> 
> 
> Le lundi 26 juin 2017 à 12:11 +0200, Simon Küppers a écrit :
>> Hey,
>> It works for me thanks. But what is the background here? Has someone
>> just changed the name of something in the Python API (are we supposed to
>> use DrawingsList() from now on) or is this just something like a workaround?
>>
>> Thanks
>> Simon
>>
>> Am 26.06.2017 um 12:03 schrieb reynaud:
>>> Hi, DrawingsList() is a good candidate ;) Le lundi 26 juin 2017 à
>>> 11:34 +0200, easyw a écrit :
 Hi Js, thx with PadsList() the script is fine now... Do you have any
 suggestion also for "for drw in board.GetDrawings(): GetDrawings def
 GetDrawings(self): return self.m_Drawings File ... AttributeError:
 type object 'object' has no attribute '__getattr__'" reference this
 action script
 https://github.com/easyw/kicad-action-plugins/blob/master/action_menu_move_to_layer.py
 thx Maurice On 06/26/2017 11:21 AM, reynaud wrote:
> Hi, Python interface is not stable. You can have some changes on
> daily build version. In your case, using PadsList() instead of
> Pads() should fix your issue. Le lundi 26 juin 2017 à 10:23 +0200,
> easyw a écrit :
>> Hi, I can confirm the same error on windows 10. I get also an
>> other kind of error in my annular plugin that worked till now "for
>> pad in module.Pads(): TypeError 'SwigPyObject' object is not
>> iterable" BR Maurice On 06/25/2017 5:46 PM, Simon Küppers wrote:
>>> Hi, I just updated KiCad on Linux Mint using the Launchpad PPA to
>>> test the new connection algorithm. However, a SWIG error starts
>>> to pop up in my python plugins. Right now I can produce the
>>> error, when calling GetDrawings on the board object (which worked
>>> a few days ago). It looks like the SWIG wrappers are
>>> desynchronized from the C++-code. Is that (at all) possible? This
>>> is the Traceback I get:  Traceback (most recent call last):
>>> File
>>> "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
>>> line 160, in Run boardItem =
>>> self.boardObj.GetDrawings().GetFirst() File
>>> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>>> GetDrawings def GetDrawings(self): return self.m_Drawings File
>>> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>>>  __getattr__ = lambda self, name: _swig_getattr(self,
>>> BOARD, name) File "/usr/lib/python2.7/dist-packages/pcbnew.py",
>>> line 74, in _swig_getattr return _swig_getattr_nondynamic(self,
>>> class_type, name, 0) File
>>> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>>> _swig_getattr_nondynamic return object.__getattr__(self, name)
>>> AttributeError: type object 'object' has no attribute
>>> '__getattr__' Best Regards Simon
>>> ___ Mailing list:
>>> https://launchpad.net/~kicad-developers Post to :
>>> kicad-developers@lists.launchpad.net
>>> 
>>> 

Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread reynaud
The new connectivity algorithm was pushed this last days. Big
improvements, speed... But some changes in internal API...
For the moment python API is (mostly) directly mapped to internal
API...
Le lundi 26 juin 2017 à 12:11 +0200, Simon Küppers a écrit :
> Hey,
> It works for me thanks. But what is the background here? Has someone
> just changed the name of something in the Python API (are we supposed
> to
> use DrawingsList() from now on) or is this just something like a
> workaround?
> 
> Thanks
> Simon
> 
> Am 26.06.2017 um 12:03 schrieb reynaud:
> > 
> > Hi,
> > 
> > DrawingsList() is a good candidate ;)
> > 
> > 
> > Le lundi 26 juin 2017 à 11:34 +0200, easyw a écrit :
> > > 
> > > Hi Js,
> > > thx with PadsList() the script is fine now...
> > > 
> > > Do you have any suggestion also for
> > > 
> > > "for drw in board.GetDrawings():
> > > GetDrawings def GetDrawings(self): return self.m_Drawings File
> > > ...
> > > AttributeError: type object 'object' has no attribute
> > > '__getattr__'"
> > > 
> > > reference this action script
> > > https://github.com/easyw/kicad-action-plugins/blob/master/action_
> > > menu_move_to_layer.py
> > > 
> > > 
> > > thx
> > > Maurice
> > > 
> > > On 06/26/2017 11:21 AM, reynaud wrote:
> > > > 
> > > > Hi, Python interface is not stable. You can have some changes
> > > > on
> > > > daily build version. In your case, using PadsList() instead of
> > > > Pads()
> > > > should fix your issue. Le lundi 26 juin 2017 à 10:23 +0200,
> > > > easyw a
> > > > écrit :
> > > > > 
> > > > > Hi, I can confirm the same error on windows 10. I get also an
> > > > > other
> > > > > kind of error in my annular plugin that worked till now "for
> > > > > pad in
> > > > > module.Pads(): TypeError 'SwigPyObject' object is not
> > > > > iterable" BR
> > > > > Maurice On 06/25/2017 5:46 PM, Simon Küppers wrote:
> > > > > > 
> > > > > > Hi, I just updated KiCad on Linux Mint using the Launchpad
> > > > > > PPA to
> > > > > > test the new connection algorithm. However, a SWIG error
> > > > > > starts to
> > > > > > pop up in my python plugins. Right now I can produce the
> > > > > > error,
> > > > > > when calling GetDrawings on the board object (which worked
> > > > > > a few
> > > > > > days ago). It looks like the SWIG wrappers are
> > > > > > desynchronized from
> > > > > > the C++-code. Is that (at all) possible? This is the
> > > > > > Traceback I
> > > > > > get:  Traceback (most recent call last): File
> > > > > > "/home/sk/.kicad_plugins/action_viafence/viafence_action.py
> > > > > > ", line
> > > > > > 160, in Run boardItem =
> > > > > > self.boardObj.GetDrawings().GetFirst() File
> > > > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508,
> > > > > > in
> > > > > > GetDrawings def GetDrawings(self): return self.m_Drawings
> > > > > > File
> > > > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803,
> > > > > > in
> > > > > >  __getattr__ = lambda self, name:
> > > > > > _swig_getattr(self,
> > > > > > BOARD, name) File "/usr/lib/python2.7/dist-
> > > > > > packages/pcbnew.py",
> > > > > > line 74, in _swig_getattr return
> > > > > > _swig_getattr_nondynamic(self,
> > > > > > class_type, name, 0) File
> > > > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
> > > > > > _swig_getattr_nondynamic return object.__getattr__(self,
> > > > > > name)
> > > > > > AttributeError: type object 'object' has no attribute
> > > > > > '__getattr__'
> > > > > > Best Regards Simon
> > > > > > ___
> > > > > > Mailing list: https://launchpad.net/~kicad-developers Post
> > > > > > to :
> > > > > > kicad-developers@lists.launchpad.net
> > > > > > kicad-developers@lists.launchpad.net>
> > > > > > kicad-developers@lists.launchpad.net> Unsubscribe :
> > > > > > https://launchpad.net/~kicad-developers More help :
> > > > > > https://help.launchpad.net/ListHelp 
> > > > > ___ Mailing list:
> > > > > https://launchpad.net/~kicad-developers Post to :
> > > > > kicad-developers@lists.launchpad.net
> > > > > kicad-developers@lists.launchpad.net>
> > > > > kicad-developers@lists.launchpad.net> Unsubscribe :
> > > > > https://launchpad.net/~kicad-developers More help :
> > > > > https://help.launchpad.net/ListHelp 
> > > > ___ Mailing list:
> > > > https://launchpad.net/~kicad-developers Post to :
> > > > kicad-developers@lists.launchpad.net
> > > > kicad-developers@lists.launchpad.net> Unsubscribe :
> > > > https://launchpad.net/~kicad-developers More help :
> > > > https://help.launchpad.net/ListHelp 
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> > 
> ___
> Mailing list: 

Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Simon Küppers
Hey,
It works for me thanks. But what is the background here? Has someone
just changed the name of something in the Python API (are we supposed to
use DrawingsList() from now on) or is this just something like a workaround?

Thanks
Simon

Am 26.06.2017 um 12:03 schrieb reynaud:
> Hi,
> 
> DrawingsList() is a good candidate ;)
> 
> 
> Le lundi 26 juin 2017 à 11:34 +0200, easyw a écrit :
>> Hi Js,
>> thx with PadsList() the script is fine now...
>>
>> Do you have any suggestion also for
>>
>> "for drw in board.GetDrawings():
>> GetDrawings def GetDrawings(self): return self.m_Drawings File
>> ...
>> AttributeError: type object 'object' has no attribute '__getattr__'"
>>
>> reference this action script
>> https://github.com/easyw/kicad-action-plugins/blob/master/action_menu_move_to_layer.py
>>
>>
>> thx
>> Maurice
>>
>> On 06/26/2017 11:21 AM, reynaud wrote:
>>> Hi, Python interface is not stable. You can have some changes on
>>> daily build version. In your case, using PadsList() instead of Pads()
>>> should fix your issue. Le lundi 26 juin 2017 à 10:23 +0200, easyw a
>>> écrit :
 Hi, I can confirm the same error on windows 10. I get also an other
 kind of error in my annular plugin that worked till now "for pad in
 module.Pads(): TypeError 'SwigPyObject' object is not iterable" BR
 Maurice On 06/25/2017 5:46 PM, Simon Küppers wrote:
> Hi, I just updated KiCad on Linux Mint using the Launchpad PPA to
> test the new connection algorithm. However, a SWIG error starts to
> pop up in my python plugins. Right now I can produce the error,
> when calling GetDrawings on the board object (which worked a few
> days ago). It looks like the SWIG wrappers are desynchronized from
> the C++-code. Is that (at all) possible? This is the Traceback I
> get:  Traceback (most recent call last): File
> "/home/sk/.kicad_plugins/action_viafence/viafence_action.py", line
> 160, in Run boardItem = self.boardObj.GetDrawings().GetFirst() File
> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
> GetDrawings def GetDrawings(self): return self.m_Drawings File
> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
>  __getattr__ = lambda self, name: _swig_getattr(self,
> BOARD, name) File "/usr/lib/python2.7/dist-packages/pcbnew.py",
> line 74, in _swig_getattr return _swig_getattr_nondynamic(self,
> class_type, name, 0) File
> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
> _swig_getattr_nondynamic return object.__getattr__(self, name)
> AttributeError: type object 'object' has no attribute '__getattr__'
> Best Regards Simon ___
> Mailing list: https://launchpad.net/~kicad-developers Post to :
> kicad-developers@lists.launchpad.net
> 
>  Unsubscribe :
> https://launchpad.net/~kicad-developers More help :
> https://help.launchpad.net/ListHelp 
 ___ Mailing list:
 https://launchpad.net/~kicad-developers Post to :
 kicad-developers@lists.launchpad.net
 
  Unsubscribe :
 https://launchpad.net/~kicad-developers More help :
 https://help.launchpad.net/ListHelp 
>>> ___ Mailing list:
>>> https://launchpad.net/~kicad-developers Post to :
>>> kicad-developers@lists.launchpad.net
>>>  Unsubscribe :
>>> https://launchpad.net/~kicad-developers More help :
>>> https://help.launchpad.net/ListHelp 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread reynaud
Yes,  DLIST_ITERATOR_WRAPPER is not yet in python interface.
Le lundi 26 juin 2017 à 11:36 +0200, Simon Küppers a écrit :
> Well, of course it is not stable. In the nightly builds, nothing is
> actually stable :-)
> 
> But I don't think there is a reason why these features are broken,
> and I
> think it might be a small oversight when someone else made changes
> and
> we should thus fix it.
> 
> Best Regards
> Simon
> 
> Am 26.06.2017 um 11:21 schrieb reynaud:
> > 
> > Hi,
> > 
> > Python interface is not stable. You can have some changes on daily
> > build
> > version.
> > In your case, using PadsList() instead of Pads() should fix your
> > issue.
> > 
> > 
> > Le lundi 26 juin 2017 à 10:23 +0200, easyw a écrit :
> > > 
> > > Hi,
> > > I can confirm the same error on windows 10.
> > > 
> > > I get also an other kind of error in my annular plugin that
> > > worked till now
> > > 
> > > "for pad in module.Pads():
> > > TypeError 'SwigPyObject' object is not iterable"
> > > 
> > > BR
> > > Maurice
> > > 
> > > On 06/25/2017 5:46 PM, Simon Küppers wrote:
> > > > 
> > > > Hi, I just updated KiCad on Linux Mint using the Launchpad PPA
> > > > to
> > > > test the new connection algorithm. However, a SWIG error starts
> > > > to
> > > > pop up in my python plugins. Right now I can produce the error,
> > > > when
> > > > calling GetDrawings on the board object (which worked a few
> > > > days
> > > > ago). It looks like the SWIG wrappers are desynchronized from
> > > > the
> > > > C++-code. Is that (at all) possible? This is the Traceback I
> > > > get:
> > > >  Traceback (most recent call last): File
> > > > "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
> > > > line
> > > > 160, in Run boardItem = self.boardObj.GetDrawings().GetFirst()
> > > > File
> > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
> > > > GetDrawings def GetDrawings(self): return self.m_Drawings File
> > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
> > > > 
> > > > __getattr__ = lambda self, name: _swig_getattr(self, BOARD,
> > > > name)
> > > > File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
> > > > _swig_getattr return _swig_getattr_nondynamic(self, class_type,
> > > > name,
> > > > 0) File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69,
> > > > in
> > > > _swig_getattr_nondynamic return object.__getattr__(self, name)
> > > > AttributeError: type object 'object' has no attribute
> > > > '__getattr__'
> > > > Best Regards Simon
> > > > ___
> > > > Mailing list: https://launchpad.net/~kicad-developers Post to :
> > > > kicad-developers@lists.launchpad.net
> > > > kicad-developers@lists.launchpad.net> Unsubscribe :
> > > > https://launchpad.net/~kicad-developers More help :
> > > > https://help.launchpad.net/ListHelp 
> > > 
> > > ___
> > > Mailing list: https://launchpad.net/~kicad-developers
> > > Post to : kicad-developers@lists.launchpad.net 
> > > develop...@lists.launchpad.net>
> > > Unsubscribe : https://launchpad.net/~kicad-developers
> > > More help   : https://help.launchpad.net/ListHelp
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> > 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread reynaud
Hi,
DrawingsList() is a good candidate ;)
Le lundi 26 juin 2017 à 11:34 +0200, easyw a écrit :
> Hi Js,
> thx with PadsList() the script is fine now...
> 
> Do you have any suggestion also for
> 
> "for drw in board.GetDrawings():
> GetDrawings def GetDrawings(self): return self.m_Drawings File
> ...
> AttributeError: type object 'object' has no attribute '__getattr__'"
> 
> reference this action script
> https://github.com/easyw/kicad-action-plugins/blob/master/action_menu
> _move_to_layer.py
> 
> 
> thx
> Maurice
> 
> On 06/26/2017 11:21 AM, reynaud wrote:
> > 
> > Hi,
> > 
> > Python interface is not stable. You can have some changes on daily
> > build
> > version.
> > In your case, using PadsList() instead of Pads() should fix your
> > issue.
> > 
> > 
> > Le lundi 26 juin 2017 à 10:23 +0200, easyw a écrit :
> > > 
> > > Hi,
> > > I can confirm the same error on windows 10.
> > > 
> > > I get also an other kind of error in my annular plugin that
> > > worked till now
> > > 
> > > "for pad in module.Pads():
> > > TypeError 'SwigPyObject' object is not iterable"
> > > 
> > > BR
> > > Maurice
> > > 
> > > On 06/25/2017 5:46 PM, Simon Küppers wrote:
> > > > 
> > > > Hi, I just updated KiCad on Linux Mint using the Launchpad PPA
> > > > to
> > > > test the new connection algorithm. However, a SWIG error starts
> > > > to
> > > > pop up in my python plugins. Right now I can produce the error,
> > > > when
> > > > calling GetDrawings on the board object (which worked a few
> > > > days
> > > > ago). It looks like the SWIG wrappers are desynchronized from
> > > > the
> > > > C++-code. Is that (at all) possible? This is the Traceback I
> > > > get:
> > > >  Traceback (most recent call last): File
> > > > "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
> > > > line
> > > > 160, in Run boardItem = self.boardObj.GetDrawings().GetFirst()
> > > > File
> > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
> > > > GetDrawings def GetDrawings(self): return self.m_Drawings File
> > > > "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
> > > > 
> > > > __getattr__ = lambda self, name: _swig_getattr(self, BOARD,
> > > > name)
> > > > File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
> > > > _swig_getattr return _swig_getattr_nondynamic(self, class_type,
> > > > name,
> > > > 0) File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69,
> > > > in
> > > > _swig_getattr_nondynamic return object.__getattr__(self, name)
> > > > AttributeError: type object 'object' has no attribute
> > > > '__getattr__'
> > > > Best Regards Simon
> > > > ___
> > > > Mailing list: https://launchpad.net/~kicad-developers Post to :
> > > > kicad-developers@lists.launchpad.net
> > > > kicad-developers@lists.launchpad.net> Unsubscribe :
> > > > https://launchpad.net/~kicad-developers More help :
> > > > https://help.launchpad.net/ListHelp
> > > 
> > > ___
> > > Mailing list: https://launchpad.net/~kicad-developers
> > > Post to : kicad-developers@lists.launchpad.net
> > > kicad-developers@lists.launchpad.net>
> > > Unsubscribe : https://launchpad.net/~kicad-developers
> > > More help   : https://help.launchpad.net/ListHelp
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> > ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread Simon Küppers
Well, of course it is not stable. In the nightly builds, nothing is
actually stable :-)

But I don't think there is a reason why these features are broken, and I
think it might be a small oversight when someone else made changes and
we should thus fix it.

Best Regards
Simon

Am 26.06.2017 um 11:21 schrieb reynaud:
> Hi,
> 
> Python interface is not stable. You can have some changes on daily build
> version.
> In your case, using PadsList() instead of Pads() should fix your issue.
> 
> 
> Le lundi 26 juin 2017 à 10:23 +0200, easyw a écrit :
>> Hi,
>> I can confirm the same error on windows 10.
>>
>> I get also an other kind of error in my annular plugin that worked till now
>>
>> "for pad in module.Pads():
>> TypeError 'SwigPyObject' object is not iterable"
>>
>> BR
>> Maurice
>>
>> On 06/25/2017 5:46 PM, Simon Küppers wrote:
>>> Hi, I just updated KiCad on Linux Mint using the Launchpad PPA to
>>> test the new connection algorithm. However, a SWIG error starts to
>>> pop up in my python plugins. Right now I can produce the error, when
>>> calling GetDrawings on the board object (which worked a few days
>>> ago). It looks like the SWIG wrappers are desynchronized from the
>>> C++-code. Is that (at all) possible? This is the Traceback I get:
>>>  Traceback (most recent call last): File
>>> "/home/sk/.kicad_plugins/action_viafence/viafence_action.py", line
>>> 160, in Run boardItem = self.boardObj.GetDrawings().GetFirst() File
>>> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
>>> GetDrawings def GetDrawings(self): return self.m_Drawings File
>>> "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in 
>>> __getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
>>> File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
>>> _swig_getattr return _swig_getattr_nondynamic(self, class_type, name,
>>> 0) File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
>>> _swig_getattr_nondynamic return object.__getattr__(self, name)
>>> AttributeError: type object 'object' has no attribute '__getattr__'
>>> Best Regards Simon ___
>>> Mailing list: https://launchpad.net/~kicad-developers Post to :
>>> kicad-developers@lists.launchpad.net
>>>  Unsubscribe :
>>> https://launchpad.net/~kicad-developers More help :
>>> https://help.launchpad.net/ListHelp 
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net 
>> 
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread easyw

Hi Js,
thx with PadsList() the script is fine now...

Do you have any suggestion also for

"for drw in board.GetDrawings():
GetDrawings def GetDrawings(self): return self.m_Drawings File
...
AttributeError: type object 'object' has no attribute '__getattr__'"

reference this action script
https://github.com/easyw/kicad-action-plugins/blob/master/action_menu_move_to_layer.py


thx
Maurice

On 06/26/2017 11:21 AM, reynaud wrote:

Hi,

Python interface is not stable. You can have some changes on daily build
version.
In your case, using PadsList() instead of Pads() should fix your issue.


Le lundi 26 juin 2017 à 10:23 +0200, easyw a écrit :

Hi,
I can confirm the same error on windows 10.

I get also an other kind of error in my annular plugin that worked till now

"for pad in module.Pads():
TypeError 'SwigPyObject' object is not iterable"

BR
Maurice

On 06/25/2017 5:46 PM, Simon Küppers wrote:

Hi, I just updated KiCad on Linux Mint using the Launchpad PPA to
test the new connection algorithm. However, a SWIG error starts to
pop up in my python plugins. Right now I can produce the error, when
calling GetDrawings on the board object (which worked a few days
ago). It looks like the SWIG wrappers are desynchronized from the
C++-code. Is that (at all) possible? This is the Traceback I get:
 Traceback (most recent call last): File
"/home/sk/.kicad_plugins/action_viafence/viafence_action.py", line
160, in Run boardItem = self.boardObj.GetDrawings().GetFirst() File
"/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
GetDrawings def GetDrawings(self): return self.m_Drawings File
"/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in 
__getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)
File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
_swig_getattr return _swig_getattr_nondynamic(self, class_type, name,
0) File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
_swig_getattr_nondynamic return object.__getattr__(self, name)
AttributeError: type object 'object' has no attribute '__getattr__'
Best Regards Simon ___
Mailing list: https://launchpad.net/~kicad-developers Post to :
kicad-developers@lists.launchpad.net
 Unsubscribe :
https://launchpad.net/~kicad-developers More help :
https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net

Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread reynaud
Hi,
Python interface is not stable. You can have some changes on daily
build version.
In your case, using PadsList() instead of Pads() should fix your issue.
Le lundi 26 juin 2017 à 10:23 +0200, easyw a écrit :
> Hi,
> I can confirm the same error on windows 10.
> 
> I get also an other kind of error in my annular plugin that worked
> till now
> 
> "for pad in module.Pads():
> TypeError 'SwigPyObject' object is not iterable"
> 
> BR
> Maurice
> 
> On 06/25/2017 5:46 PM, Simon Küppers wrote:
> > 
> > Hi,
> > I just updated KiCad on Linux Mint using the Launchpad PPA to test
> > the
> > new connection algorithm. However, a SWIG error starts to pop up in
> > my
> > python plugins.
> > Right now I can produce the error, when calling GetDrawings on the
> > board
> > object (which worked a few days ago). It looks like the SWIG
> > wrappers
> > are desynchronized from the C++-code. Is that (at all) possible?
> > 
> > This is the Traceback I get:
> > 
> > 
> > Traceback (most recent call last):
> > 
> >   File
> > "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
> > line 160, in Run
> > boardItem = self.boardObj.GetDrawings().GetFirst()
> > 
> >   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
> > GetDrawings
> > def GetDrawings(self):return self.m_Drawings
> > 
> >   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in
> > 
> > __getattr__ = lambda self, name: _swig_getattr(self, BOARD,
> > name)
> > 
> >   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
> > _swig_getattr
> > return _swig_getattr_nondynamic(self, class_type, name, 0)
> > 
> >   File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
> > _swig_getattr_nondynamic
> > return object.__getattr__(self, name)
> > 
> > AttributeError: type object 'object' has no attribute '__getattr__'
> > 
> > Best Regards
> > Simon
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> > 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Pcbnew Python Interface breakage?

2017-06-26 Thread easyw

Hi,
I can confirm the same error on windows 10.

I get also an other kind of error in my annular plugin that worked till now

"for pad in module.Pads():
TypeError 'SwigPyObject' object is not iterable"

BR
Maurice

On 06/25/2017 5:46 PM, Simon Küppers wrote:

Hi,
I just updated KiCad on Linux Mint using the Launchpad PPA to test the
new connection algorithm. However, a SWIG error starts to pop up in my
python plugins.
Right now I can produce the error, when calling GetDrawings on the board
object (which worked a few days ago). It looks like the SWIG wrappers
are desynchronized from the C++-code. Is that (at all) possible?

This is the Traceback I get:


Traceback (most recent call last):

  File "/home/sk/.kicad_plugins/action_viafence/viafence_action.py",
line 160, in Run
boardItem = self.boardObj.GetDrawings().GetFirst()

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 18508, in
GetDrawings
def GetDrawings(self):return self.m_Drawings

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 17803, in 
__getattr__ = lambda self, name: _swig_getattr(self, BOARD, name)

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 74, in
_swig_getattr
return _swig_getattr_nondynamic(self, class_type, name, 0)

  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 69, in
_swig_getattr_nondynamic
return object.__getattr__(self, name)

AttributeError: type object 'object' has no attribute '__getattr__'

Best Regards
Simon

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp