def match_service(sname): matches = [daemon for daemon in osxdaemons.get_all_daemons() if sname in daemon] if len(matches) > 1: print("Matched too many services:\n") for match in matches: print("> " + match + "\n") return None #print("Found service: " + matches[0] + "\n") return matches[0]
def print_services(): running_daemons = osxdaemons.get_running_daemons() for daemon in osxdaemons.get_all_daemons(): outs = daemon + " "*(60-len(daemon)) if daemon in running_daemons: col = COL_GRN status = "RUNNING" else: col = COL_RED status = "NOT RUNNING" print(outs + col + status + COL_END)