23 lines
631 B
Python
23 lines
631 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:
|
|
case "pc" | "PC" | "Pc":
|
|
self.driver = self.pc_driver
|
|
|
|
case "mobile" | "Mobile":
|
|
self.driver = self.mobile_driver
|
|
|
|
case _:
|
|
raise ValueError("The driver must be either pc or mobile")
|