yadapy Package

manager Module

managercommunicator Module

node Module

exception yadapy.node.InvalidIdentity(value)

Bases: exceptions.Exception

class yadapy.node.Node(*args, **kwargs)

Bases: object

add(path='', assignment='', create=False)

@path string Takes a key path separated by forward slashes / to find an entity of the identity Second parameter is the value or expression being assigned

Example: id.add(“data/messages”,[{..message object..}]) #would append a message

#to the messages list
addFriend(friend)

adds a friend to the data/friends element. also validates the friend is a valid identity

returns void

addFriendRequest(friendRequest)

adds a friend to the friend_requests element. also validates the friend request is a valid identity

returns void

addIPAddress(host, port='80', protocol='4')

Adds an IP address object to the data/identity/ip_address element. This object is used by your friends to contact you.

returns void

addMessage(message)

adds a friend to the data/messages element.

returns void

addPromotionRequest(packet)
addRoutedFriendRequest(packet)
base64DecodeMessages()
base64EncodeMessages()
createIPAddress(host, port='80', protocol='4')

generates a new IP Address object @host string Can be an IP address or a host name. @port string Can be any string port number @protocol is the version of IP being used. 4 or 6

returns dictionary

dedupIP()
delKey(path='', assignment='')

Takes a key path separated by forward slashes / to find an entity of the identity Second parameter is the value or expression being assigned

Example: id.add(“status”) #would delete the status key

get(path='')

Takes a key path separated by forward slashes / to find an entity of the identity

Example: id.get(“data/friends”) #would return the friends list

getClassInstanceFromNode()
getClassInstanceFromNodeForNode(identity)
getData(path='')
getFriend(public_key)
getFriendPublicKeyList()
getFriendPublicKeysArray()
getFriendPublicKeysDict()
getFriendTopLevelMeta(public_key)
getIpAddressArray()
getSelfInFriend(node)
handleFriendRequest(packet)
handlePromotionRequest(packet)
handleRoutedFriendRequest(packet)
handleRoutedMessage(packet)
identityData = {}
matchFriend(node)
my_import(name)
newIdentity(identity)
newTimeStamp()
newUuid()
preventInfiniteNesting(newFriendNode)
replaceIdentityOfFriendsWithPubKeys(node=None)
replaceIdentityOfFriendsWithPubKeysKeepPrivateKeys()
respondWithRelationship(friendNode)

This method will return a dictionary prepared to be encrypted, encoded and sent

@friendNode Node instance This is used for the public and private key information

returns dictionary

save()

This is a place holder method to indicate that subclasses with persistent storage should override this method

returns void

searchForNode(searchNode)

tries to find the relationship of self with the friend of your friend. Because even though you have the mutual friend node gotten from your friend’s friend list, that node will not have the correct public key. So we need to return the corresponding friend in your list

returns none or Node instance

sendMessage(pub_keys, subject, message, thread_id=None, guid=None)

Creates either a new message thread or replies to an existing thread if @thread_id is given.

Parameters:pub_keys (list) – list A list of public_keys to send to

:subject string Just like an email subject :message string The body of the message, just like email :thread_id string The thread_id to allow aggregation of a topic

returns a new message object that can be inserted into data/messages

set(path='', assignment='', create=False, force=False)

Takes a key path separated by forward slashes / to find an entity of the identity Second parameter is the value or expression being assigned

Example: id.set(“data/identity/name”,”Matt”) #would return the friends list

setData(data)
setModifiedToNow()
stripFriendIdentityForFriend(friend={})
stripIdentityAndFriendsForFriend()
stripIdentityAndFriendsForProtocolV1(node=None)
stripIdentityAndFriendsForWebGUI()
stripIdentityOfIrrelevantFriendRequests(node)
stripIdentityOfIrrelevantMessages(friend)
sync(inbound, is_self=True, permission_object={})

This kicks off the _updateTree method which will synchronize the two identity objects @inbound dictionary Is the object to synchronize against @is_self bool This is necessary because a friend has the ability to impersonate you. @permission_object dictionary This object should match the index structure of

returns void

updateFromNode(inboundNode, impersonate=False)

inboundNode is an Node instance of a friend of self and used to update the information for that friend in your friends list.

returns void

static updatePair(key, internal, internalRef, inbound, inboundRef)

This function will handle assigning a value to a key in a list or dictionary while in the updateTree method.

returns void

updateStatus(jsonData, arrayKey, elementKey, newOrUpdate)

This method will attempt to update your status automatically based on activity during the sync process.

returns void

validIdentity(data)

nodecommunicator Module

Project Versions

Table Of Contents

This Page