mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 05:44:23 +00:00
Add tariffs as optional feature
This commit is contained in:
@@ -12,17 +12,37 @@
|
||||
#
|
||||
# ────────────────────────────────────────────────────────────────────
|
||||
|
||||
import os
|
||||
# Load the config file
|
||||
import configparser
|
||||
import time
|
||||
config = configparser.ConfigParser()
|
||||
config.read("./config.ini")
|
||||
|
||||
|
||||
# Introducing tariffs to Python imports.
|
||||
# It was too funny of an idea to miss out on
|
||||
# You can enable or disable this in the config.
|
||||
# It is disabled by default
|
||||
if config["Tariffs"]["impose_tariffs"] == "True":
|
||||
try:
|
||||
import tariff
|
||||
|
||||
tariff.set({
|
||||
"kivy": int(config["Tariffs"]["kivy_rate"]),
|
||||
"serial": int(config["Tariffs"]["pyserial_rate"]),
|
||||
})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("You cannot evade the tariffs. I will impose impose a tariff of 1000000% on the launch of this app!")
|
||||
time.sleep(2000000)
|
||||
|
||||
import os
|
||||
from typing import override
|
||||
|
||||
from lib.com import Com, ComSuperClass
|
||||
import lib.test.com
|
||||
|
||||
|
||||
# Load the config file
|
||||
config = configparser.ConfigParser()
|
||||
config.read("./config.ini")
|
||||
|
||||
# Load config and disable kivy log if necessary
|
||||
if config["Dev"]["verbose"] == "True":
|
||||
|
||||
@@ -10,6 +10,11 @@ verbose = True
|
||||
log_level = DEBUG
|
||||
use_test_library = False
|
||||
|
||||
[Tariffs]
|
||||
impose_tariffs = False
|
||||
kivy_rate = 50
|
||||
pyserial_rate = 500
|
||||
|
||||
[Info]
|
||||
version = V2.3.0
|
||||
subversion =
|
||||
|
||||
Reference in New Issue
Block a user