mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 11:20:15 +01:00
eject usb setting
This commit is contained in:
@@ -973,6 +973,11 @@ class Actions(object):
|
|||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
|
def eject_all_usb_drives(self):
|
||||||
|
for i in range(1, 4):
|
||||||
|
if os.path.exists('/dev/sda{}'.format(i)):
|
||||||
|
subprocess.call(['sudo', 'eject', '/dev/sda{}'.format(i)])
|
||||||
|
|
||||||
# TODO: make this interrogate the various components for available routes to parse
|
# TODO: make this interrogate the various components for available routes to parse
|
||||||
# this would include eg a custom script module..
|
# this would include eg a custom script module..
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -82,8 +82,11 @@ class Data(object):
|
|||||||
|
|
||||||
|
|
||||||
def get_ip_address(self):
|
def get_ip_address(self):
|
||||||
ip = subprocess.check_output(['hostname', '-I']).decode('utf-8').split()[0]
|
ip_list = subprocess.check_output(['hostname', '-I']).decode('utf-8').split()
|
||||||
return ip
|
if len(ip_list) > 0:
|
||||||
|
return ip_list[0]
|
||||||
|
else:
|
||||||
|
return 'none'
|
||||||
|
|
||||||
def get_ip_for_osc_client(self):
|
def get_ip_for_osc_client(self):
|
||||||
if self.settings['user_input']['REMOTE_SERVER']['value'] == 'enabled':
|
if self.settings['user_input']['REMOTE_SERVER']['value'] == 'enabled':
|
||||||
|
|||||||
@@ -183,6 +183,11 @@
|
|||||||
"action": "shutdown_pi",
|
"action": "shutdown_pi",
|
||||||
"options": [],
|
"options": [],
|
||||||
"value": null
|
"value": null
|
||||||
|
},
|
||||||
|
"EJECT_USB_DRIVES": {
|
||||||
|
"action": "eject_all_usb_drives",
|
||||||
|
"options": [],
|
||||||
|
"value": null
|
||||||
},
|
},
|
||||||
"RESTART_OPENFRAMEWORKS": {
|
"RESTART_OPENFRAMEWORKS": {
|
||||||
"action": "restart_openframeworks",
|
"action": "restart_openframeworks",
|
||||||
|
|||||||
Reference in New Issue
Block a user