mirror of https://gitlab.com/bashrc2/epicyon
Simplify
parent
df166c63b2
commit
c5b273512b
11
outbox.py
11
outbox.py
|
@ -127,23 +127,24 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
|
||||||
continue
|
continue
|
||||||
if 'attachment' in actorJson:
|
if 'attachment' in actorJson:
|
||||||
found = False
|
found = False
|
||||||
|
ctr = 0
|
||||||
for propertyValue in actorJson['attachment']:
|
for propertyValue in actorJson['attachment']:
|
||||||
if propertyValue != 'PropertyValue':
|
if propertyValue != 'PropertyValue':
|
||||||
|
ctr += 1
|
||||||
continue
|
continue
|
||||||
if propertyValue['name'] == newPropertyValue['name']:
|
if propertyValue['name'] == newPropertyValue['name']:
|
||||||
if propertyValue['value'] != \
|
|
||||||
newPropertyValue['value']:
|
|
||||||
propertyValue['value'] = \
|
|
||||||
newPropertyValue['value']
|
|
||||||
actorChanged = True
|
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
|
ctr += 1
|
||||||
if not found:
|
if not found:
|
||||||
actorJson['attachment'].append({
|
actorJson['attachment'].append({
|
||||||
"name": newPropertyValue['name'],
|
"name": newPropertyValue['name'],
|
||||||
"type": "PropertyValue",
|
"type": "PropertyValue",
|
||||||
"value": newPropertyValue['value']
|
"value": newPropertyValue['value']
|
||||||
})
|
})
|
||||||
|
else:
|
||||||
|
actorJson['attachment'][ctr]['value'] = \
|
||||||
|
newPropertyValue['value']
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
# save actor to file
|
# save actor to file
|
||||||
if actorChanged:
|
if actorChanged:
|
||||||
|
|
1
pgp.py
1
pgp.py
|
@ -7,7 +7,6 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from person import getActorJson
|
from person import getActorJson
|
||||||
|
|
Loading…
Reference in New Issue