kigadgets.environment

Automatic linker to pcbnew GUI and pcbnew python package Use this one time to create the link.

  1. In pcbnew’s terminal window:

    >>> import pcbnew; print(pcbnew.__file__, pcbnew.SETTINGS_MANAGER.GetUserSettingsPath())
    /usr/lib/python3/dist-packages/pcbnew.py /home/username/.config/kicad
    
  2. Copy the entire output.

  3. In an external terminal, with environment of choice activated:

    (myenv) $ link_kigadgets_to_pcbnew [paste here]
    

Module Contents

Functions

get_pcbnew_path_from_file()

get_pcbnew_path()

get_pcbnew_module()

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

create_link(pcbnew_module_path, kicad_config_path[, ...])

cl_main()

Attributes

pcbnew_path_store

startup_script

plugin_script

help_msg

parser

kigadgets.environment.pcbnew_path_store
kigadgets.environment.get_pcbnew_path_from_file()
kigadgets.environment.get_pcbnew_path()
kigadgets.environment.get_pcbnew_module()

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

kigadgets.environment.startup_script = Multiline-String
Show Value
"""### Auto generated by kigadgets initialization for pcbnew console
import sys, pcbnew
sys.path.append("{}")
import kigadgets
print('kigadgets (v{{}}) located at:'.format(kigadgets.__version__), kigadgets.__path__)
from kigadgets.board import Board
pcb = Board.from_editor()
"""
kigadgets.environment.plugin_script = Multiline-String
Show Value
"""### Auto generated by kigadgets initialization for pcbnew action plugins
import sys
sys.path.append("{}")
"""
kigadgets.environment.help_msg = Multiline-String
Show Value
"""
Create bidirectional link between kigadgets and pcbnew
To get the arguments correct, copy this and run it in pcbnew application console:

    import pcbnew; print(pcbnew.__file__, pcbnew.SETTINGS_MANAGER.GetUserSettingsPath())
    # which produces output like
    /usr/lib/python3/dist-packages/pcbnew.py /home/username/.config/kicad

    2. Copy the entire output.

    3. In an external terminal, with environment of choice activated::

        (myenv) $ link_kigadgets_to_pcbnew [paste here]

For kicad 5, replace that last command with `pcbnew.SETTINGS_MANAGER_GetUserSettingsPath()`
    - Note the last underscore
"""
kigadgets.environment.parser
kigadgets.environment.cl_main()