Merge lp:~costales/gui-ufw/redone-list-interfaces into lp:gui-ufw

Proposed by costales
Status: Merged
Approved by: costales
Approved revision: 7
Merged at revision: 7
Proposed branch: lp:~costales/gui-ufw/redone-list-interfaces
Merge into: lp:gui-ufw
Diff against target: 36 lines (+4/-6)
2 files modified
gufw/gufw/model/ufw_backend.py (+3/-5)
po/gufw.pot (+1/-1)
To merge this branch: bzr merge lp:~costales/gui-ufw/redone-list-interfaces
Reviewer Review Type Date Requested Status
costales Pending
Review via email: mp+323454@code.launchpad.net

Description of the change

Redone list interfaces, because sometimes it doesn't show all

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gufw/gufw/model/ufw_backend.py'
--- gufw/gufw/model/ufw_backend.py 2016-11-08 19:33:57 +0000
+++ gufw/gufw/model/ufw_backend.py 2017-05-01 09:37:36 +0000
@@ -458,16 +458,14 @@
458 return result # cmd | ufw result458 return result # cmd | ufw result
459 459
460 def get_net_interfaces(self):460 def get_net_interfaces(self):
461 cmd_ifaces = ['netstat', '-i']461 cmd_ifaces = ['ls', '/sys/class/net']
462 cmd = self._run_cmd(cmd_ifaces)462 cmd = self._run_cmd(cmd_ifaces)
463 ifaces = cmd.split('\n')463 ifaces = cmd.split('\n')
464 464
465 index = 0
466 result = []465 result = []
467 for iface in ifaces:466 for iface in ifaces:
468 index = index + 1467 if iface:
469 if index > 2 and iface:468 result.append(iface)
470 result.append(iface.split(' ')[0])
471 469
472 return result470 return result
473 471
474472
=== modified file 'po/gufw.pot'
--- po/gufw.pot 2017-05-01 09:11:43 +0000
+++ po/gufw.pot 2017-05-01 09:37:36 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2017-05-01 11:10+0200\n"11"POT-Creation-Date: 2017-05-01 11:35+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"

Subscribers

People subscribed via source and target branches

to all changes: