From 1cd0a3670feb67ea29b6af309f8ea78cbe1d1f60 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 3 Jul 2019 10:42:54 +0100 Subject: [PATCH] Tidying --- webfinger.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/webfinger.py b/webfinger.py index d6a05158..25cb1cb0 100644 --- a/webfinger.py +++ b/webfinger.py @@ -149,34 +149,24 @@ def webfingerMeta() -> str: def webfingerLookup(path: str,baseDir: str) -> {}: """Lookup the webfinger endpoint for an account """ - print('############### _webfinger lookup 1') if not path.startswith('/.well-known/webfinger?'): return None - print('############### _webfinger lookup 2') handle=None if 'resource=acct:' in path: - print('############### _webfinger lookup 3') handle=path.split('resource=acct:')[1].strip() else: - print('############### _webfinger lookup 4') if 'resource=acct%3A' in path: - print('############### _webfinger lookup 5') handle=path.split('resource=acct%3A')[1].replace('%40','@').strip() - print('############### _webfinger lookup 6') if not handle: return None - print('############### _webfinger lookup 7') if '&' in handle: handle=handle.split('&')[0].strip() - print('############### _webfinger lookup 8') if '@' not in handle: return None filename=baseDir+'/wfendpoints/'+handle.lower()+'.json' - print('############### _webfinger lookup 9: '+filename) if not os.path.isfile(filename): return None - print('############### _webfinger lookup 10') - wfJson={"user": "unknown"} + wfJson={"nickname": "unknown"} with open(filename, 'r') as fp: wfJson=commentjson.load(fp) return wfJson