Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KincoActuatorIsaacLab
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kevin
KincoActuatorIsaacLab
Commits
0a887f8f
Commit
0a887f8f
authored
Mar 04, 2023
by
Mayank Mittal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds error handling in setup_vscode.py
parent
ed94e762
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
setup_vscode.py
.vscode/tools/setup_vscode.py
+12
-4
No files found.
.vscode/tools/setup_vscode.py
View file @
0a887f8f
...
@@ -14,9 +14,10 @@ when the "setup_python_env.sh" is run as part of the vs-code launch configuratio
...
@@ -14,9 +14,10 @@ when the "setup_python_env.sh" is run as part of the vs-code launch configuratio
import
re
import
re
import
os
import
os
import
pathlib
ORBIT_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../../"
))
ORBIT_DIR
=
pathlib
.
Path
(
__file__
)
.
parents
[
2
]
"""Path to the orbit directory."""
"""Path to the orbit directory."""
ISAACSIM_DIR
=
os
.
path
.
join
(
ORBIT_DIR
,
"_isaac_sim"
)
ISAACSIM_DIR
=
os
.
path
.
join
(
ORBIT_DIR
,
"_isaac_sim"
)
"""Path to the isaac-sim directory."""
"""Path to the isaac-sim directory."""
...
@@ -24,7 +25,10 @@ ISAACSIM_DIR = os.path.join(ORBIT_DIR, "_isaac_sim")
...
@@ -24,7 +25,10 @@ ISAACSIM_DIR = os.path.join(ORBIT_DIR, "_isaac_sim")
def
main
():
def
main
():
# isaac-sim settings
# isaac-sim settings
isaacsim_vscode_filename
=
os
.
path
.
join
(
ISAACSIM_DIR
,
".vscode/settings.json"
)
isaacsim_vscode_filename
=
os
.
path
.
join
(
ISAACSIM_DIR
,
".vscode"
,
"settings.json"
)
# make sure the isaac-sim settings file exists
if
not
os
.
path
.
exists
(
isaacsim_vscode_filename
):
raise
FileNotFoundError
(
f
"Could not find the isaac-sim settings file: {isaacsim_vscode_filename}"
)
# read the path names from the isaac-sim settings file
# read the path names from the isaac-sim settings file
with
open
(
isaacsim_vscode_filename
)
as
f
:
with
open
(
isaacsim_vscode_filename
)
as
f
:
vscode_settings
=
f
.
read
()
vscode_settings
=
f
.
read
()
...
@@ -42,8 +46,12 @@ def main():
...
@@ -42,8 +46,12 @@ def main():
# combine them into a single string
# combine them into a single string
path_names
=
",
\n\t\t
"
.
expandtabs
(
4
)
.
join
(
path_names
)
path_names
=
",
\n\t\t
"
.
expandtabs
(
4
)
.
join
(
path_names
)
# orbit template settings
orbit_vscode_template_filename
=
os
.
path
.
join
(
ORBIT_DIR
,
".vscode"
,
"tools"
,
"settings.template.json"
)
# make sure the orbit template settings file exists
if
not
os
.
path
.
exists
(
orbit_vscode_template_filename
):
raise
FileNotFoundError
(
f
"Could not find the orbit template settings file: {orbit_vscode_template_filename}"
)
# read the orbit template settings file
# read the orbit template settings file
orbit_vscode_template_filename
=
os
.
path
.
join
(
ORBIT_DIR
,
".vscode/tools/settings.template.json"
)
with
open
(
orbit_vscode_template_filename
)
as
f
:
with
open
(
orbit_vscode_template_filename
)
as
f
:
orbit_template_settings
=
f
.
read
()
orbit_template_settings
=
f
.
read
()
# replace the path names in the orbit settings file with the path names from the isaac-sim settings file
# replace the path names in the orbit settings file with the path names from the isaac-sim settings file
...
@@ -63,7 +71,7 @@ def main():
...
@@ -63,7 +71,7 @@ def main():
orbit_settings
=
header_message
+
orbit_settings
orbit_settings
=
header_message
+
orbit_settings
# write the orbit settings file
# write the orbit settings file
orbit_vscode_filename
=
os
.
path
.
join
(
ORBIT_DIR
,
".vscode
/
settings.json"
)
orbit_vscode_filename
=
os
.
path
.
join
(
ORBIT_DIR
,
".vscode
"
,
"
settings.json"
)
with
open
(
orbit_vscode_filename
,
"w"
)
as
f
:
with
open
(
orbit_vscode_filename
,
"w"
)
as
f
:
f
.
write
(
orbit_settings
)
f
.
write
(
orbit_settings
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment