diff --git a/src/pyshark/packet/fields.py b/src/pyshark/packet/fields.py index e754bc0a..45806947 100644 --- a/src/pyshark/packet/fields.py +++ b/src/pyshark/packet/fields.py @@ -55,24 +55,27 @@ def showname_key(self): @property def binary_value(self): """ - Returns the raw value of this field (as a binary string) + Converts this field to binary (assuming it's a binary string) """ return binascii.unhexlify(self.raw_value) @property def int_value(self): """ - Returns the raw value of this field (as an integer). + Returns the int value of this field (assuming it's an integer integer). """ return int(self.raw_value) @property def hex_value(self): """ - Returns the raw value of this field (as an integer in base 16). + Returns the int value of this field if it's in base 16 (either as a normal number or in + a "0xFFFF"-style hex value) """ return int(self.raw_value, 16) + base16_value = hex_value + class LayerFieldsContainer(str, Pickleable): """ diff --git a/src/pyshark/packet/packet.py b/src/pyshark/packet/packet.py index 95e49d5b..9d1b717e 100644 --- a/src/pyshark/packet/packet.py +++ b/src/pyshark/packet/packet.py @@ -107,7 +107,7 @@ def __getattr__(self, item): for layer in self.layers: if layer.layer_name == item: return layer - raise AttributeError() + raise AttributeError("No attribute named %s" % item) @property def highest_layer(self): diff --git a/src/pyshark/tshark/tshark_json.py b/src/pyshark/tshark/tshark_json.py index ef8c3fec..29f9b28d 100644 --- a/src/pyshark/tshark/tshark_json.py +++ b/src/pyshark/tshark/tshark_json.py @@ -5,7 +5,7 @@ def duplicate_object_hook(ordered_pairs): - """Warn on duplicate keys.""" + """Make lists out of duplicate keys.""" json_dict = {} for key, val in ordered_pairs: existing_val = json_dict.get(key) diff --git a/src/setup.py b/src/setup.py index 21573752..52dd1c30 100644 --- a/src/setup.py +++ b/src/setup.py @@ -6,7 +6,7 @@ setup( name="pyshark", - version="0.3.7.1", + version="0.3.7.2", packages=find_packages(), package_data={'': ['*.ini', '*.pcapng']}, # Temporarily using trollis 1.0.4 until issue https://github.com/haypo/trollius/issues/4 is resolved.