Resolve pep8 error: E501 line too long (80 > 79 characters)
Signed-off-by: Russell Bryant <russ...@ovn.org> --- Makefile.am | 2 +- python/build/nroff.py | 15 ++++++++++----- python/ovs/db/idl.py | 6 ++++-- python/ovs/dirs.py | 10 +++++----- python/ovs/socket_util.py | 14 +++++++++----- xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 3 ++- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Makefile.am b/Makefile.am index f61eb8d..a70f198 100644 --- a/Makefile.am +++ b/Makefile.am @@ -343,7 +343,7 @@ endif if HAVE_FLAKE8 ALL_LOCAL += flake8-check flake8-check: $(FLAKE8_PYFILES) - $(AM_V_GEN) if flake8 $^ --ignore=E111,E112,E113,E123,E126,E127,E128,E129,E131,E201,E203,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E501,E502,E703,E713,W601 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi + $(AM_V_GEN) if flake8 $^ --ignore=E111,E112,E113,E123,E126,E127,E128,E129,E131,E201,E203,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E502,E703,E713,W601 ${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 58c006c..f0edd29 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 <li> children" % node.tagName) + raise error.Error("<%s> element may only have " + "<li> 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("<dl> element may only have <dt> and <dd> children") + raise error.Error("<dl> element may only have " + "<dt> and <dd> 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 1bae57d..1cf5842 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] @@ -1108,7 +1109,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/dirs.py b/python/ovs/dirs.py index b5e68a0..10571db 100644 --- a/python/ovs/dirs.py +++ b/python/ovs/dirs.py @@ -1,8 +1,8 @@ import os -PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """/usr/local/share/openvswitch""") -RUNDIR = os.environ.get("OVS_RUNDIR", """/var/run""") -LOGDIR = os.environ.get("OVS_LOGDIR", """/usr/local/var/log""") -BINDIR = os.environ.get("OVS_BINDIR", """/usr/local/bin""") +PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch") +RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run") +LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log") +BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin") DBDIR = os.environ.get("OVS_DBDIR") if not DBDIR: @@ -10,4 +10,4 @@ if not DBDIR: if sysconfdir: DBDIR = "%s/openvswitch" % sysconfdir else: - DBDIR = """/usr/local/etc/openvswitch""" + DBDIR = "/usr/local/etc/openvswitch" diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py index 04fb6af..da7cf3f 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 583356c..498857a 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] -- 2.5.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev