Skip to content

Commit

Permalink
- Add color to connected printer prompt: Green = OK, Red = Extruder d…
Browse files Browse the repository at this point in the history
…isabled
  • Loading branch information
kjcole committed Jun 27, 2017
1 parent df53be8 commit 717529e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions printrun/pronsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def __init__(self):
self.silent = False
self.commandprefixes = 'MGT$'
self.promptstrs = {"offline": "%(bold)soffline>%(normal)s ",
"fallback": "%(bold)s%(port)s PC>%(normal)s ",
"fallback": "%(bold)s%(red)s%(port)s%(white)s PC>%(normal)s ",
"macro": "%(bold)s..>%(normal)s ",
"online": "%(bold)s%(port)s T:%(extruder_temp_fancy)s%(progress_fancy)s>%(normal)s "}
"online": "%(bold)s%(green)s%(port)s%(white)s T:%(extruder_temp_fancy)s%(progress_fancy)s>%(normal)s "}

# --------------------------------------------------------------
# General console handling
Expand Down Expand Up @@ -295,6 +295,9 @@ def promptf(self):
specials["progress_fancy"] = " " + str(progress) + "%"
else:
specials["progress_fancy"] = ""
specials["red"] = "\033[31m"
specials["green"] = "\033[32m"
specials["white"] = "\033[37m"
specials["bold"] = "\033[01m"
specials["normal"] = "\033[00m"
return promptstr % specials
Expand Down

0 comments on commit 717529e

Please sign in to comment.