Added auto startup and poweroff scripts.

This commit is contained in:
2018-03-03 17:21:38 -08:00
parent a7297d50cf
commit ce10e9e802
3 changed files with 105 additions and 2 deletions

View File

@@ -4,8 +4,9 @@
#####################################
# Python native imports
from time import time, sleep
from os.path import exists
from os import system
from os.path import exists, dirname, realpath
from os import system, chdir
import sys
#####################################
# Global Variables
@@ -15,12 +16,22 @@ UDEV_RULES_PATHS = ["../UDEV_rules/99-rover-usb-serial.rules", "../UDEV_rules/99
SHUTDOWN_TIMEOUT = 5
#####################################
# get_script_path Definition
#####################################
def get_script_path():
return dirname(realpath(sys.argv[0]))
#####################################
# udev_parser Definition
#####################################
def udev_parser(rules_paths):
device_paths = {}
script_path = get_script_path()
chdir(script_path)
for current_file in rules_paths:
lines = open(current_file).readlines()