-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jsk_unitree_startup/cross] Use sitecustomize.py instead of setting P…
…YTHONPATH [jsk_unitree_startup/cross] Install sitecustomize.py for real unitree robot [jsk_unitree_startup/cross] Recursively append python site/dist-package paths [jsk_unitree_startup/cross] Passthrough password
- Loading branch information
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# install the apport exception handler if available | ||
import site | ||
import sys | ||
import os | ||
import os.path as osp | ||
|
||
site.PREFIXES += [ | ||
'/opt/jsk/System/Python/', | ||
'/opt/jsk/System/ros1_dependencies/', | ||
'/opt/jsk/System/ros1_inst/', | ||
] | ||
|
||
|
||
def recursively_listup_paths(path): | ||
paths = [] | ||
for sub_path in os.listdir(path): | ||
sub_full_path = osp.join(path, sub_path) | ||
if osp.isdir(sub_full_path) and (sub_path.endswith('.egg-info') or sub_path.endswith('.egg')): | ||
paths.append(sub_full_path) | ||
return paths | ||
|
||
|
||
paths = [] | ||
for path in site.getsitepackages(): | ||
if osp.exists(path): | ||
paths.append(path) | ||
paths.extend(recursively_listup_paths(path)) | ||
site_package = osp.join(osp.dirname(path), 'site-packages') | ||
if site_package != path and osp.exists(site_package): | ||
paths.append(site_package) | ||
paths.extend(recursively_listup_paths(site_package)) | ||
|
||
sys.path.extend(paths) | ||
try: | ||
import apport_python_hook | ||
except ImportError: | ||
pass | ||
else: | ||
apport_python_hook.install() |