PEP8: Function names should be snake_case

universal naming for module and function: submit_to_minissdpd
This commit is contained in:
Sander Jonkers 2021-01-08 13:38:08 +01:00 committed by Thomas Bernard
parent 884f17c8db
commit 475dc0a902
1 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import socket, os
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)
if l == 0:
return b'\x00'
@ -18,7 +18,7 @@ def codelength(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)"""
# First check if sockpath exists i.e. MiniSSDPD is running
if not os.path.exists(sockpath):
@ -38,7 +38,7 @@ def SubmitServicesToMiniSSDPD(st, usn, server, url, sockpath="/var/run/minissdpd
if __name__ == "__main__":
# Example usage
rc, message = SubmitServicesToMiniSSDPD(
rc, message = submit_to_minissdpd(
b'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',