bugfix
This commit is contained in:
parent
1066e2250f
commit
4e04ec9745
@ -68,10 +68,12 @@ def findAllDrives():
|
||||
|
||||
## list all folder name under folder named by path
|
||||
#
|
||||
def folderList(path) :
|
||||
def listFolder(path, rescursive=False) :
|
||||
for name in os.listdir(path) :
|
||||
full_name = os.path.join(path,name)
|
||||
if os.path.isdir(full_name):
|
||||
for f in listFolder(full_name, rescursive=rescursive):
|
||||
yield f
|
||||
yield full_name
|
||||
|
||||
def listFile(folder,suffixs=[],rescursive=False):
|
||||
|
@ -14,11 +14,14 @@ def pmp_get_external_ip():
|
||||
def upnp_get_external_ip():
|
||||
try:
|
||||
igd = upnpclient.discover()[0]
|
||||
print(igd.service_map)
|
||||
|
||||
s_names = [ n for n in igd.service_map.keys() if 'WAN' in n and 'Conn' in n]
|
||||
upnp = igd.service_map[s_names[0]]
|
||||
x = upnp.GetExternalIPAddress()
|
||||
return x.get('NewExternalIPAddress', None)
|
||||
except:
|
||||
except Exception as e:
|
||||
print(f'e={e}')
|
||||
return None
|
||||
|
||||
def ipgetter_get_external_ip():
|
||||
|
Loading…
Reference in New Issue
Block a user