Skip to content

Commit

Permalink
use catkin_install_python to automatically set /usr/bin/env python3 f…
Browse files Browse the repository at this point in the history
…or noetic, but need to remove smach_viewer/lib/smach_viewer from sys.path
  • Loading branch information
k-okada committed Jul 31, 2022
1 parent 4b4288a commit f4204ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion smach_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ catkin_package(
)

# Install targets
install(PROGRAMS scripts/smach_viewer.py
catkin_install_python(PROGRAMS scripts/smach_viewer.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
2 changes: 2 additions & 0 deletions smach_viewer/scripts/smach_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def import_non_local(name, custom_name=None):
os.chdir(cur_dir)
# Remove this dir from path
sys.path = [a for a in sys.path if a not in [this_dir, this_dir_cwd]]
# Ignore path ends in smach_viewer/lib/smach_viewer
sys.path = [a for a in sys.path if not a.endswith('smach_viewer/lib/smach_viewer')]
#
from smach_viewer.xdot import wxxdot
from xdot.ui.elements import *
Expand Down

0 comments on commit f4204ee

Please sign in to comment.