mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 18:21:15 +00:00
Added auto startup and poweroff scripts.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user