[Uludag-commits] r16932 - trunk/comar/mudur/bin

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
2 Şub 2008 Cmt 15:06:27 EET


Author: bahadir.kandemir
Date: Sat Feb  2 15:06:27 2008
New Revision: 16932

Modified:
   trunk/comar/mudur/bin/network.py
Log:
BUG:COMMENT:6904

Show device name in connection list

Modified: trunk/comar/mudur/bin/network.py
=================================================================
--- trunk/comar/mudur/bin/network.py	(original)
+++ trunk/comar/mudur/bin/network.py	Sat Feb  2 15:06:27 2008
@@ -260,12 +260,14 @@
     profiles.sort(key=lambda x: x.devname + x.name)     #profiles are sorted by device_name + name
 
     name_title = "" # _("Profile")
+    dev_title = "" # _("Device")
     state_title = "" # _("Status")
     addr_title = "" # _("Address")
 
     #name_size and state_size are set  to the maximum length of name/state of profiles
     # -for ljust operations in output format-
     name_size = max(max(map(lambda x: len(x.name), profiles)), len(name_title))
+    device_size = max(max(map(lambda x: len(x.devname.rsplit("(")[-1][:-1]), profiles)), len(dev_title))
     state_size = max(max(map(lambda x: len(x.get_state()), profiles)), len(state_title))
 
     cstart = ""
@@ -278,10 +280,12 @@
         if len(link_profiles) > 0:
             print "%s:" % link.name
         for profile in link_profiles:
-            line = "  %s%s%s | %s%s%s | %s%s%s" % (
+            line = "  %s%s%s | %s%s%s | %s%s%s | %s%s%s" % (
                 cstart,
                 profile.name.ljust(name_size),
                 cend, cstart,
+                profile.devname.rsplit("(")[-1][:-1].ljust(device_size),
+                cend, cstart,
                 profile.get_state().center(state_size),
                 cend, cstart,
                 profile.get_address(),


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi