MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _discussion_build_message_dict

Function _discussion_build_message_dict

Scripts/ButSystem.py:17688–17726  ·  view source on GitHub ↗

Build a Discussion message view dict (like DMs).

(conn, r, me: str)

Source from the content-addressed store, hash-verified

17686
17687Internal helper function.
17688
17689This docstring was expanded to make future maintenance easier.
17690
17691Args:
17692 p: Parameter.
17693
17694Returns:
17695 Varies.
17696"""
17697 s = socket.socket()
17698 try:
17699 s.bind(("127.0.0.1", p))
17700 return True
17701 except OSError:
17702 return False
17703 finally:
17704 try:
17705 s.close()
17706 except Exception:
17707 pass
17708 if _try(preferred):
17709 return preferred
17710 for p in range(5000, 9000):
17711 if _try(p):
17712 return p
17713 return 6969
17714
17715def local_ip():
17716 """local_ip.
17717
17718Route handler or application helper.
17719
17720This docstring was expanded to make future maintenance easier.
17721
17722Returns:
17723 Varies.
17724"""
17725 try:
17726 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
17727 s.connect(("8.8.8.8", 80))
17728 ip = s.getsockname()[0]
17729 s.close()

Callers 3

discussionFunction · 0.70
discussion_sendFunction · 0.70
api_discussion_sinceFunction · 0.70

Calls 3

aesgcm_decrypt_textFunction · 0.70
_local_time_strFunction · 0.70
human_sizeFunction · 0.70

Tested by

no test coverage detected