kopia lustrzana https://github.com/Yakifo/amqtt
Add method for formatting client info (address, port, id)
rodzic
f31c3f6434
commit
38775f06c2
|
@ -13,4 +13,11 @@ def not_in_dict_or_none(dict, key):
|
||||||
if key not in dict or dict[key] is None:
|
if key not in dict or dict[key] is None:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def format_client_message(session=None, address=None, port=None, id=None):
|
||||||
|
if session:
|
||||||
|
return "(client @=%s:%d id=%s)" % (session.remote_address, session.remote_port, session.client_id)
|
||||||
|
else:
|
||||||
|
return "(client @=%s:%d id=%s)" % (address, port, id)
|
||||||
|
|
Ładowanie…
Reference in New Issue