Skip to content
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

Linting #580

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,18 +930,18 @@ def qwinsta(self):
return
self.enumerate_sessions_info(sessions)

maxSessionNameLen = max([len(sessions[i]["SessionName"])+1 for i in sessions])
maxSessionNameLen = maxSessionNameLen if len("SESSIONNAME") < maxSessionNameLen else len("SESSIONNAME")+1
maxUsernameLen = max([len(sessions[i]["Username"]+sessions[i]["Domain"])+1 for i in sessions])+1
maxUsernameLen = maxUsernameLen if len("Username") < maxUsernameLen else len("Username")+1
maxSessionNameLen = max([len(sessions[i]["SessionName"]) + 1 for i in sessions])
maxSessionNameLen = maxSessionNameLen if len("SESSIONNAME") < maxSessionNameLen else len("SESSIONNAME") + 1
maxUsernameLen = max([len(sessions[i]["Username"] + sessions[i]["Domain"]) + 1 for i in sessions]) + 1
maxUsernameLen = maxUsernameLen if len("Username") < maxUsernameLen else len("Username") + 1
maxIdLen = max([len(str(i)) for i in sessions])
maxIdLen = maxIdLen if len("ID") < maxIdLen else len("ID")+1
maxStateLen = max([len(sessions[i]["state"])+1 for i in sessions])
maxStateLen = maxStateLen if len("STATE") < maxStateLen else len("STATE")+1
maxRemoteIp = max([len(sessions[i]["RemoteIp"])+1 for i in sessions])
maxRemoteIp = maxRemoteIp if len("RemoteAddress") < maxRemoteIp else len("RemoteAddress")+1
maxClientName = max([len(sessions[i]["ClientName"])+1 for i in sessions])
maxClientName = maxClientName if len("ClientName") < maxClientName else len("ClientName")+1
maxIdLen = maxIdLen if len("ID") < maxIdLen else len("ID") + 1
maxStateLen = max([len(sessions[i]["state"]) + 1 for i in sessions])
maxStateLen = maxStateLen if len("STATE") < maxStateLen else len("STATE") + 1
maxRemoteIp = max([len(sessions[i]["RemoteIp"]) + 1 for i in sessions])
maxRemoteIp = maxRemoteIp if len("RemoteAddress") < maxRemoteIp else len("RemoteAddress") + 1
maxClientName = max([len(sessions[i]["ClientName"]) + 1 for i in sessions])
maxClientName = maxClientName if len("ClientName") < maxClientName else len("ClientName") + 1
template = ("{SESSIONNAME: <%d} "
"{USERNAME: <%d} "
"{ID: <%d} "
Expand Down Expand Up @@ -1022,7 +1022,7 @@ def tasklist(self):
procInfo["UniqueProcessId"],
procInfo["SessionId"],
procInfo["pSid"],
"{:,} K".format(procInfo["WorkingSetSize"]//1000),
"{:,} K".format(procInfo["WorkingSetSize"] // 1000),
)
self.logger.highlight(row)

Expand Down
Loading