Don't need to sort keys

main2
Bob Mottram 2019-09-11 17:12:26 +01:00
parent 4004e231e5
commit a4e8282028
5 changed files with 10 additions and 10 deletions

View File

@ -104,7 +104,7 @@ def undoAnnounceCollectionEntry(postFilename: str,actor: str,debug: bool) -> Non
else:
postJsonObject['object']['shares']['totalItems']=len(postJsonObject['object']['shares']['items'])
with open(postFilename, 'w') as fp:
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=True)
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=False)
def updateAnnounceCollection(postFilename: str,actor: str,debug: bool) -> None:
"""Updates the announcements collection within a post
@ -155,7 +155,7 @@ def updateAnnounceCollection(postFilename: str,actor: str,debug: bool) -> None:
print('DEBUG: saving post with shares (announcements) added')
pprint(postJsonObject)
with open(postFilename, 'w') as fp:
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=True)
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=False)
def announcedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool:
"""Returns True if the given post is announced by the given person

View File

@ -19,7 +19,7 @@ def createConfig(baseDir: str) -> None:
configJson = {
}
with open(configFilename, 'w') as fp:
commentjson.dump(configJson, fp, indent=4, sort_keys=True)
commentjson.dump(configJson, fp, indent=4, sort_keys=False)
def setConfigParam(baseDir: str, variableName: str, variableValue) -> None:
"""Sets a configuration value
@ -30,7 +30,7 @@ def setConfigParam(baseDir: str, variableName: str, variableValue) -> None:
configJson=commentjson.load(fp)
configJson[variableName]=variableValue
with open(configFilename, 'w') as fp:
commentjson.dump(configJson, fp, indent=4, sort_keys=True)
commentjson.dump(configJson, fp, indent=4, sort_keys=False)
def getConfigParam(baseDir: str, variableName: str):
"""Gets a configuration value

View File

@ -61,7 +61,7 @@ def undoLikesCollectionEntry(postFilename: str,objectUrl: str,actor: str,debug:
else:
postJsonObject['object']['likes']['totalItems']=len(postJsonObject['likes']['items'])
with open(postFilename, 'w') as fp:
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=True)
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=False)
def likedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool:
"""Returns True if the given post is liked by the given person
@ -134,7 +134,7 @@ def updateLikesCollection(postFilename: str,objectUrl: str, actor: str,debug: bo
print('DEBUG: saving post with likes added')
pprint(postJsonObject)
with open(postFilename, 'w') as fp:
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=True)
commentjson.dump(postJsonObject, fp, indent=4, sort_keys=False)
def like(session,baseDir: str,federationList: [],nickname: str,domain: str,port: int, \
ccList: [],httpPrefix: str,objectUrl: str,clientToServer: bool, \

View File

@ -1956,7 +1956,7 @@ def getPublicPostsOfPerson(baseDir: str,nickname: str,domain: str, \
personUrl,pubKeyId,pubKey,personId,shaedInbox,capabilityAcquisition,avatarUrl,displayName= \
getPersonBox(baseDir,session,wfRequest,personCache, \
projectVersion,httpPrefix,domain,'outbox')
wfResult = json.dumps(wfRequest, indent=4, sort_keys=True)
wfResult = json.dumps(wfRequest, indent=4, sort_keys=False)
maxMentions=10
maxEmoji=10

View File

@ -43,7 +43,7 @@ def removeShare(baseDir: str,nickname: str,domain: str, \
# remove the item itself
del sharesJson[itemID]
with open(sharesFilename, 'w') as fp:
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
commentjson.dump(sharesJson, fp, indent=4, sort_keys=False)
def addShare(baseDir: str, \
httpPrefix: str,nickname: str,domain: str,port: int, \
@ -138,7 +138,7 @@ def addShare(baseDir: str, \
}
with open(sharesFilename, 'w') as fp:
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
commentjson.dump(sharesJson, fp, indent=4, sort_keys=False)
def expireShares(baseDir: str,nickname: str,domain: str) -> None:
"""Removes expired items from shares
@ -168,7 +168,7 @@ def expireShares(baseDir: str,nickname: str,domain: str) -> None:
if os.path.isfile(itemIDfile+'.gif'):
os.remove(itemIDfile+'.gif')
with open(sharesFilename, 'w') as fp:
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
commentjson.dump(sharesJson, fp, indent=4, sort_keys=False)
def getSharesFeedForPerson(baseDir: str, \
domain: str,port: int, \