Skip to content

Commit

Permalink
Use constants more
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Oct 13, 2015
1 parent 8bf83a7 commit e38d3a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stomp/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def on_send(self, frame):
"""
Add the heartbeat header to the frame when connecting.
"""
if frame.cmd == 'CONNECT' or frame.cmd == 'STOMP':
if frame.cmd == CMD_CONNECT or frame.cmd == CMD_STOMP:
if self.heartbeats != (0, 0):
frame.headers[HDR_HEARTBEAT] = '%s,%s' % self.heartbeats

Expand Down
4 changes: 2 additions & 2 deletions stomp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def commit(self, transaction=None, headers={}, **keyword_headers):
assert transaction is not None, "'transaction' is required"
headers = utils.merge_headers([headers, keyword_headers])
headers[HDR_TRANSACTION] = transaction
self.send_frame('COMMIT', headers)
self.send_frame(CMD_COMMIT, headers)

def connect(self, username=None, passcode=None, wait=False, headers={}, **keyword_headers):
cmd = CMD_CONNECT
Expand Down Expand Up @@ -155,7 +155,7 @@ def commit(self, transaction=None, headers={}, **keyword_headers):
assert transaction is not None, "'transaction' is required"
headers = utils.merge_headers([headers, keyword_headers])
headers[HDR_TRANSACTION] = transaction
self.send_frame('COMMIT', headers)
self.send_frame(CMD_COMMIT, headers)

def connect(self, username=None, passcode=None, wait=False, headers={}, **keyword_headers):
cmd = CMD_STOMP
Expand Down

0 comments on commit e38d3a8

Please sign in to comment.