Commit 70c299da authored by Sergio Durigan Junior's avatar Sergio Durigan Junior

New upstream version 0.4.1

parent 6f3530b7
Metadata-Version: 1.1
Name: stomper
Version: 0.3.0
Version: 0.4.1
Summary: This is a transport neutral client implementation of the STOMP protocol.
Home-page: https://github.com/oisinmulvihill/stomper
Author: Oisin Mulvihill
......@@ -23,6 +23,8 @@ Description: =======
- Ian Weller <https://github.com/ianweller>,
- Daniele Varrazzo <https://github.com/dvarrazzo>
- Ralph Bean <http://threebean.org>
- Lumír 'Frenzy' Balhar <https://github.com/frenzymadness>
- Ralph Bean (https://github.com/ralphbean)
Introduction
......@@ -103,6 +105,17 @@ Description: =======
Version History
---------------
0.4.1
~~~~~
Thanks to Ralph Bean (https://github.com/ralphbean) contributing a fix to setup.py and utf-8 encoding under python3.
0.4.0
~~~~~
Thanks to Lumír 'Frenzy' Balhar (https://github.com/frenzymadness) contributing
python3 support.
0.3.0
~~~~~
......
......@@ -15,6 +15,8 @@ Stomper
- Ian Weller <https://github.com/ianweller>,
- Daniele Varrazzo <https://github.com/dvarrazzo>
- Ralph Bean <http://threebean.org>
- Lumír 'Frenzy' Balhar <https://github.com/frenzymadness>
- Ralph Bean (https://github.com/ralphbean)
Introduction
......@@ -95,6 +97,17 @@ This is the default version used in stomper version 0.2.x.
Version History
---------------
0.4.1
~~~~~
Thanks to Ralph Bean (https://github.com/ralphbean) contributing a fix to setup.py and utf-8 encoding under python3.
0.4.0
~~~~~
Thanks to Lumír 'Frenzy' Balhar (https://github.com/frenzymadness) contributing
python3 support.
0.3.0
~~~~~
......
Metadata-Version: 1.1
Name: stomper
Version: 0.3.0
Version: 0.4.1
Summary: This is a transport neutral client implementation of the STOMP protocol.
Home-page: https://github.com/oisinmulvihill/stomper
Author: Oisin Mulvihill
......@@ -23,6 +23,8 @@ Description: =======
- Ian Weller <https://github.com/ianweller>,
- Daniele Varrazzo <https://github.com/dvarrazzo>
- Ralph Bean <http://threebean.org>
- Lumír 'Frenzy' Balhar <https://github.com/frenzymadness>
- Ralph Bean (https://github.com/ralphbean)
Introduction
......@@ -103,6 +105,17 @@ Description: =======
Version History
---------------
0.4.1
~~~~~
Thanks to Ralph Bean (https://github.com/ralphbean) contributing a fix to setup.py and utf-8 encoding under python3.
0.4.0
~~~~~
Thanks to Lumír 'Frenzy' Balhar (https://github.com/frenzymadness) contributing
python3 support.
0.3.0
~~~~~
......
......@@ -10,6 +10,7 @@ lib/stomper/utils.py
lib/stomper.egg-info/PKG-INFO
lib/stomper.egg-info/SOURCES.txt
lib/stomper.egg-info/dependency_links.txt
lib/stomper.egg-info/requires.txt
lib/stomper.egg-info/top_level.txt
lib/stomper/examples/__init__.py
lib/stomper/examples/receiver.py
......
future
\ No newline at end of file
from stomp_11 import (
from __future__ import absolute_import
from .stomp_11 import (
Engine,
Frame,
FrameError,
......
......@@ -5,6 +5,8 @@ A simple twisted STOMP message receiver server.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
from builtins import str
import uuid
import logging
import itertools
......@@ -104,13 +106,13 @@ class StompClientFactory(ReconnectingClientFactory):
def clientConnectionLost(self, connector, reason):
"""Lost connection
"""
print 'Lost connection. Reason:', reason
print('Lost connection. Reason:', reason)
def clientConnectionFailed(self, connector, reason):
"""Connection failed
"""
print 'Connection failed. Reason:', reason
print('Connection failed. Reason:', reason)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
......
......@@ -5,6 +5,8 @@ A simple twisted STOMP message sender.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
from builtins import str
import uuid
import logging
import itertools
......@@ -75,7 +77,7 @@ class StompProtocol(Protocol, stomper.Engine):
def send(self):
"""Send out a hello message periodically.
"""
counter = self.counter.next()
counter = next(self.counter)
self.log.info("senderID:%s Saying hello (%d)." % (self.senderID, counter))
......@@ -127,13 +129,13 @@ class StompClientFactory(ReconnectingClientFactory):
def clientConnectionLost(self, connector, reason):
"""Lost connection
"""
print 'Lost connection. Reason:', reason
print('Lost connection. Reason:', reason)
def clientConnectionFailed(self, connector, reason):
"""Connection failed
"""
print 'Connection failed. Reason:', reason
print('Connection failed. Reason:', reason)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
......
......@@ -5,6 +5,7 @@ A simple twisted STOMP message receiver server.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
import logging
from twisted.internet import reactor
......@@ -106,13 +107,13 @@ class StompClientFactory(ReconnectingClientFactory):
def clientConnectionLost(self, connector, reason):
"""Lost connection
"""
print 'Lost connection. Reason:', reason
print('Lost connection. Reason:', reason)
def clientConnectionFailed(self, connector, reason):
"""Connection failed
"""
print 'Connection failed. Reason:', reason
print('Connection failed. Reason:', reason)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
......
......@@ -5,6 +5,7 @@ A simple twisted STOMP message sender.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
import logging
from twisted.internet import reactor
......@@ -117,13 +118,13 @@ class StompClientFactory(ReconnectingClientFactory):
def clientConnectionLost(self, connector, reason):
"""Lost connection
"""
print 'Lost connection. Reason:', reason
print('Lost connection. Reason:', reason)
def clientConnectionFailed(self, connector, reason):
"""Connection failed
"""
print 'Connection failed. Reason:', reason
print('Connection failed. Reason:', reason)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
......
......@@ -6,6 +6,7 @@ messages and anything else I can think of demonstrating.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
import pprint
import stomper
......@@ -15,7 +16,7 @@ responder = stomper.Engine()
# Generate the connect command to tell the server about us:
msg = stomper.connect('bob','1234')
print "msg:\n%s\n" % pprint.pformat(msg)
print("msg:\n%s\n" % pprint.pformat(msg))
#>>> 'CONNECT\nlogin:bob\npasscode:1234\n\n\x00\n'
......@@ -72,7 +73,7 @@ hello queue a
# ACK message:
response = responder.react(server_msg)
print "response:\n%s\n" % pprint.pformat(response)
print("response:\n%s\n" % pprint.pformat(response))
#>>> 'ACK\nmessage-id: some-message-id\n\n\x00\n'
......@@ -86,7 +87,7 @@ class Pong(stomper.Engine):
def ack(self, msg):
"""Override this and do some customer message handler.
"""
print "Got a message:\n%s\n" % msg['body']
print("Got a message:\n%s\n" % msg['body'])
# do something with the message...
......@@ -96,7 +97,7 @@ class Pong(stomper.Engine):
responder2 = Pong()
response = responder2.react(server_msg)
print "response:\n%s\n" % pprint.pformat(response)
print("response:\n%s\n" % pprint.pformat(response))
#>>> 'ACK\nmessage-id: some-message-id\n\n\x00\n'
......@@ -105,7 +106,7 @@ print "response:\n%s\n" % pprint.pformat(response)
# 1. using the the function for send()
send_message = stomper.send(DESTINATION, 'hello there')
print "1. send_message:\n%s\n" % pprint.pformat(send_message)
print("1. send_message:\n%s\n" % pprint.pformat(send_message))
#>>> 'SEND\ndestination: /queue/inbox\n\nhello there\x00\n'
......@@ -115,7 +116,7 @@ msg = stomper.Frame()
msg.cmd = 'SEND'
msg.headers = {'destination':'/queue/a','custom-header':'1234'}
msg.body = "hello queue a"
print "2. send_message:\n%s\n" % pprint.pformat(msg.pack())
print("2. send_message:\n%s\n" % pprint.pformat(msg.pack()))
#>>> 'SEND\ncustom-header:1234\ndestination:/queue/a\n\nhello queue a\n\n\x00\n'
......
......@@ -29,14 +29,16 @@ page is here:
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import absolute_import
from builtins import object
import re
import uuid
import types
import logging
import utils
import stompbuffer
from . import utils
from . import stompbuffer
# This is used as a return from message responses functions.
# It is used more for readability more then anything or reason.
......@@ -60,6 +62,11 @@ VALID_COMMANDS = [
'RECEIPT', 'ERROR',
]
try:
stringTypes = (str, unicode)
except NameError:
stringTypes = (str,)
def get_log():
return logging.getLogger("stomper")
......@@ -409,14 +416,14 @@ class Engine(object):
# If its not a string assume its a dict.
mtype = type(msg)
if mtype in types.StringTypes:
if mtype in stringTypes:
msg = unpack_frame(msg)
elif mtype == types.DictType:
elif mtype == dict:
pass
else:
raise FrameError("Unknown message type '%s', I don't know what to do with this!" % mtype)
if self.states.has_key(msg['cmd']):
if msg['cmd'] in self.states:
# print("reacting to message - %s" % msg['cmd'])
returned = self.states[msg['cmd']](msg)
......@@ -451,7 +458,7 @@ class Engine(object):
message_id = msg['headers']['message-id']
transaction_id = None
if msg['headers'].has_key('transaction-id'):
if 'transaction-id' in msg['headers']:
transaction_id = msg['headers']['transaction-id']
# print "acknowledging message id <%s>." % message_id
......@@ -471,7 +478,7 @@ class Engine(object):
body = msg['body'].replace(NULL, '')
brief_msg = ""
if msg['headers'].has_key('message'):
if 'message' in msg['headers']:
brief_msg = msg['headers']['message']
self.log.error("Received server error - message%s\n\n%s" % (brief_msg, body))
......@@ -495,7 +502,7 @@ class Engine(object):
body = msg['body'].replace(NULL, '')
brief_msg = ""
if msg['headers'].has_key('receipt-id'):
if 'receipt-id' in msg['headers']:
brief_msg = msg['headers']['receipt-id']
self.log.info("Received server receipt message - receipt-id:%s\n\n%s" % (brief_msg, body))
......
......@@ -30,14 +30,16 @@ page is here:
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import absolute_import
from builtins import object
import re
import uuid
import types
import logging
import utils
import stompbuffer
from . import utils
from . import stompbuffer
# This is used as a return from message responses functions.
# It is used more for readability more then anything or reason.
......@@ -61,6 +63,11 @@ VALID_COMMANDS = [
'RECEIPT', 'ERROR',
]
try:
stringTypes = (str, unicode)
except NameError:
stringTypes = (str,)
def get_log():
return logging.getLogger("stomper")
......@@ -449,14 +456,14 @@ class Engine(object):
# If its not a string assume its a dict.
mtype = type(msg)
if mtype in types.StringTypes:
if mtype in stringTypes:
msg = unpack_frame(msg)
elif mtype == types.DictType:
elif mtype == dict:
pass
else:
raise FrameError("Unknown message type '%s', I don't know what to do with this!" % mtype)
if self.states.has_key(msg['cmd']):
if msg['cmd'] in self.states:
# print("reacting to message - %s" % msg['cmd'])
returned = self.states[msg['cmd']](msg)
......@@ -492,7 +499,7 @@ class Engine(object):
subscription = msg['headers']['subscription']
transaction_id = None
if msg['headers'].has_key('transaction-id'):
if 'transaction-id' in msg['headers']:
transaction_id = msg['headers']['transaction-id']
# print "acknowledging message id <%s>." % message_id
......@@ -512,7 +519,7 @@ class Engine(object):
body = msg['body'].replace(NULL, '')
brief_msg = ""
if msg['headers'].has_key('message'):
if 'message' in msg['headers']:
brief_msg = msg['headers']['message']
self.log.error("Received server error - message%s\n\n%s" % (brief_msg, body))
......@@ -536,7 +543,7 @@ class Engine(object):
body = msg['body'].replace(NULL, '')
brief_msg = ""
if msg['headers'].has_key('receipt-id'):
if 'receipt-id' in msg['headers']:
brief_msg = msg['headers']['receipt-id']
self.log.info("Received server receipt message - receipt-id:%s\n\n%s" % (brief_msg, body))
......
......@@ -6,6 +6,7 @@ Ricky Iacovou, 2008-03-27.
License: http://www.apache.org/licenses/LICENSE-2.0
"""
from builtins import object
import re
import stomper
......
......@@ -30,7 +30,7 @@ def makeBinaryMessage ( body = BINBODY, cmd = CMD ):
def messageIsGood ( msg, body = BODY, cmd = CMD ):
if msg is None:
return False
if type ( msg ) != types.DictType:
if type ( msg ) != dict:
return False
if msg [ 'cmd' ] != cmd:
return False
......
......@@ -11,7 +11,7 @@ from setuptools import setup, find_packages
Name = 'stomper'
ProjectUrl = "https://github.com/oisinmulvihill/stomper"
Version = '0.3.0'
Version = '0.4.1'
Author = 'Oisin Mulvihill'
AuthorEmail = 'oisin dot mulvihill at gmail com'
Maintainer = 'Oisin Mulvihill'
......@@ -32,9 +32,7 @@ Classifiers = [
]
# Recover the ReStructuredText docs:
fd = file("README.rst")
Description = fd.read()
fd.close()
Description = open("README.rst", "rb").read().decode("utf-8")
TestSuite = 'stomper.tests'
......@@ -47,7 +45,7 @@ PackageData = {
}
needed = []
needed = ['future']
if sys.version_info < (2, 5):
needed += [
'uuid>=1.2',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment