Skip to content

Commit 0a6162f

Browse files
committed
Better method docs
1 parent 04c15da commit 0a6162f

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/pyshark/packet/fields.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,27 @@ def showname_key(self):
5555
@property
5656
def binary_value(self):
5757
"""
58-
Returns the raw value of this field (as a binary string)
58+
Converts this field to binary (assuming it's a binary string)
5959
"""
6060
return binascii.unhexlify(self.raw_value)
6161

6262
@property
6363
def int_value(self):
6464
"""
65-
Returns the raw value of this field (as an integer).
65+
Returns the int value of this field (assuming it's an integer integer).
6666
"""
6767
return int(self.raw_value)
6868

6969
@property
7070
def hex_value(self):
7171
"""
72-
Returns the raw value of this field (as an integer in base 16).
72+
Returns the int value of this field if it's in base 16 (either as a normal number or in
73+
a "0xFFFF"-style hex value)
7374
"""
7475
return int(self.raw_value, 16)
7576

77+
base16_value = hex_value
78+
7679

7780
class LayerFieldsContainer(str, Pickleable):
7881
"""

src/pyshark/packet/packet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __getattr__(self, item):
107107
for layer in self.layers:
108108
if layer.layer_name == item:
109109
return layer
110-
raise AttributeError()
110+
raise AttributeError("No attribute named %s" % item)
111111

112112
@property
113113
def highest_layer(self):

src/pyshark/tshark/tshark_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def duplicate_object_hook(ordered_pairs):
8-
"""Warn on duplicate keys."""
8+
"""Make lists out of duplicate keys."""
99
json_dict = {}
1010
for key, val in ordered_pairs:
1111
existing_val = json_dict.get(key)

src/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="pyshark",
9-
version="0.3.7.1",
9+
version="0.3.7.2",
1010
packages=find_packages(),
1111
package_data={'': ['*.ini', '*.pcapng']},
1212
# Temporarily using trollis 1.0.4 until issue https://github.com/haypo/trollius/issues/4 is resolved.

0 commit comments

Comments
 (0)