Skip to content

Commit

Permalink
no need to truncate human output anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Feb 27, 2024
1 parent 706a8b5 commit 2d3f709
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions bbot/core/event/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
split_host_port,
tagify,
validators,
truncate_string,
)


Expand Down Expand Up @@ -490,7 +489,10 @@ def data_human(self):
return self._data_human()

def _data_human(self):
return truncate_string(str(self.data), n=2000)
if isinstance(self.data, (dict, list)):
with suppress(Exception):
return json.dumps(self.data, sort_keys=True)
return smart_decode(self.data)

def _data_load(self, data):
"""
Expand Down Expand Up @@ -524,10 +526,7 @@ def pretty_string(self):
return self._pretty_string()

def _pretty_string(self):
if isinstance(self.data, dict):
with suppress(Exception):
return json.dumps(self.data, sort_keys=True)
return smart_decode(self.data)
return self._data_human()

@property
def data_graph(self):
Expand Down Expand Up @@ -753,9 +752,6 @@ def sanitize_data(self, data):
self.parsed = validators.validate_url_parsed(url)
return data

def _data_human(self):
return json.dumps(self.data, sort_keys=True)

def _data_load(self, data):
if isinstance(data, str):
return json.loads(data)
Expand Down

0 comments on commit 2d3f709

Please sign in to comment.