<div dir="ltr"><div>hello, check this code (put it into Eric new file and save)</div><div>while it works well with 4-line function <span style="background-color:transparent">myFunction (both variables a and msg are marked as unused), it fails for more complex </span><span style="background-color:transparent">_operationByMAC (only a is marked as unused and msg is not)</span></div><div><span style="background-color:transparent"><br></span></div>def myFunction(operation = 'lock', macAddress = 'A0:B0:C0:D0:E0:F0'):<br> a = 4<br> msg = f'operation {operation} with macAddress={macAddress} is finished'<br> #print(msg)<br> return r<br><br>import paramiko<br><br>class EmptyClass:<br> pass<br> <br>def _operationByMAC(macAddress=None, operation=None, routerIP = None, userName = None, password = None):<br> assert operation in ('unblock', 'block', 'get_state')<br> r = EmptyClass()<br> ssh = paramiko.SSHClient()<br> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())<br> r.ssh = ssh<br> <br> ssh.connect(routerIP, username=userName, password=password)<br> command = f'ip firewall filter print where src-mac-address="{macAddress}"'<br> stdin, stdout, stderr = ssh.exec_command(command)<br> <br> result = stdout.read().decode()<br> lines = result.split('\n')<br> RuleLine = None<br> for line in lines:<br> if 'src-mac-address='+macAddress in line:<br> RuleLine = line<br> break<br> if RuleLine is None:<br> match operation:<br> case 'get_state':<br> r.state = 'unblocked'<br> print(f'{macAddress} is unblocked')<br> return r<br> case 'block':<br> pass<br> case 'unblock':<br> msg = 'Error: this MAC was not found in firewall rules'<br> print(msg)<br> r.msg = msg<br> r.state = 'unblocked'<br> return r<br><br> a = 3<br> msg = f'operation {operation} with macAddress={macAddress} is finished'<br> #print(msg)<br> return r<div>Regards, Dmitrey</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, 21 Jun 2026 at 16:12, Detlev Offenbach <<a href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p><font size="2">Hello Dmitrey,</font></p>
<p><font size="2">I just tried your code over here and have to
admit, that everything works as expected. The 'msg' variable is
flagged as unused and an associated message is shown (see
attached screenshot). Are you sure, that the Syntax Checker
Plugin is active? You may check this via the Plugin Infos
dialog. If it is not, just open the context menu in there and
selecte 'Activate'. If that does not work, check for an error in
the associated plugin details.</font></p>
<p><font size="2">Regards,<br>
Detlev</font></p>
<div>Am 21.06.26 um 10:16 schrieb Dmitrey
Kroshko:<br>
</div>
<blockquote type="cite">
<div>def myFunc(...):</div>
<div> ....</div>
<div> msg = f'operation {operation} with
macAddress={macAddress} is finished'<br>
#print(msg)<br>
return r</div>
</blockquote>
<pre cols="72">--
Detlev Offenbach
<a href="mailto:detlev@die-offenbachs.de" target="_blank">detlev@die-offenbachs.de</a></pre>
</div>
</blockquote></div>