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.
This commit is contained in:
Wayne Stambaugh 2015-09-30 16:14:59 -04:00
parent 5a4c663682
commit 8f99fc0496
2 changed files with 8 additions and 7 deletions

View File

@ -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 )

View File

@ -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())