-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.py
73 lines (65 loc) · 1.94 KB
/
startup.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from os import startfile
from time import sleep
from pyautogui import typewrite, press, hotkey, FAILSAFE
from folder_contents import open_folder, open_file2
from logger import Logger
from emails import emails
FAILSAFE = False
class Startup(object):
'''
When class is initiated the desktop is prepared for the user. QuickBooks, Outlook, and other stuff runs.
'''
def __init__(self, password=None):
'''
Container function. Holders all the other startup functions.
'''
self.set_password(password)
self.quickbooks()
self.gmail()
self.outlook()
self.files_and_folders()
logger_message = 'startup initiated'
Logger('test',logger_message)
def set_password(self, password):
if password:
self.password = password
else:
self.password = raw_input('QuickBooks Password: ')
@staticmethod
def excel():
'''
Starts Microsoft Excel.
'''
startfile('C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE')
def quickbooks(self):
'''
Starts QuickBooks. Logs in.
'''
startfile('"C:\Program Files (x86)\Intuit\QuickBooks Enterprise Solutions 16.0\QBW32Enterprise.exe"')
sleep(30)
typewrite(self.password)
press('enter')
sleep(5)
def outlook(self):
'''
Starts Outlook.
'''
startfile('C:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE')
sleep(5)
def files_and_folders(self):
'''
Opens specified files and folders.
'''
open_folder('h')
open_file2('jobs')
def gmail(self):
'''
Starts Firefox. Navigates to Gmail.
'''
startfile(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
sleep(5)
hotkey('ctrl','l')
sleep(2)
typewrite('www.gmail.com')
press('enter')
sleep(2)