mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +00:00
Replace single quote with double quotes
This commit is contained in:
parent
2d18e7e5f0
commit
1d4e809015
|
@ -4,11 +4,11 @@ from src.util import command
|
|||
class Color:
|
||||
def get_256_color(color):
|
||||
"""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):
|
||||
"""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)
|
||||
BLUE = get_256_color(51)
|
||||
|
@ -17,5 +17,5 @@ class Color:
|
|||
GOLD = get_256_color(214)
|
||||
GREY = get_256_color(238)
|
||||
|
||||
RESET = get_special_color('sgr0')
|
||||
BOLD = get_special_color('bold')
|
||||
RESET = get_special_color("sgr0")
|
||||
BOLD = get_special_color("bold")
|
||||
|
|
|
@ -3,23 +3,23 @@ import subprocess
|
|||
|
||||
def execute(command) -> None:
|
||||
"""Execute bash `command`, return the returncode (int)"""
|
||||
command = command.split(' ')
|
||||
command = command.split(" ")
|
||||
subprocess.call(command)
|
||||
|
||||
|
||||
def get_output(command) -> str:
|
||||
"""Get standard output of `command`"""
|
||||
command = command.split(' ')
|
||||
command = command.split(" ")
|
||||
return subprocess.run(
|
||||
command,
|
||||
stderr=subprocess.STDOUT,
|
||||
stdout=subprocess.PIPE
|
||||
).stdout.decode('utf-8')
|
||||
).stdout.decode("utf-8")
|
||||
|
||||
|
||||
def get_return_code(command) -> int:
|
||||
"""get return code of `command` (int)"""
|
||||
command = command.split(' ')
|
||||
command = command.split(" ")
|
||||
return subprocess.run(
|
||||
command,
|
||||
stderr=subprocess.STDOUT,
|
||||
|
|
Loading…
Reference in a new issue