diff --git a/jdownie/logo/beaker.png b/jdownie/logo/beakerErlenmeyer.png similarity index 100% rename from jdownie/logo/beaker.png rename to jdownie/logo/beakerErlenmeyer.png diff --git a/jdownie/logo/beakerSquare.png b/jdownie/logo/beakerSquare.png new file mode 100644 index 0000000..c0201b6 Binary files /dev/null and b/jdownie/logo/beakerSquare.png differ diff --git a/jdownie/logo/bridge.png b/jdownie/logo/bridgeStorey.png similarity index 100% rename from jdownie/logo/bridge.png rename to jdownie/logo/bridgeStorey.png diff --git a/jdownie/repo/repo b/jdownie/repo/repo index 7e38d0b..9d4e0a0 100755 --- a/jdownie/repo/repo +++ b/jdownie/repo/repo @@ -43,7 +43,7 @@ def to_keycap(ch: str) -> str: def indicators(props, ind = "tl"): tl = "\U0001F7E2" - if props["ab"]["push"] + props["ab"]["pull"] > 0: + if "ab" in props.keys() and ( props["ab"]["push"] + props["ab"]["pull"] > 0 ): tl = "\U0001F7E1" if props["n"] > 0: tl = "\U0001F534" @@ -52,10 +52,15 @@ def indicators(props, ind = "tl"): down_keycap = "\U0001F53D" # "\u2B07\uFE0F" status_digit = "#" if props["n"] > 9 else str(props["n"] % 10) status_indicator = f"{to_keycap(status_digit)}{unstaged}" - push_digit = "#" if props["ab"]["push"] > 9 else str(props["ab"]["push"] % 10) - push_indicator = f"{to_keycap(push_digit)}{up_keycap}" - pull_digit = "#" if props["ab"]["pull"] > 9 else str(props["ab"]["pull"] % 10) - pull_indicator = f"{to_keycap(pull_digit)}{down_keycap}" + push_digit = "?" + push_indicator = f" {up_keycap}" + pull_digit = "?" + pull_indicator = f" {down_keycap}" + if "ab" in props.keys(): + push_digit = "#" if props["ab"]["push"] > 9 else str(props["ab"]["push"] % 10) + push_indicator = f"{to_keycap(push_digit)}{up_keycap}" + pull_digit = "#" if props["ab"]["pull"] > 9 else str(props["ab"]["pull"] % 10) + pull_indicator = f"{to_keycap(pull_digit)}{down_keycap}" ret = "?" if ind == "tl": ret = f"{tl}" @@ -156,7 +161,7 @@ def perform_action(action, key, item, silent = False): elif action == "lc": if isFossil(item): cwd = Path(os.path.expanduser(item["path"])) - cmd = f"fossil add ." + cmd = f"fossil addremove ." output = execute_command(cmd, cwd=cwd) cmd = f"fossil commit -m \"Lazy commit on {hn}\"" output = execute_command(cmd, cwd=cwd) @@ -208,20 +213,20 @@ if __name__ == "__main__": path = os.path.expanduser( cfg[k]["path"] ) if os.path.exists( path ): n = 0 + props = dict() + props["key"] = k if isFossil(cfg[k]): cwd = os.path.expanduser(cfg[k]["path"]) cmd = "fossil json status" - output = json.loads(execute_command(cmd)) + output = json.loads(execute_command(cmd, cwd=cwd)) n = len(output["payload"]["files"]) cmd = "fossil extras" - lines = execute_command(cmd).split("\n") + lines = execute_command(cmd, cwd=cwd).split("\n") for line in lines: if len(line.strip()) > 0: n = n + 1 else: cmd = "git -C \"{0}\" status --porcelain=2 --branch".format( path ) - props = dict() - props["key"] = k lines = execute_command(cmd).split("\n") for line in lines: m = re.match(r"# branch\.(\S+)\s+(.+)$", line)