Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix and improve #102

Merged
merged 11 commits into from
Aug 18, 2020
17 changes: 11 additions & 6 deletions allzpark/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, ctrl, storage):
"profileName": storage.value("startupProfile"),
"appRequest": storage.value("startupApplication"),

# String or callable, returning list of profile names
# list or callable, returning list of profile names
"root": None,

# Current error, if any
Expand Down Expand Up @@ -385,7 +385,7 @@ def on_unhandled_exception(self, type, value, tb):
# package family not found: occoc (searched: C:\)
_, package, paths = value.value.split(": ", 2)
package = package.split(" (", 1)[0]
paths = paths.rstrip(")").split(os.pathsep)
paths = paths.rstrip(")").split("; ") # Hard-coded pathsep in Rez

message = """
<h2><font color=\"red\">:(</font></h2>
Expand Down Expand Up @@ -444,7 +444,7 @@ def find(self, family, range_=None):

Arguments:
family (str): Name of package
range (str): Range, e.g. "1" or "==0.3.13"
range_ (str): Range, e.g. "1" or "==0.3.13"

"""

Expand Down Expand Up @@ -552,8 +552,9 @@ def reset(self, root=None, on_success=lambda: None):
with its corresponding Rez package.

Arguments:
root (str): Absolute path to profiles on disk, or callable
returning names of profiles
root (list, callable): A list of profile names, or a callable
returning names of profiles.
on_success (callable): Callback on reset completed.

"""

Expand Down Expand Up @@ -811,6 +812,10 @@ def list_profiles(self, root=None):
self.error("Could not find profiles in %s" % root)
profiles = []

else:
raise TypeError("Argument 'root' should be either list type or "
"callable.")

# Facilitate accidental empty family names, e.g. None or ''
profiles = list(filter(None, profiles))

Expand Down Expand Up @@ -941,7 +946,7 @@ def select_tool(self, tool_name):
def _package_paths(self):
"""Return all package paths, relative the current state of the world"""

paths = util.normpaths(*rez.config.packages_path)
paths = rez.config.packages_path[:]

# Optional development packages
if not self._state.retrieve("useDevelopmentPackages"):
Expand Down
2 changes: 2 additions & 0 deletions allzpark/dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ def append(self, line, level=logging.INFO):
logging.CRITICAL: "<font color=\"red\">",
}.get(level, "<font color=\"#222\">")

line = line.replace(" ", "&nbsp;")
line = line.replace("\n", "<br>")
line = "%s%s</font><br>" % (color, line)

cursor = self._widgets["text"].textCursor()
Expand Down