PEP8: Function names should be snake_case
universal naming for module and function: submit_to_minissdpd
This commit is contained in:
parent
884f17c8db
commit
475dc0a902
|
@ -6,7 +6,7 @@ import socket, os
|
||||||
|
|
||||||
|
|
||||||
def codelength(s):
|
def codelength(s):
|
||||||
""" returns the given bytearray prepended with the 7-bit-encoded length """
|
""" returns the given bytearray, prepended with the 7-bit-encoded length """
|
||||||
l = len(s)
|
l = len(s)
|
||||||
if l == 0:
|
if l == 0:
|
||||||
return b'\x00'
|
return b'\x00'
|
||||||
|
@ -18,7 +18,7 @@ def codelength(s):
|
||||||
return encodedlen + s
|
return encodedlen + s
|
||||||
|
|
||||||
|
|
||||||
def SubmitServicesToMiniSSDPD(st, usn, server, url, sockpath="/var/run/minissdpd.sock"):
|
def submit_to_minissdpd(st, usn, server, url, sockpath="/var/run/minissdpd.sock"):
|
||||||
""" submits the specified service to MiniSSDPD (if running)"""
|
""" submits the specified service to MiniSSDPD (if running)"""
|
||||||
# First check if sockpath exists i.e. MiniSSDPD is running
|
# First check if sockpath exists i.e. MiniSSDPD is running
|
||||||
if not os.path.exists(sockpath):
|
if not os.path.exists(sockpath):
|
||||||
|
@ -38,7 +38,7 @@ def SubmitServicesToMiniSSDPD(st, usn, server, url, sockpath="/var/run/minissdpd
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Example usage
|
# Example usage
|
||||||
rc, message = SubmitServicesToMiniSSDPD(
|
rc, message = submit_to_minissdpd(
|
||||||
b'urn:schemas-upnp-org:device:InternetGatewayDevice:1',
|
b'urn:schemas-upnp-org:device:InternetGatewayDevice:1',
|
||||||
b'uuid:73616d61-6a6b-7a74-650a-0d24d4a5d636::urn:schemas-upnp-org:device:InternetGatewayDevice:1',
|
b'uuid:73616d61-6a6b-7a74-650a-0d24d4a5d636::urn:schemas-upnp-org:device:InternetGatewayDevice:1',
|
||||||
b'MyServer/0.0',
|
b'MyServer/0.0',
|
||||||
|
|
Loading…
Reference in New Issue