traffic-taffy 0.8__py3-none-any.whl → 0.8.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
traffic_taffy/__init__.py CHANGED
@@ -1 +1 @@
1
- __VERSION__ = "0.8"
1
+ __VERSION__ = "0.8.1"
traffic_taffy/compare.py CHANGED
@@ -3,8 +3,9 @@
3
3
  from __future__ import annotations
4
4
  from logging import debug, error
5
5
  from typing import List, TYPE_CHECKING
6
- import datetime as dt
7
6
  from datetime import datetime
7
+ import datetime as dt
8
+ import itertools
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from argparse import ArgumentParser, Namespace
@@ -102,9 +103,22 @@ class PcapCompare:
102
103
  def compare_all(self, dissections: List[Dissection]) -> List[Comparison]:
103
104
  """Compare all loaded pcaps."""
104
105
  reports = []
105
- if isinstance(dissections, list) and len(dissections) > 1:
106
+
107
+ # hack to figure out if there is at least two instances of a generator
108
+ # without actually extracting them all
109
+ # (since it could be memory expensive)
110
+ reference = next(dissections)
111
+ other = None
112
+ multiple = True
113
+ try:
114
+ other = next(dissections)
115
+ dissections = itertools.chain([other], dissections)
116
+ except Exception as e:
117
+ print(e)
118
+ multiple = False
119
+
120
+ if multiple:
106
121
  # multiple file comparison
107
- reference = next(dissections)
108
122
  for other in dissections:
109
123
  # compare the two global summaries
110
124
 
@@ -116,7 +130,7 @@ class PcapCompare:
116
130
  reports.append(report)
117
131
  else:
118
132
  # deal with timestamps within a single file
119
- reference = list(dissections)[0].data
133
+ reference = reference.data
120
134
  timestamps = list(reference.keys())
121
135
  if len(timestamps) <= 2: # just 0-summary plus a single stamp
122
136
  error(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: traffic-taffy
3
- Version: 0.8
3
+ Version: 0.8.1
4
4
  Summary: A tool for doing differential analysis of pcap files
5
5
  Project-URL: Homepage, https://traffic-taffy.github.io/
6
6
  Author-email: Wes Hardaker <opensource@hardakers.net>
@@ -1,5 +1,5 @@
1
- traffic_taffy/__init__.py,sha256=rSli_H1CNuvL_e1rmtF9vux7IpylSjpepysxJbNv5gg,20
2
- traffic_taffy/compare.py,sha256=MBmNLRdALgPiabwRg1NGnf6Gfb0vKpJc3jhMe2wsgZs,8269
1
+ traffic_taffy/__init__.py,sha256=cGUURt3LgcflHlV_5CG6SItz7kLJVNNBZFU8RU7RSJY,22
2
+ traffic_taffy/compare.py,sha256=4T25Ygp6rQw7J3syn4Tam6tEw3ieSzl-lELPARvNnVw,8641
3
3
  traffic_taffy/comparison.py,sha256=MmCxK7E3RbVLS8gJ_JJOdqa2MHQ7np1Pq_VB0Scir8U,933
4
4
  traffic_taffy/dissection.py,sha256=-jXt4PYCi_lvPh86KC_84VywRZqhZ1cGgLdV2glCQC8,17390
5
5
  traffic_taffy/dissectmany.py,sha256=kJO2XF8QzOmLDsKDjZIkQBmxC97wFpi-IisCURLOmfU,4700
@@ -36,8 +36,8 @@ traffic_taffy/tools/dissect.py,sha256=Z_5JJ92E4168_GZM_9Iu-m6lDfETBt8Gv-vD_Mu3Cf
36
36
  traffic_taffy/tools/explore.py,sha256=Hb4x9HZkFoYnR8BJKF5OLwZWKGR3RX3MdZhX4Oo-NDU,24180
37
37
  traffic_taffy/tools/export.py,sha256=BuAnZcOszj9ZpMxHmRjDqptR15dMRigOhp2-BFJHgWA,2707
38
38
  traffic_taffy/tools/graph.py,sha256=gARv5-7N5MUBSJJ8Uj5XLx4xEonXgIMADKwN573jxyk,2555
39
- traffic_taffy-0.8.dist-info/METADATA,sha256=Ipy4XE9_pCJwre7SPOvA8Q1yCJtMTT0PAsDeKuLmlhU,1931
40
- traffic_taffy-0.8.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
41
- traffic_taffy-0.8.dist-info/entry_points.txt,sha256=ySz30b1Cu03CtCGMRqqg0NZJpzrVI91T5HjbEaTNnpQ,314
42
- traffic_taffy-0.8.dist-info/licenses/LICENSE.txt,sha256=hiV1DJgDQeSM1r7P-ez5oxily11S5nsCedU0jKzKKzo,11338
43
- traffic_taffy-0.8.dist-info/RECORD,,
39
+ traffic_taffy-0.8.1.dist-info/METADATA,sha256=MSgtWi6_e2R7wxBETCrzuPu_hI5QMXJa_n5ATjmJR6c,1933
40
+ traffic_taffy-0.8.1.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
41
+ traffic_taffy-0.8.1.dist-info/entry_points.txt,sha256=ySz30b1Cu03CtCGMRqqg0NZJpzrVI91T5HjbEaTNnpQ,314
42
+ traffic_taffy-0.8.1.dist-info/licenses/LICENSE.txt,sha256=hiV1DJgDQeSM1r7P-ez5oxily11S5nsCedU0jKzKKzo,11338
43
+ traffic_taffy-0.8.1.dist-info/RECORD,,