Commits

Kyle Schaffrick committed 26180ab

Change "headers" to "properties" to be consistent with AMQP nomenclature.

Comments (0)

Files changed (2)

 class HeaderFrame(Frame):
     type = 'header'
 
-    def __init__(self, class_, body_len, headers):
+    def __init__(self, class_, body_len, properties):
         self.class_ = class_
-        self.headers = headers
+        self.properties = properties
         self.body_len = body_len
 
     def marshall_amqp(self):
         prop_coding = ""
         for prop in prop_desc:
             name = prop['name']
-            if name not in self.headers:
+            if name not in self.properties:
                 continue
 
-            val = self.headers[name]
+            val = self.properties[name]
             # Bit properties do not go in the property list, only in the
             # flags.
             if prop['code'] == '.':
                 if prop['bitmask'] & flags ]
         coding = ''.join( prop['code'] for prop in props_present )
         payload_contents = binops.unpack_splice(coding, rest)
-        headers = {}
+        properties = {}
 
         for prop in props_present:
             name = prop['name']
 
             if prop['code'] == '.':
-                headers[name] = True
+                properties[name] = True
                 continue
 
             nr_items = len(prop['code'])
             elif nr_items == 1:
                 val = val[0]
 
-            headers[name] = val
+            properties[name] = val
 
-        new_frame = cls(class_, body_len, headers)
+        new_frame = cls(class_, body_len, properties)
         new_frame.channel = frame.channel
         return new_frame
 
     def marshall_dict(self):
-        self.payload = (self.class_.name, self.body_len, self.headers)
+        self.payload = (self.class_.name, self.body_len, self.properties)
         return Frame.marshall_dict(self)
 
 

amqpev/protocol.py

         self.send_method(method, **kwargs)
         return self.wait_method(*reply_methods)
 
-    def send_content(self, class_, headers, body, body_len=None):
+    def send_content(self, class_, properties, body, body_len=None):
         if isinstance(body, str):
             body = [body]
             body_len = len(body[0])
             body = [''.join(body)]
             body_len = len(body[0])
 
-        self._send_frame(HeaderFrame(class_, body_len, headers))
+        self._send_frame(HeaderFrame(class_, body_len, properties))
 
         mtu = self._connection.tune_params['frame_max']
         segment_buf = ""
         while len(body) < header_frame.body_len and next_frame_is('body'):
             body += self._recv_frame().payload
 
-        return (header_frame.headers, header_frame.body_len, body)
+        return (header_frame.properties, header_frame.body_len, body)
 
     @property
     def id(self):