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:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,2 +0,0 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
|
||||||
* text=auto
|
|
||||||
@@ -12,17 +12,37 @@
|
|||||||
#
|
#
|
||||||
# ────────────────────────────────────────────────────────────────────
|
# ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
import os
|
# Load the config file
|
||||||
import configparser
|
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 typing import override
|
||||||
|
|
||||||
from lib.com import Com, ComSuperClass
|
from lib.com import Com, ComSuperClass
|
||||||
import lib.test.com
|
import lib.test.com
|
||||||
|
|
||||||
|
|
||||||
# Load the config file
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
config.read("./config.ini")
|
|
||||||
|
|
||||||
# Load config and disable kivy log if necessary
|
# Load config and disable kivy log if necessary
|
||||||
if config["Dev"]["verbose"] == "True":
|
if config["Dev"]["verbose"] == "True":
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ verbose = True
|
|||||||
log_level = DEBUG
|
log_level = DEBUG
|
||||||
use_test_library = False
|
use_test_library = False
|
||||||
|
|
||||||
|
[Tariffs]
|
||||||
|
impose_tariffs = False
|
||||||
|
kivy_rate = 50
|
||||||
|
pyserial_rate = 500
|
||||||
|
|
||||||
[Info]
|
[Info]
|
||||||
version = V2.3.0
|
version = V2.3.0
|
||||||
subversion =
|
subversion =
|
||||||
|
|||||||
Reference in New Issue
Block a user