def clear_drivers_list(self): for driver in os.listdir(get_resource_path('hw_drivers', 'drivers')): if driver != '__pycache__': helpers.unlink_file( get_resource_path('hw_drivers', 'drivers', driver)) return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip( ) + ":8069/list_drivers'>"
def clear_credential(self): subprocess.check_call(["sudo", "mount", "-o", "remount,rw", "/"]) helpers.unlink_file('odoo-db-uuid.conf') helpers.unlink_file('odoo-enterprise-code.conf') subprocess.check_call(["sudo", "service", "odoo", "restart"]) subprocess.check_call(["sudo", "mount", "-o", "remount,ro", "/"]) return "<meta http-equiv='refresh' content='20; url=http://" + helpers.get_ip( ) + ":8069'>"
def clear_handlers_list(self): for directory in ['drivers', 'interfaces']: for file in os.listdir( get_resource_path('hw_drivers', 'iot_handlers', directory)): if file != '__pycache__': helpers.unlink_file( get_resource_path('hw_drivers', 'iot_handlers', directory, file)) return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip( ) + ":8069/list_handlers'>"
def clear_six_payment_terminal(self): helpers.unlink_file('odoo-six-payment-terminal.conf') subprocess.check_call(["sudo", "service", "odoo", "restart"]) return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip() + ":8069'>"
def clear_server_configuration(self): helpers.unlink_file('odoo-remote-server.conf') return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip() + ":8069'>"
def clear_wifi_configuration(self): helpers.unlink_file('wifi_network.txt') return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip() + ":8069'>"