-
Notifications
You must be signed in to change notification settings - Fork 0
/
get.py
51 lines (46 loc) · 1.84 KB
/
get.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""A script used to retrieve important, but user dependent things"""
import sys
import os
def serialport():
"""Finds the serialport depending on what system you're running on"""
if os.name == 'posix':
if sys.platform == 'linux2' or sys.platform == 'linux': # for linux, may need to change ending number
# platform = 'lin'
port = '/dev/ttyUSB0'
elif sys.platform == 'darwin': # it is possible that the serial number is different, "ls /dev" in a terminal to find out
# platform = 'mac'
port = '/dev/tty.usbserial-PX9HMPBU'
elif os.name == 'nt':
# platform = 'win'
port = ''
else:
port = ''
return port
def googledrive():
"""locates where your google drive is depending on who you are currently generalized for mac users."""
"""For compatiblity, you must rename "Google Drive" folder to "Google_Drive" which will raise an error for
google drive, which is easily fixed by relocating the folder for it"""
import getpass
user = getpass.getuser()
if sys.platform == 'darwin': # for mac users
path = '/Users/%s/Google_Drive/' % (user)
# elif (user == 'etortorici' or user == 'root') and sys.platform == 'linux2': # legacy for linux
# # path = '/home/etortorici/Google_Drive/'
# path = '/home/etortorici/Documents/'
elif sys.platform == 'linux':
if user == 'etortoric':
path = '/home/etortoric/Documents/Google_Drive'
else:
path = ''
else:
#if user == 'Chuck':
if os.name == 'nt':
if user == 'etcto':
path = 'G:\\My Drive'
# elif user == 'Chuck':
else:
path = 'C:\\Users\\%s\\Google Drive' % user
else:
path = ''
# print(f'\n\n\n{path}\n\n\n')
return path