Remove debug

main
Bob Mottram 2020-06-29 20:42:35 +01:00
parent 47a1655d3f
commit dccf0f8a6c
1 changed files with 0 additions and 7 deletions

View File

@ -91,14 +91,11 @@ def getPetNameHandle(baseDir: str, nickname: str, domain: str,
with open(petnamesFilename, 'r') as petnamesFile: with open(petnamesFilename, 'r') as petnamesFile:
petnamesStr = petnamesFile.read() petnamesStr = petnamesFile.read()
if petname + ' ' in petnamesStr: if petname + ' ' in petnamesStr:
print('resolvePetnames: petname exists')
petnamesList = petnamesStr.split('\n') petnamesList = petnamesStr.split('\n')
for pet in petnamesList: for pet in petnamesList:
if pet.startswith(petname + ' '): if pet.startswith(petname + ' '):
handle = pet.replace(petname + ' ', '').strip() handle = pet.replace(petname + ' ', '').strip()
print('resolvePetnames: handle found ' + handle)
return handle return handle
print('resolvePetnames: no petname found for ' + petname)
return '' return ''
@ -110,19 +107,15 @@ def resolvePetnames(baseDir: str, nickname: str, domain: str,
return content return content
if ' ' not in content: if ' ' not in content:
return content return content
print('resolvePetnames: ' + content)
words = content.strip().split(' ') words = content.strip().split(' ')
for wrd in words: for wrd in words:
# check initial words beginning with @ # check initial words beginning with @
if not wrd.startswith('@'): if not wrd.startswith('@'):
break break
print('resolvePetnames: ' + wrd)
# does a petname handle exist for this? # does a petname handle exist for this?
handle = getPetNameHandle(baseDir, nickname, domain, wrd) handle = getPetNameHandle(baseDir, nickname, domain, wrd)
if not handle: if not handle:
print('resolvePetnames: not a petname - ' + wrd)
continue continue
# replace the petname with the handle # replace the petname with the handle
content = content.replace(wrd + ' ', '@' + handle + ' ') content = content.replace(wrd + ' ', '@' + handle + ' ')
print('resolvePetnames: ' + content)
return content return content