Browse Source

Minor Python scripting fixes.

* Actually install the contents of the pcbnew/scripting/plugins directory on
  Windows and Linux
* Move the test for existence of a directory before adding it to the Python
  system library paths when loading the Python plugins.
pull/7/head
Wayne Stambaugh 10 years ago
parent
commit
8f99fc0496
  1. 11
      pcbnew/CMakeLists.txt
  2. 4
      scripting/kicadplugins.i

11
pcbnew/CMakeLists.txt

@ -670,12 +670,13 @@ if( KICAD_SCRIPTING )
COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
)
add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy )
# scripting plugins
install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins/
DESTINATION ${KICAD_DATA}/scripting/plugins
COMPONENT binary
)
endif()
# scripting plugins
install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins/
DESTINATION ${KICAD_DATA}/scripting/plugins
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
endif()
if( KICAD_SCRIPTING_MODULES )

4
scripting/kicadplugins.i

@ -101,11 +101,11 @@ def LoadPlugins( plugpath ):
plugin_directories.append( os.path.join( singlepath, 'scripting', 'plugins') )
for plugins_dir in plugin_directories:
sys.path.append(plugins_dir)
if not os.path.isdir(plugins_dir):
continue
sys.path.append(plugins_dir)
for module in os.listdir(plugins_dir):
if os.path.isdir(plugins_dir+module):
__import__(module, locals(), globals())

Loading…
Cancel
Save