-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workspace Extension Functionality (#36)
* Added Workspaces * Version 0.2.2 - Bug Fix - Fixed recursion error for workspaces - Fixed workspace description typo in settings - Fixed viz-robotmodel.png not found * Minor Changes - Restored saved settings to default state - Fixed typo in settings schema - Removed unused import in Pkgs Module
- Loading branch information
Showing
9 changed files
with
66 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.2.1" | ||
__version__ = "0.2.2" |
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 |
---|---|---|
@@ -1,43 +1,58 @@ | ||
from os import path | ||
from os import path,environ | ||
import json | ||
from tkinter import W | ||
|
||
ROOT = path.dirname(path.dirname(__file__)) | ||
PUBLIC = path.join(ROOT, 'public') | ||
SETTINGS = path.join(ROOT, 'static/settings.json') | ||
MASTER = path.join(ROOT, 'static/roslab.launch') | ||
ROS_PACKAGE_PATH = environ.get("ROS_PACKAGE_PATH", default="").strip() | ||
|
||
|
||
def getEnv(): | ||
try: | ||
with open(SETTINGS) as settings: | ||
data = json.load(settings) | ||
|
||
except Exception : | ||
data = { "env": "", "master": "" } | ||
data = { "env": "", "master": "", "workspaces": ""} | ||
|
||
return data['env'] | ||
|
||
def getWorkspaces(): | ||
try: | ||
with open(SETTINGS) as settings: | ||
data = json.load(settings) | ||
|
||
except Exception : | ||
data = { "env": "", "master": "", "workspaces": ""} | ||
|
||
return data['workspaces'] if data['workspaces'] != "" else ROS_PACKAGE_PATH | ||
|
||
|
||
def getMaster(): | ||
try: | ||
with open(SETTINGS) as settings: | ||
data = json.load(settings) | ||
|
||
except Exception : | ||
data = { "env": "", "master": "" } | ||
data = { "env": "", "master": "", "workspaces": ""} | ||
|
||
return data['master'] if data['master'] != "" else MASTER | ||
|
||
def save(env, master): | ||
def save(env, master, workspaces): | ||
try: | ||
with open(SETTINGS, 'r') as settings: | ||
data = json.load(settings) | ||
|
||
except Exception : | ||
data = { "env": "", "master": "" } | ||
data = { "env": "", "master": "" , "workspaces": ""} | ||
|
||
data['env'] = env | ||
data['master'] = master | ||
data['workspaces'] = workspaces | ||
|
||
with open(SETTINGS, 'w+') as settings: | ||
json.dump(data, settings) | ||
|
||
save("", "") | ||
save("", "", ROS_PACKAGE_PATH) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"env": "", "master": ""} | ||
{"env": "", "master": "", "workspaces": ""} |
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