You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/03/06 23:39:35 UTC

svn commit: r1664738 - in /qpid/dispatch/trunk/python: qpid_dispatch/management/ qpid_dispatch_internal/management/ qpid_dispatch_internal/router/

Author: aconway
Date: Fri Mar  6 22:39:34 2015
New Revision: 1664738

URL: http://svn.apache.org/r1664738
Log:
NO-JIRA: Clean up errors reported by pyflakes

Modified:
    qpid/dispatch/trunk/python/qpid_dispatch/management/client.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/config.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema_doc.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/engine.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/hello.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/link.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/node.py

Modified: qpid/dispatch/trunk/python/qpid_dispatch/management/client.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch/management/client.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch/management/client.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch/management/client.py Fri Mar  6 22:39:34 2015
@@ -24,7 +24,7 @@ AMQP management client for Qpid dispatch
 import qpid_dispatch_site
 import proton
 from proton import Url
-from .error import *
+from .error import *        # import all error symbols for convenience to users.
 from .entity import EntityBase, clean_dict
 try:
     from proton.utils import SyncRequestResponse, BlockingConnection

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py Fri Mar  6 22:39:34 2015
@@ -65,8 +65,7 @@ Temporary solution is to lock the entire
 Better solution coming soon...
 """
 
-import traceback, json
-from collections import namedtuple
+yimport traceback, json
 from itertools import ifilter, chain
 from traceback import format_exc
 from threading import Lock

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/config.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/config.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/config.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/config.py Fri Mar  6 22:39:34 2015
@@ -24,7 +24,6 @@ Configuration file parsing
 import json, re, sys
 from copy import copy
 from qpid_dispatch.management.entity import camelcase
-from .schema import ValidationError
 from .. import dispatch_c
 from .qdrouter import QdSchema
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema.py Fri Mar  6 22:39:34 2015
@@ -26,7 +26,7 @@ check for uniqueness of enties/attribute
 A Schema can be loaded/dumped to a json file.
 """
 
-import sys, json
+import sys
 from qpid_dispatch.management.entity import EntityBase
 from qpid_dispatch.management.error import NotImplementedStatus
 from ..compat import OrderedDict
@@ -368,8 +368,8 @@ class EntityType(object):
         def check(a, b, what):
             overlap = set(a) & set(b)
             if overlap:
-                raise RedefinedError("'%s' cannot %s '%s', re-defines %s: %s"
-                                     % (self.name, how, other.short_name, what, ",".join(overlap)))
+                raise ValidationError("'%s' cannot %s '%s', re-defines %s: %s"
+                                      % (self.name, how, other.short_name, what, ",".join(overlap)))
         check(self.operations, other.operations, "operations")
         self.operations += other.operations
         check(self.attributes.iterkeys(), other.attributes.itervalues(), "attributes")
@@ -474,9 +474,6 @@ class EntityType(object):
             ('operations', self.operations),
             ('description', self.description or None)
         ])
-        if self.singleton: d['singleton'] = True
-        return d
-
 
     def __repr__(self): return "%s(%s)" % (type(self).__name__, self.name)
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema_doc.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema_doc.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema_doc.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/schema_doc.py Fri Mar  6 22:39:34 2015
@@ -20,7 +20,7 @@
 """Library for generating markdown documentation from a L{schema.Schema}"""
 
 from collections import namedtuple
-import sys, re
+import sys
 from .schema import quotestr
 
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/engine.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/engine.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/engine.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/engine.py Fri Mar  6 22:39:34 2015
@@ -25,7 +25,6 @@ from mobile import MobileAddressEngine
 from node import NodeTracker
 from message import Message
 
-import sys
 from traceback import format_exc, extract_stack
 import time
 
@@ -33,7 +32,7 @@ import time
 ## Import the Dispatch adapters from the environment.  If they are not found
 ## (i.e. we are in a test bench, etc.), load the stub versions.
 ##
-from ..dispatch import IoAdapter, LogAdapter, LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_STACK_LIMIT
+from ..dispatch import IoAdapter, LogAdapter, LOG_TRACE, LOG_INFO, LOG_ERROR, LOG_STACK_LIMIT
 
 class RouterEngine:
     """
@@ -95,7 +94,7 @@ class RouterEngine:
         try:
             if addr[0] in 'MC':
                 self.mobile_address_engine.add_local_address(addr)
-        except Exception, e:
+        except Exception:
             self.log_ma(LOG_ERROR, "Exception in new-address processing\n%s" % format_exc(LOG_STACK_LIMIT))
 
     def addressRemoved(self, addr):
@@ -104,7 +103,7 @@ class RouterEngine:
         try:
             if addr[0] in 'MC':
                 self.mobile_address_engine.del_local_address(addr)
-        except Exception, e:
+        except Exception:
             self.log_ma(LOG_ERROR, "Exception in del-address processing\n%s" % format_exc(LOG_STACK_LIMIT))
 
     def linkLost(self, link_id):
@@ -121,7 +120,7 @@ class RouterEngine:
             self.hello_protocol.tick(now)
             self.link_state_engine.tick(now)
             self.node_tracker.tick(now)
-        except Exception, e:
+        except Exception:
             self.log(LOG_ERROR, "Exception in timer processing\n%s" % format_exc(LOG_STACK_LIMIT))
 
     def handleControlMessage(self, opcode, body, link_id):
@@ -159,7 +158,7 @@ class RouterEngine:
                 self.log_ma(LOG_TRACE, "RCVD: %r" % msg)
                 self.mobile_address_engine.handle_mar(msg, now)
 
-        except Exception, e:
+        except Exception:
             self.log(LOG_ERROR, "Control message error: opcode=%s body=%r\n%s" % (opcode, body, format_exc(LOG_STACK_LIMIT)))
 
     def receive(self, message, link_id):
@@ -168,7 +167,7 @@ class RouterEngine:
         """
         try:
             self.handleControlMessage(message.properties['opcode'], message.body, link_id)
-        except Exception, e:
+        except Exception:
             self.log(LOG_ERROR, "Exception in raw message processing: properties=%r body=%r\n%s" %
                      (message.properties, message.body, format_exc(LOG_STACK_LIMIT)))
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/hello.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/hello.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/hello.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/hello.py Fri Mar  6 22:39:34 2015
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-from data import LinkState, MessageHELLO
+from data import MessageHELLO
 from qpid_dispatch_internal.dispatch import LOG_INFO, LOG_TRACE
 
 class HelloProtocol(object):

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/link.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/link.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/link.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/link.py Fri Mar  6 22:39:34 2015
@@ -18,7 +18,7 @@
 #
 
 from data import MessageRA, MessageLSU, MessageLSR
-from ..dispatch import LOG_INFO, LOG_TRACE
+from ..dispatch import LOG_TRACE
 
 class LinkStateEngine(object):
     """

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py Fri Mar  6 22:39:34 2015
@@ -18,7 +18,7 @@
 #
 
 from data import MessageMAR, MessageMAU
-from ..dispatch import LOG_DEBUG, LOG_TRACE
+from ..dispatch import LOG_TRACE
 
 MAX_KEPT_DELTAS = 10
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/node.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/node.py?rev=1664738&r1=1664737&r2=1664738&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/node.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/node.py Fri Mar  6 22:39:34 2015
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-from ..dispatch import LOG_INFO, LOG_ERROR, LOG_TRACE, LOG_DEBUG
+from ..dispatch import LOG_INFO, LOG_TRACE, LOG_DEBUG
 from data import LinkState
 from .address import Address
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org