Replace single quote with double quotes

This commit is contained in:
ItsDrike 2020-10-22 18:11:45 +02:00
parent 2d18e7e5f0
commit 1d4e809015
No known key found for this signature in database
GPG key ID: F4E8FF4F6AC7F3B4
2 changed files with 8 additions and 8 deletions

View file

@ -4,11 +4,11 @@ from src.util import command
class Color: class Color:
def get_256_color(color): def get_256_color(color):
"""Get color using tput (256-colors base)""" """Get color using tput (256-colors base)"""
return command.get_output(f'tput setaf {color}') return command.get_output(f"tput setaf {color}")
def get_special_color(index): def get_special_color(index):
"""Get special colors using tput (like bold, etc..)""" """Get special colors using tput (like bold, etc..)"""
return command.get_output(f'tput {index}') return command.get_output(f"tput {index}")
RED = get_256_color(196) RED = get_256_color(196)
BLUE = get_256_color(51) BLUE = get_256_color(51)
@ -17,5 +17,5 @@ class Color:
GOLD = get_256_color(214) GOLD = get_256_color(214)
GREY = get_256_color(238) GREY = get_256_color(238)
RESET = get_special_color('sgr0') RESET = get_special_color("sgr0")
BOLD = get_special_color('bold') BOLD = get_special_color("bold")

View file

@ -3,23 +3,23 @@ import subprocess
def execute(command) -> None: def execute(command) -> None:
"""Execute bash `command`, return the returncode (int)""" """Execute bash `command`, return the returncode (int)"""
command = command.split(' ') command = command.split(" ")
subprocess.call(command) subprocess.call(command)
def get_output(command) -> str: def get_output(command) -> str:
"""Get standard output of `command`""" """Get standard output of `command`"""
command = command.split(' ') command = command.split(" ")
return subprocess.run( return subprocess.run(
command, command,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE stdout=subprocess.PIPE
).stdout.decode('utf-8') ).stdout.decode("utf-8")
def get_return_code(command) -> int: def get_return_code(command) -> int:
"""get return code of `command` (int)""" """get return code of `command` (int)"""
command = command.split(' ') command = command.split(" ")
return subprocess.run( return subprocess.run(
command, command,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,