Monitor Creation

This commit is contained in:
Lukas 2020-10-30 00:21:51 +01:00
parent a33e9c3a88
commit d918d874f4
3 changed files with 23 additions and 5 deletions

12
main.py
View File

@ -1,19 +1,21 @@
import src.monitor as monitor
import src.tools as tools
from colorama import Style, Fore, Back, init
from colorama import Style, Fore, init
if __name__ == "__main__":
spacer = "==========================================================================="
url = "https://www.nike.com/de/launch?s=upcoming"
num_monitors = 10
init(autoreset=True)
print(f"Creating {num_monitors} new Monitors...\n{spacer}")
tools.clear()
print(f"Creating {num_monitors} new Monitors...\n{tools.spacer}")
for i in range(0, num_monitors):
mon = monitor.Monitor()
mon.name = f"Monitor {i}"
mon.url = url
print(f"{Fore.MAGENTA}{mon.name}")
print(spacer)
print(f"{Fore.MAGENTA}{mon.name}{Style.RESET_ALL} |"
f" {tools.keyword('URL')}({mon.url}) {tools.keyword('PROXY')}({mon.proxy})")
print(tools.spacer)

View File

@ -3,3 +3,4 @@ class Monitor:
def __init__(self):
self.url = None
self.name = None
self.proxy = None

15
src/tools.py Normal file
View File

@ -0,0 +1,15 @@
import os
from colorama import Style, Fore, init
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
def keyword(kwd):
kwd = f"{Fore.RED}{kwd}{Style.RESET_ALL}"
return kwd
init()
spacer = "===================================================================================================="