def removeDevice(value): lock.acquire() deviceDict.remove(value) lock.release()
def saveDictionary(): lock.acquire() with open('deviceDictionary.pickle', 'wb') as handle: pickle.dump(deviceDict, handle, protocol=pickle.HIGHEST_PROTOCOL) lock.release()
def addDevice(key, value): lock.acquire() deviceDict[key] = value lock.release()