dect
/
libnl
Archived
13
0
Fork 0

Fix whitespaces at EOL

Make git happy with that
This commit is contained in:
Коренберг Марк (ноутбук дома) 2012-06-04 22:55:49 +06:00
parent 4be1ae2ae2
commit b369d22f92
7 changed files with 27 additions and 27 deletions

View File

@ -43,13 +43,13 @@ NETLINK_ROUTE = 0
# NETLINK_UNUSED = 1
NETLINK_USERSOCK = 2
NETLINK_FIREWALL = 3
NETLINK_INET_DIAG = 4
NETLINK_INET_DIAG = 4
NETLINK_NFLOG = 5
NETLINK_XFRM = 6
NETLINK_SELINUX = 7
NETLINK_ISCSI = 8
NETLINK_AUDIT = 9
NETLINK_FIB_LOOKUP = 10
NETLINK_FIB_LOOKUP = 10
NETLINK_CONNECTOR = 11
NETLINK_NETFILTER = 12
NETLINK_IP6_FW = 13
@ -588,7 +588,7 @@ class CacheManager(object):
if self._mngr:
capi.nl_cache_mngr_free(self._mngr)
def add(self, name):
capi.cache_mngr_add(self._mngr, name, None, None)

View File

@ -374,12 +374,12 @@ class Address(netlink.Object):
if not nodev:
buf += fmt.format(' {a|ifindex}')
buf += fmt.format(' {a|scope}')
if self.label:
buf += fmt.format(' "{a|label}"')
buf += fmt.format(' <{a|_flags}>')
if details:

View File

@ -66,9 +66,9 @@ RX_FIFO_ERR = 10
TX_FIFO_ERR = 11
RX_LEN_ERR = 12
RX_OVER_ERR = 13
RX_CRC_ERR = 14
RX_CRC_ERR = 14
RX_FRAME_ERR = 15
RX_MISSED_ERR = 16
RX_MISSED_ERR = 16
TX_ABORT_ERR = 17
TX_CARRIER_ERR = 18
TX_HBEAT_ERR = 19
@ -495,7 +495,7 @@ class Link(netlink.Object):
buf += fmt.nl('\t{t|mtu} {t|txqlen} {t|weight} '\
'{t|qdisc} {t|operstate}')
buf += fmt.nl('\t{t|broadcast} {t|alias}')
buf += self._foreach_af('details', fmt)
if stats:

View File

@ -19,7 +19,7 @@ class DummyLink(object):
def brief(self):
return 'dummy'
def init(link):
link.dummy = DummyLink(link._rtnl_link)
return link.dummy

View File

@ -66,7 +66,7 @@ class InetLink(object):
def get_conf(self, id):
return capi.inet_get_conf(self._link._rtnl_link, _resolve(id))
def set_conf(self, id, value):
return capi.rtnl_link_inet_set_conf(self._link._rtnl_link,
_resolve(id), int(value))
@ -75,7 +75,7 @@ class InetLink(object):
@property
def forwarding(self):
return bool(self.get_conf(DEVCONF_FORWARDING))
@forwarding.setter
def forwarding(self, value):
self.set_conf(DEVCONF_FORWARDING, int(value))
@ -84,7 +84,7 @@ class InetLink(object):
@property
def mc_forwarding(self):
return bool(self.get_conf(DEVCONF_MC_FORWARDING))
@mc_forwarding.setter
def mc_forwarding(self, value):
self.set_conf(DEVCONF_MC_FORWARDING, int(value))
@ -93,7 +93,7 @@ class InetLink(object):
@property
def proxy_arp(self):
return bool(self.get_conf(DEVCONF_PROXY_ARP))
@proxy_arp.setter
def proxy_arp(self, value):
self.set_conf(DEVCONF_PROXY_ARP, int(value))
@ -102,7 +102,7 @@ class InetLink(object):
@property
def accept_redirects(self):
return bool(self.get_conf(DEVCONF_ACCEPT_REDIRECTS))
@accept_redirects.setter
def accept_redirects(self, value):
self.set_conf(DEVCONF_ACCEPT_REDIRECTS, int(value))
@ -111,7 +111,7 @@ class InetLink(object):
@property
def secure_redirects(self):
return bool(self.get_conf(DEVCONF_SECURE_REDIRECTS))
@secure_redirects.setter
def secure_redirects(self, value):
self.set_conf(DEVCONF_SECURE_REDIRECTS, int(value))
@ -120,7 +120,7 @@ class InetLink(object):
@property
def send_redirects(self):
return bool(self.get_conf(DEVCONF_SEND_REDIRECTS))
@send_redirects.setter
def send_redirects(self, value):
self.set_conf(DEVCONF_SEND_REDIRECTS, int(value))
@ -129,7 +129,7 @@ class InetLink(object):
@property
def shared_media(self):
return bool(self.get_conf(DEVCONF_SHARED_MEDIA))
@shared_media.setter
def shared_media(self, value):
self.set_conf(DEVCONF_SHARED_MEDIA, int(value))

View File

@ -247,7 +247,7 @@ class Tc(netlink.Object):
def stats(self, fmt):
return fmt.nl('{t|packets} {t|bytes} {t|qlen}')
###########################################################################
# Queueing discipline cache
class QdiscCache(netlink.Cache):
@ -360,13 +360,13 @@ class Qdisc(Tc):
fmt = util.MyFormatter(self, indent)
buf = fmt.format(self.brief('qdisc', nodev, noparent))
if details:
buf += fmt.nl('\t' + self.details())
if stats:
buf += self.stats(fmt)
# if stats:
# l = [['Packets', RX_PACKETS, TX_PACKETS],
# ['Bytes', RX_BYTES, TX_BYTES],
@ -500,7 +500,7 @@ class TcClass(Tc):
if details:
buf += fmt.nl('\t' + self.details())
return buf
###########################################################################
@ -589,7 +589,7 @@ class Classifier(Tc):
if details:
buf += fmt.nl('\t' + self.details())
return buf
_qdisc_cache = QdiscCache()
@ -604,7 +604,7 @@ def get_qdisc(ifindex, handle=None, parent=None):
(handle == None or qdisc.handle == handle) and \
(parent == None or qdisc.parent == parent):
l.append(qdisc)
return l
_class_cache = {}
@ -617,7 +617,7 @@ def get_class(ifindex, parent, handle=None):
except KeyError:
cache = TcClassCache(ifindex)
_class_cache[ifindex] = cache
cache.refill()
for cl in cache:
@ -642,7 +642,7 @@ def get_cls(ifindex, parent, handle=None):
except KeyError:
cache = ClassifierCache(ifindex, parent)
_cls_cache[ifindex][parent] = cache
cache.refill()
for cls in cache:

View File

@ -1,5 +1,5 @@
#
# Utilities
# Utilities
#
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
@ -141,7 +141,7 @@ class MyFormatter(Formatter):
return bold(value)
elif conversion is None:
return value
raise ValueError("Unknown converion specifier {0!s}".format(conversion))
def nl(self):