kigadgets ========= .. py:module:: kigadgets Submodules ---------- .. toctree:: :maxdepth: 1 /API/kigadgets/board/index /API/kigadgets/drawing/index /API/kigadgets/environment/index /API/kigadgets/exceptions/index /API/kigadgets/item/index /API/kigadgets/layer/index /API/kigadgets/module/index /API/kigadgets/pad/index /API/kigadgets/point/index /API/kigadgets/size/index /API/kigadgets/track/index /API/kigadgets/units/index /API/kigadgets/util/index /API/kigadgets/via/index /API/kigadgets/zone/index Attributes ---------- .. autoapisummary:: kigadgets.pcbnew_bare kigadgets.SWIG_version kigadgets.ver kigadgets.DEFAULT_UNIT_IUS kigadgets.Point Classes ------- .. autoapisummary:: kigadgets.SWIGtype Functions --------- .. autoapisummary:: kigadgets.get_pcbnew_module kigadgets.notify kigadgets.query_user kigadgets.kireload kigadgets.put_import_warning_on_kicad kigadgets.new kigadgets.pcbnew_version kigadgets.instanceof Package Contents ---------------- .. py:function:: get_pcbnew_module(verbose=True) returns the imported module. Modifies sys.path so that subsequent "import pcbnew" will work as expected. .. py:function:: notify(*args: Any) -> Optional[int] 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) .. py:function:: query_user(prompt: Optional[str] = None, default: Union[str, int, float] = '') -> Optional[str] 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: # User cancelled return else: drill = float(retstr) .. py:function:: kireload(mod: Any) -> None Reload a module. If it is not in sys.modules, it will be imported. .. py:function:: put_import_warning_on_kicad() Legacy scripts may attempt to import "kicad" Rather than ImportError, tell them about the rename .. py:data:: pcbnew_bare .. py:function:: new(class_type: type, instance: object) -> object 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. .. py:function:: pcbnew_version(asstr=False) -> tuple[int, int] .. py:data:: SWIG_version :value: None .. py:class:: SWIGtype .. py:data:: ver .. py:function:: instanceof(item, klass) -> bool .. py:data:: DEFAULT_UNIT_IUS :value: 1000000 .. py:data:: Point :value: None