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,12 +670,13 @@ if( KICAD_SCRIPTING )
|
||||||
COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
|
COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
|
||||||
)
|
)
|
||||||
add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy )
|
add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy )
|
||||||
# scripting plugins
|
|
||||||
install( DIRECTORY ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins/
|
|
||||||
DESTINATION ${KICAD_DATA}/scripting/plugins
|
|
||||||
COMPONENT binary
|
|
||||||
)
|
|
||||||
endif()
|
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()
|
endif()
|
||||||
|
|
||||||
if( KICAD_SCRIPTING_MODULES )
|
if( KICAD_SCRIPTING_MODULES )
|
||||||
|
|
|
@ -101,11 +101,11 @@ def LoadPlugins( plugpath ):
|
||||||
plugin_directories.append( os.path.join( singlepath, 'scripting', 'plugins') )
|
plugin_directories.append( os.path.join( singlepath, 'scripting', 'plugins') )
|
||||||
|
|
||||||
for plugins_dir in plugin_directories:
|
for plugins_dir in plugin_directories:
|
||||||
sys.path.append(plugins_dir)
|
|
||||||
|
|
||||||
if not os.path.isdir(plugins_dir):
|
if not os.path.isdir(plugins_dir):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
sys.path.append(plugins_dir)
|
||||||
|
|
||||||
for module in os.listdir(plugins_dir):
|
for module in os.listdir(plugins_dir):
|
||||||
if os.path.isdir(plugins_dir+module):
|
if os.path.isdir(plugins_dir+module):
|
||||||
__import__(module, locals(), globals())
|
__import__(module, locals(), globals())
|
||||||
|
|
Loading…
Reference in New Issue