Skip to content
Browse files

Improved the twisted plugin, and resolved some pyflakes warnings.

  • Loading branch information...
1 parent 596ca05 commit 443259da9b956770a221c98bbaa204e3a1d99425 @clemesha-ooi clemesha-ooi committed May 24, 2010
Showing with 8 additions and 18 deletions.
  1. +2 −3 twisted/plugins/txrabbitmq.py
  2. +4 −4 txrabbitmq/service.py
  3. +1 −6 txrabbitmq/webui/push/data_producer.py
  4. +1 −5 txrabbitmq/webui/webui.py
View
5 twisted/plugins/txrabbitmq.py
@@ -12,13 +12,12 @@
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.python.usage import Options
-from twisted.application import internet, service
+from twisted.application import internet
from twisted.web import resource, server
from twotp import Process, readCookie, buildNodeName
-from rabbitmqctl_service import RabbitMQControlService
-from webui.webui import RabbitMQControlWebUI
+from txrabbitmq.service import RabbitMQControlService
class RESTRabbitmqctlOptions(Options):
optParameters = [
View
8 txrabbitmq/service.py
@@ -1,11 +1,11 @@
import socket
from twisted.application import service
from twisted.internet.defer import inlineCallbacks, returnValue
-from zope.interface import Interface, implements
+from zope.interface import implements
from twotp.term import Binary, Atom
-from irabbitmqctl import IRabbitMQControlService
+from txrabbitmq.irabbitmqctl import IRabbitMQControlService
QUEUE_INFO_ITEMS = ["name", "durable", "auto_delete", "arguments", "pid",
@@ -220,8 +220,8 @@ def list_bindings(self, vhostpath=None):
@inlineCallbacks
def list_connections(self, connectioninfoitem=None):
"""list all connections"""
- if connectioninfoitem is None:
- infoitems = [Atom(item) for item in CONNECTION_INFO_ITEMS]
+ #if connectioninfoitem is None:
+ # infoitems = [Atom(item) for item in CONNECTION_INFO_ITEMS]
result = yield self.process.callRemote(self.nodename, "rabbit_networking", "connection_info_all")#, infoitems)
info_all = []
for v in result:
View
7 txrabbitmq/webui/push/data_producer.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-import sys
from stompservice import StompClientFactory
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
@@ -10,11 +9,7 @@
try:
import json
except ImportError:
- try:
- import simplejson as json
- except ImportError:
- print "FAILED: You must install simplejson or use python2.6"
- sys.exit(1)
+ import simplejson as json
CHANNEL_NAME = "/topic/rabbitmqctl"
INTERVAL = 1.5 #seconds
View
6 txrabbitmq/webui/webui.py
@@ -9,11 +9,7 @@
try:
import json
except ImportError:
- try:
- import simplejson as json
- except ImportError:
- print "FAILED: You must install simplejson or use python2.6"
- sys.exit(1)
+ import simplejson as json
class RabbitMQControlWebUI(resource.Resource):

0 comments on commit 443259d

Please sign in to comment.
Something went wrong with that request. Please try again.