added logger and set up settings screen

This commit is contained in:
janis
2022-05-16 17:01:13 +02:00
parent 43341fcc87
commit 355b368b31
6 changed files with 76 additions and 6 deletions

View File

@@ -0,0 +1,27 @@
import bin.lib.csv_parsers
cvr = bin.lib.csv_parsers.CsvRead()
class OSAssigner:
def __init__(self):
self.__budget = 0
self.__import = []
self.__extracted = ""
self.__price = []
def os_chooser(self, budget, os_choice, os_price_file, availability=False):
self.__budget = budget
self.__import = cvr.importing(os_price_file)
for self.item in self.__import:
self.__price.append(self.item.pop(1))
if os_choice == "Windows 10 Home" or "Windows 11 Home" and availability is False:
self.__budget -= self.__price.pop(0)
elif os_choice == "Windows 10 Pro" or "Windows 11 Pro" and availability is False:
self.__budget -= self.__price.pop(1)
else:
pass
return self.__budget

View File

@@ -2,6 +2,8 @@
This module configures PCs but relies heavily on external modules that are included with the package.
"""
import bin.lib.csv_parsers
import bin.config.os
import bin.config.case
cvr = bin.lib.csv_parsers.CsvRead()
@@ -11,6 +13,11 @@ cvw = bin.lib.csv_parsers.CsvWrite()
class ConfigCreator:
def __init__(self):
self.__info_import = []
self.__budget = 0
self.__os_choice = ""
self.__os_path = ""
def start_config(self, path):
self.__info_import = cvr.importing(path)
self.__budget = bin.config.os.OSAssigner().os_chooser(self.__budget, self.__os_choice, self.__os_path)
self.__budget = bin.config.case