diff options
author | Ask Solem <ask@celeryproject.org> | 2014-05-27 14:52:08 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2014-05-27 14:52:08 +0100 |
commit | 2a8602fc64a335860c54043b4e693058e4de789d (patch) | |
tree | 6c4a636840745055cc23a8a7730be1bc065e1090 | |
parent | f3c4e69de6d686b36c127ebf1c3143b279ff6d5a (diff) | |
download | py-amqp-2a8602fc64a335860c54043b4e693058e4de789d.tar.gz |
Fixes flakes after flake8 upgrade
-rw-r--r-- | amqp/channel.py | 1 | ||||
-rw-r--r-- | amqp/connection.py | 6 | ||||
-rw-r--r-- | amqp/five.py | 10 | ||||
-rw-r--r-- | amqp/serialization.py | 2 | ||||
-rwxr-xr-x | demo/demo_receive.py | 2 | ||||
-rw-r--r-- | docs/_ext/applyxrefs.py | 2 | ||||
-rw-r--r-- | docs/conf.py | 14 | ||||
-rwxr-xr-x | extra/generate_skeleton_0_8.py | 9 | ||||
-rw-r--r-- | extra/update_comments_from_spec.py | 6 |
9 files changed, 20 insertions, 32 deletions
diff --git a/amqp/channel.py b/amqp/channel.py index 05eb09a..dfb2f8f 100644 --- a/amqp/channel.py +++ b/amqp/channel.py @@ -1069,7 +1069,6 @@ class Channel(AbstractChannel): args.write_shortstr(queue) args.write_shortstr(exchange) args.write_shortstr(routing_key) - #args.write_bit(nowait) args.write_table(arguments) self._send_method((50, 50), args) diff --git a/amqp/connection.py b/amqp/connection.py index d48611c..c238a4d 100644 --- a/amqp/connection.py +++ b/amqp/connection.py @@ -127,8 +127,8 @@ class Connection(AbstractChannel): and (password is not None): login_response = AMQPWriter() login_response.write_table({'LOGIN': userid, 'PASSWORD': password}) - login_response = login_response.getvalue()[4:] # Skip the length - # at the beginning + # Skip the length at the beginning + login_response = login_response.getvalue()[4:] d = dict(LIBRARY_PROPERTIES, **client_properties or {}) self._method_override = {(60, 50): self._dispatch_basic_return} @@ -335,7 +335,7 @@ class Connection(AbstractChannel): # http://bugs.python.org/issue10272 if 'timed out' in str(exc): raise socket.timeout() - # Non-blocking SSL sockets can throw SSLError + # Non-blocking SSL sockets can throw SSLError if 'The operation did not complete' in str(exc): raise socket.timeout() raise diff --git a/amqp/five.py b/amqp/five.py index 45d12bc..a2f94ae 100644 --- a/amqp/five.py +++ b/amqp/five.py @@ -38,7 +38,7 @@ except NameError: # pragma: no cover bytes_t = bytes -############## py3k ######################################################### +# ############# py3k ######################################################## import sys PY3 = sys.version_info[0] == 3 @@ -57,7 +57,7 @@ try: except ImportError: # pragma: no cover from UserDict import UserDict # noqa -############## time.monotonic ################################################ +# ############# time.monotonic ############################################# if sys.version_info < (3, 3): @@ -112,7 +112,7 @@ try: except ImportError: monotonic = _monotonic # noqa -############## Py3 <-> Py2 ################################################### +# ############# Py3 <-> Py2 ################################################# if PY3: # pragma: no cover import builtins @@ -213,13 +213,13 @@ def with_metaclass(Type, skip_attrs={'__dict__', '__weakref__'}): return _clone_with_metaclass -############## threading.TIMEOUT_MAX ####################################### +# ############# threading.TIMEOUT_MAX ######################################## try: from threading import TIMEOUT_MAX as THREAD_TIMEOUT_MAX except ImportError: THREAD_TIMEOUT_MAX = 1e10 # noqa -############## format(int, ',d') ########################## +# ############# format(int, ',d') ############################################ if sys.version_info >= (2, 7): # pragma: no cover def format_d(i): diff --git a/amqp/serialization.py b/amqp/serialization.py index c5cc914..77ec60a 100644 --- a/amqp/serialization.py +++ b/amqp/serialization.py @@ -381,7 +381,7 @@ class AMQPWriter(object): elif isinstance(v, datetime): self.write(b'T') self.write_timestamp(v) - ## FIXME: timezone ? + # ## FIXME timezone ? elif isinstance(v, dict): self.write(b'F') self.write_table(v) diff --git a/demo/demo_receive.py b/demo/demo_receive.py index bfda624..7b33ab4 100755 --- a/demo/demo_receive.py +++ b/demo/demo_receive.py @@ -68,8 +68,6 @@ def main(): ch.queue_bind(qname, 'myfan') ch.basic_consume(qname, callback=partial(callback, ch)) - #pyamqp:// - # # Loop as long as the channel has callbacks registered # diff --git a/docs/_ext/applyxrefs.py b/docs/_ext/applyxrefs.py index deed5d9..a9a9d8c 100644 --- a/docs/_ext/applyxrefs.py +++ b/docs/_ext/applyxrefs.py @@ -49,7 +49,6 @@ def has_target(fn): if not readok: return (True, None) - #print fn, len(lines) if len(lines) < 1: print("Not touching empty file %s." % fn) return (True, None) @@ -71,7 +70,6 @@ def main(argv=None): files.extend([(dirpath, f) for f in filenames]) files.sort() files = [os.path.join(p, fn) for p, fn in files if fn.endswith('.txt')] - #print files for fn in files: if fn in DONT_TOUCH: diff --git a/docs/conf.py b/docs/conf.py index 1191395..4710773 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -82,7 +82,7 @@ html_sidebars = { 'sourcelink.html', 'searchbox.html'], } -### Issuetracker +# ## Issuetracker if False: issuetracker = "github" @@ -111,13 +111,13 @@ epub_identifier = 'celeryproject.org' # A unique identification for the text. epub_uid = 'py-amqp Manual, Version 1.0' -# HTML files that should be inserted before the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_pre_files = [] +# ## HTML files that should be inserted before the pages created by sphinx. +# ## The format is a list of tuples containing the path and title. +# epub_pre_files = [] -# HTML files shat should be inserted after the pages created by sphinx. -# The format is a list of tuples containing the path and title. -#epub_post_files = [] +# ## HTML files shat should be inserted after the pages created by sphinx. +# ## The format is a list of tuples containing the path and title. +# epub_post_files = [] # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] diff --git a/extra/generate_skeleton_0_8.py b/extra/generate_skeleton_0_8.py index 3bf4482..06b2515 100755 --- a/extra/generate_skeleton_0_8.py +++ b/extra/generate_skeleton_0_8.py @@ -159,8 +159,6 @@ def generate_docstr(element, indent='', wrap=None): extra_indent = ' ' if d.attrib['name'] == 'grammar': reformat = False # Don't want re-indenting to mess this up - #else: - # extra_indent = '' result.append(_reindent(docval, indent + extra_indent, reformat)) result.append(indent) @@ -320,7 +318,7 @@ def generate_module(spec, out): _fixup_method_name(amqp_class, amqp_method)), ) - #### Actually generate output + # ### Actually generate output for amqp_class in spec.findall('class'): if amqp_class.attrib['handler'] == amqp_class.attrib['name']: @@ -329,12 +327,7 @@ def generate_module(spec, out): out.write('_METHOD_MAP = {\n') for amqp_class in spec.findall('class'): print amqp_class.attrib -# for chassis in amqp_class.findall('chassis'): -# print ' ', chassis.attrib for amqp_method in amqp_class.findall('method'): -# print ' ', amqp_method.attrib -# for chassis in amqp_method.findall('chassis'): -# print ' ', chassis.attrib chassis = [x.attrib['name'] for x in amqp_method.findall('chassis')] if 'client' in chassis: diff --git a/extra/update_comments_from_spec.py b/extra/update_comments_from_spec.py index 677dd5c..e8a99d8 100644 --- a/extra/update_comments_from_spec.py +++ b/extra/update_comments_from_spec.py @@ -42,8 +42,8 @@ def get_comments(filename): all_matches = RE_COMMENTS.finditer(whole_source) for match in all_matches: comments[match.group('mname')] = match.group('comment') - #print('method: %s \ncomment: %s' % ( - # match.group('mname'), match.group('comment'))) + # print('method: %s \ncomment: %s' % ( + # match.group('mname'), match.group('comment'))) return comments @@ -52,7 +52,7 @@ def replace_comment_per_def(source, result_file, def_name, new_comment): regex = ('(?P<methodsig>def\s+' + def_name + '\(.*?\):\n+\s+""".*?\n).*?(?=""")') - #print('method and comment:' + def_name + new_comment) + # print('method and comment:' + def_name + new_comment) result = re.sub(regex, '\g<methodsig>' + new_comment, source, 0, re.MULTILINE | re.DOTALL) return result |