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:
parent
5a4c663682
commit
8f99fc0496
|
@ -670,13 +670,14 @@ if( KICAD_SCRIPTING )
|
|||
COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
|
||||
)
|
||||
add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy )
|
||||
endif()
|
||||
|
||||
# scripting plugins
|
||||
install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins/
|
||||
DESTINATION ${KICAD_DATA}/scripting/plugins
|
||||
COMPONENT binary
|
||||
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( KICAD_SCRIPTING_MODULES )
|
||||
add_custom_target( FixSwigImportsModuleScripting ALL
|
||||
|
|
|
@ -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…
Reference in New Issue