From: Russell Bryant Date: Tue, 5 Jan 2016 23:19:52 +0000 (-0500) Subject: python: Restrict line length to 79 chars. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=37520ab386ef479c843fd7afccba502872240fb4 python: Restrict line length to 79 chars. Resolve pep8 error: E501 line too long (80 > 79 characters) Signed-off-by: Russell Bryant Acked-by: Ben Pfaff --- diff --git a/Makefile.am b/Makefile.am index b9b8e7199..8b6ddb7ec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -348,9 +348,8 @@ ALL_LOCAL += flake8-check # E128 continuation line under-indented for visual indent # E129 visually indented line with same indent as next logical line # E131 continuation line unaligned for hanging indent -# E501 line too long (80 > 79 characters) flake8-check: $(FLAKE8_PYFILES) - $(AM_V_GEN) if flake8 $^ --ignore=E123,E126,E127,E128,E129,E131,E501 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi + $(AM_V_GEN) if flake8 $^ --ignore=E123,E126,E127,E128,E129,E131 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi endif include $(srcdir)/manpages.mk diff --git a/python/build/nroff.py b/python/build/nroff.py index 58c006c1f..f0edd2907 100644 --- a/python/build/nroff.py +++ b/python/build/nroff.py @@ -88,7 +88,8 @@ def inline_xml_to_nroff(node, font, to_upper=False, newline='\n'): elif node.hasAttribute('db'): s += node.attributes['db'].nodeValue else: - raise error.Error("'ref' lacks required attributes: %s" % node.attributes.keys()) + raise error.Error("'ref' lacks required attributes: %s" + % node.attributes.keys()) return s + font elif node.tagName in ['var', 'dfn', 'i']: s = r'\fI' @@ -96,7 +97,8 @@ def inline_xml_to_nroff(node, font, to_upper=False, newline='\n'): s += inline_xml_to_nroff(child, r'\fI', to_upper, newline) return s + font else: - raise error.Error("element <%s> unknown or invalid here" % node.tagName) + raise error.Error("element <%s> unknown or invalid here" + % node.tagName) elif node.nodeType == node.COMMENT_NODE: return '' else: @@ -145,7 +147,8 @@ def diagram_header_to_nroff(header_node): pic_s = "" for f in header_fields: - pic_s += " %s: box \"%s\" width %s" % (f['tag'], f['name'], f['width']) + pic_s += " %s: box \"%s\" width %s" % (f['tag'], f['name'], + f['width']) if f['fill'] == 'yes': pic_s += " fill" pic_s += '\n' @@ -241,7 +244,8 @@ def block_xml_to_nroff(nodes, para='.PP'): pass elif (li_node.nodeType != node.TEXT_NODE or not li_node.data.isspace()): - raise error.Error("<%s> element may only have
  • children" % node.tagName) + raise error.Error("<%s> element may only have " + "
  • children" % node.tagName) s += ".RE\n" elif node.tagName == 'dl': if s != "": @@ -265,7 +269,8 @@ def block_xml_to_nroff(nodes, para='.PP'): continue elif (li_node.nodeType != node.TEXT_NODE or not li_node.data.isspace()): - raise error.Error("
    element may only have
    and
    children") + raise error.Error("
    element may only have " + "
    and
    children") s += block_xml_to_nroff(li_node.childNodes, ".IP") s += ".RE\n" elif node.tagName == 'p': diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 514503296..c25160136 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -592,7 +592,8 @@ class Row(object): if ((self._table.name in self._idl.readonly) and (column_name in self._idl.readonly[self._table.name])): - vlog.warn("attempting to write to readonly column %s" % column_name) + vlog.warn("attempting to write to readonly column %s" + % column_name) return column = self._table.columns[column_name] @@ -1117,7 +1118,8 @@ class Transaction(object): # transaction only does writes of existing values, without making any # real changes, we will drop the whole transaction later in # ovsdb_idl_txn_commit().) - if not column.alert and row._data and row._data.get(column.name) == datum: + if (not column.alert and row._data and + row._data.get(column.name) == datum): new_value = row._changes.get(column.name) if new_value is None or new_value == datum: return diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py index 04fb6afce..da7cf3f10 100644 --- a/python/ovs/socket_util.py +++ b/python/ovs/socket_util.py @@ -112,10 +112,12 @@ def make_unix_socket(style, nonblock, bind_path, connect_path, short=False): dirname = os.path.dirname(connect_path) basename = os.path.basename(connect_path) try: - connect_dirfd = os.open(dirname, os.O_DIRECTORY | os.O_RDONLY) - except OSError, err: + connect_dirfd = os.open(dirname, + os.O_DIRECTORY | os.O_RDONLY) + except OSError as err: return get_exception_errno(err), None - short_connect_path = "/proc/self/fd/%d/%s" % (connect_dirfd, basename) + short_connect_path = "/proc/self/fd/%d/%s" % (connect_dirfd, + basename) if bind_path is not None: dirname = os.path.dirname(bind_path) @@ -124,10 +126,12 @@ def make_unix_socket(style, nonblock, bind_path, connect_path, short=False): bind_dirfd = os.open(dirname, os.O_DIRECTORY | os.O_RDONLY) except OSError, err: return get_exception_errno(err), None - short_bind_path = "/proc/self/fd/%d/%s" % (bind_dirfd, basename) + short_bind_path = "/proc/self/fd/%d/%s" % (bind_dirfd, + basename) try: - return make_unix_socket(style, nonblock, short_bind_path, short_connect_path) + return make_unix_socket(style, nonblock, short_bind_path, + short_connect_path) finally: if connect_dirfd is not None: os.close(connect_dirfd) diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync index 1b8d0a622..f6fbe851b 100755 --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync @@ -81,7 +81,8 @@ def get_network_by_bridge(br_name): " XAPI session could not be initialized" % br_name) return None - recs = session.xenapi.network.get_all_records_where('field "bridge"="%s"' % br_name) + recs = session.xenapi.network.get_all_records_where( + 'field "bridge"="%s"' % br_name) if len(recs) > 0: return recs.values()[0]