kigadgets

Submodules

Package Contents

Functions

get_pcbnew_module()

returns the imported <module>. Modifies sys.path so that

notify(*args)

Show text in a popup window while in the GUI.

query_user([prompt, default])

Simple GUI dialog asking for a single value.

put_import_warning_on_kicad()

Legacy scripts may attempt to import "kicad"

new(class_type, instance)

Returns an object of class without calling __init__.

pcbnew_version([asstr])

instanceof(item, klass)

Attributes

kireload

pcbnew_bare

SWIG_version

kigadgets.get_pcbnew_module()

returns the imported <module>. Modifies sys.path so that subsequent import pcbnew will work

kigadgets.notify(*args)

Show text in a popup window while in the GUI. Arguments act the same as print(*args). Not the best debugging tool ever created, but it is handy for debugging action plugins:

notify('Debug info:', 'x =', x)
kigadgets.query_user(prompt=None, default='')

Simple GUI dialog asking for a single value. Returns what was entered by the user as a string:

retstr = query_user('Enter a drill width in mm', 0.5)
if retstr is None:
    return
drill = float(retstr)
kigadgets.kireload
kigadgets.put_import_warning_on_kicad()

Legacy scripts may attempt to import “kicad” Rather than ImportError, tell them about the rename

kigadgets.pcbnew_bare
kigadgets.new(class_type, instance)

Returns an object of class without calling __init__.

This could lead to inconsistent objects, use only when you know what you’re doing. In kigadgets this is used to construct wrapper classes before injecting the native object.

kigadgets.pcbnew_version(asstr=False)
kigadgets.SWIG_version
kigadgets.instanceof(item, klass)