forked from piair/MsRewards-Reborn
augustin64
db6fa9b6b0
- NO_SUBPROCESS to fake subprocesses calls - APP_ROOT to use the app outside of Docker
26 lines
712 B
Python
26 lines
712 B
Python
class Driver:
|
|
def __init__(self):
|
|
self.pc_driver = None
|
|
self.mobile_driver = None
|
|
self.driver = None
|
|
|
|
def set_pc_driver(self, pc_driver):
|
|
self.pc_driver = pc_driver
|
|
|
|
def set_mobile_driver(self, mobile_driver):
|
|
self.mobile_driver = mobile_driver
|
|
|
|
def switch_to_driver(self, driver: str):
|
|
match driver.lower():
|
|
case "pc":
|
|
self.driver = self.pc_driver
|
|
|
|
case "mobile":
|
|
self.driver = self.mobile_driver
|
|
|
|
case _:
|
|
raise ValueError("The driver must be either pc or mobile")
|
|
|
|
def current_driver(self):
|
|
return "PC" if self.pc_driver == self.driver else "Mobile"
|