Commit 8d1d6d03 authored by Alberto Vicente's avatar Alberto Vicente
Browse files

delete unused code

parent 5a144ad5
......@@ -73,7 +73,6 @@ class UtilPath:
else:
return base_folder + "/data"
def get_po_path(self):
if getattr(sys, 'frozen', False):
base_folder = sys._MEIPASS
......@@ -124,14 +123,12 @@ class UtilPath:
downloaded = True
return downloaded
def download_udev_rules(self):
url = "https://gitlab.com/OdinTdh/pyLinuxWheel/raw/" + self.branch + "/data/rules/" + self.rules_file
return self.download_file(url, os.path.join(util_path.get_config_path(), self.rules_file))
def copy_logitech_rules(self):
if self.download_udev_rules():
#command = "wget -O "+ os.path.join('/', 'etc', 'udev', 'rules.d/')+self.rules_file+" https://gitlab.com/OdinTdh/pyLinuxWheel/raw/"+self.branch+"/data/rules/"+self.rules_file + " && udevadm control --reload-rules && udevadm trigger"
command = "cp -f "+ os.path.join(util_path.get_config_path(), self.rules_file) + " " + os.path.join('/', 'etc', 'udev','rules.d/') + self.rules_file + " && udevadm control --reload-rules && udevadm trigger"
logger.info(command)
result = subprocess.run(["pkexec", "/bin/bash", "-c", command])
......@@ -141,7 +138,6 @@ class UtilPath:
return 1
class PreferencesService:
def write_preferences(self,preferences_data):
......@@ -175,9 +171,9 @@ class PreferencesService:
except FileNotFoundError as fileError:
logger.error(fileError)
def import_profile(self,source_path):
def import_profile(self, source_path):
util_path = UtilPath()
data=None
data = None
profile_name=None
with open(source_path) as json_data:
data = json.load(json_data)
......@@ -212,7 +208,7 @@ class PreferencesService:
return os.path.exists(os.path.join(util_path.get_profiles_path(), name + '.json'))
class EvdevWheelService():
class EvdevWheelService:
logitech_model_dict = {'C202': {"description": "Logitech WingMan Formula (Yellow) (USB)", "max_degrees": 180,
"min_degrees": 40,
......@@ -350,7 +346,6 @@ class EvdevWheelService():
else:
return None
def supported_features(self):
if self.logitech_model_dict.get(self.get_wheel_model()) is not None:
return self.logitech_model_dict.get(self.get_wheel_model()).get("supported_features")
......@@ -554,7 +549,6 @@ class EvdevWheelService():
time.sleep(4)
input_device.erase_effect(effect_id)
def get_gain(self):
if self.supported_features()["ff_gain"]:
if self._gain is not None:
......@@ -573,7 +567,6 @@ class EvdevWheelService():
logger.info("get_gain is not supported")
return 100
def get_autocenter(self):
if self.supported_features()["ff_autocenter"]:
if self._autocenter is not None:
......@@ -592,7 +585,6 @@ class EvdevWheelService():
logger.info("get_autocenter is not supported")
return 0
def synchronize_from_driver_to_profile(self, profile_name="default"):
logger.info("synchronize_from_driver_to_profile")
if self.supported_wheel():
......@@ -640,16 +632,6 @@ class EvdevWheelService():
if profile.get('ff_autocenter') is not None:
self.write_autocenter(profile['ff_autocenter'])
def _get_wheel_vendor(self):
if self.supported_wheel():
info = self.get_device().info
value = str(hex(info.vendor)).replace('0x', '', 1)
value = str(hex(info.vendor)).replace('0x', '', 1)
return value.upper()
else:
return None
def _write_to_driver(self, parameter, value):
try:
with open(os.path.join(self.driver_path, parameter), 'w') as property:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment