fancy printing
This commit is contained in:
+8
-2
@@ -2,10 +2,16 @@ from io import TextIOWrapper
|
||||
from praw import models
|
||||
import praw
|
||||
import os
|
||||
from macros import *
|
||||
|
||||
class Bot:
|
||||
password: str = os.environ["ASSISTANT_R_PASS"]
|
||||
secret: str = os.environ["ASSISTANT_R_TOKEN"]
|
||||
password: str = os.environ.get("ASSISTANT_R_PASS")
|
||||
secret: str = os.environ.get("ASSISTANT_R_TOKEN")
|
||||
|
||||
if password is None:
|
||||
py_error("Environment variable \"ASSISTANT_R_PASS\" is null!")
|
||||
if secret is None:
|
||||
py_error("Environment variable \"ASSISTANT_R_TOKEN\" is null!")
|
||||
|
||||
r: praw.Reddit = praw.Reddit(
|
||||
client_id = "iCSRWS6PMlTLwmylCJRYmA",
|
||||
|
||||
+16
-1
@@ -1,2 +1,17 @@
|
||||
from printColors import PrintColors
|
||||
|
||||
def py_print(*args: str):
|
||||
print("Py -", " ".join(args))
|
||||
print(
|
||||
PrintColors.FG.blue + "Py" + PrintColors.Special.reset,
|
||||
"-",
|
||||
" ".join(args)
|
||||
)
|
||||
|
||||
def py_error(*args: str):
|
||||
print(
|
||||
PrintColors.BG.red + "ERROR" + PrintColors.Special.reset,
|
||||
PrintColors.FG.blue + "Py" + PrintColors.Special.reset,
|
||||
"-",
|
||||
" ".join(args)
|
||||
)
|
||||
quit()
|
||||
@@ -0,0 +1,34 @@
|
||||
class PrintColors:
|
||||
class Special:
|
||||
reset = "\033[0m"
|
||||
bold = "\033[01m"
|
||||
disable = "\033[02m"
|
||||
underline = "\033[04m"
|
||||
reverse = "\033[07m"
|
||||
strikethrough = "\033[09m"
|
||||
invisible = "\033[08m"
|
||||
class FG:
|
||||
black = "\033[30m"
|
||||
red = "\033[31m"
|
||||
green = "\033[32m"
|
||||
orange = "\033[33m"
|
||||
blue = "\033[34m"
|
||||
purple = "\033[35m"
|
||||
cyan = "\033[36m"
|
||||
lightgrey = "\033[37m"
|
||||
darkgrey = "\033[90m"
|
||||
lightred = "\033[91m"
|
||||
lightgreen = "\033[92m"
|
||||
yellow = "\033[93m"
|
||||
lightblue = "\033[94m"
|
||||
pink = "\033[95m"
|
||||
lightcyan = "\033[96m"
|
||||
class BG:
|
||||
black = "\033[40m"
|
||||
red = "\033[41m"
|
||||
green = "\033[42m"
|
||||
orange = "\033[43m"
|
||||
blue = "\033[44m"
|
||||
purple = "\033[45m"
|
||||
cyan = "\033[46m"
|
||||
lightgrey = "\033[47m"
|
||||
Reference in New Issue
Block a user