mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
ui: dialogs: stats: optimize string format
This commit does not change behaviour but reduces the multitude text
arguments of format() down to one.
Ref: c5e24c04f1
("ui,netstat: allow to filter listed connections")
This commit is contained in:
parent
4a37c88db6
commit
4ea11a1ca7
1 changed files with 12 additions and 14 deletions
|
@ -2473,20 +2473,18 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
|
||||||
return " WHERE what LIKE '%{0}%' ".format(text)
|
return " WHERE what LIKE '%{0}%' ".format(text)
|
||||||
elif idx == StatsDialog.TAB_NETSTAT:
|
elif idx == StatsDialog.TAB_NETSTAT:
|
||||||
return " WHERE proc_comm LIKE '%{0}%' OR" \
|
return " WHERE proc_comm LIKE '%{0}%' OR" \
|
||||||
" proc_path LIKE '%{1}%' OR" \
|
" proc_path LIKE '%{0}%' OR" \
|
||||||
" state LIKE '%{2}%' OR" \
|
" state LIKE '%{0}%' OR" \
|
||||||
" src_port LIKE '%{3}%' OR" \
|
" src_port LIKE '%{0}%' OR" \
|
||||||
" src_ip LIKE '%{4}%' OR" \
|
" src_ip LIKE '%{0}%' OR" \
|
||||||
" dst_ip LIKE '%{5}%' OR" \
|
" dst_ip LIKE '%{0}%' OR" \
|
||||||
" dst_port LIKE '%{6}%' OR" \
|
" dst_port LIKE '%{0}%' OR" \
|
||||||
" proto LIKE '%{7}%' OR" \
|
" proto LIKE '%{0}%' OR" \
|
||||||
" uid LIKE '%{8}%' OR" \
|
" uid LIKE '%{0}%' OR" \
|
||||||
" proc_pid LIKE '%{9}%' OR" \
|
" proc_pid LIKE '%{0}%' OR" \
|
||||||
" family LIKE '%{10}%' OR" \
|
" family LIKE '%{0}%' OR" \
|
||||||
" iface LIKE '%{11}%' OR" \
|
" iface LIKE '%{0}%' OR" \
|
||||||
" inode LIKE '%{12}%'".format(
|
" inode LIKE '%{0}%'".format(text)
|
||||||
text, text, text, text, text, text, text, text, text, text, text, text, text
|
|
||||||
)
|
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue