Package nbxmpp :: Module protocol :: Class Hashes

[hide private]
[frames] | no frames]

# Class Hashes

source code

Hash elements for various XEPs as defined in XEP-300

Instance Methods | [hide private]

__init__(self, nsp=`'``urn:xmpp:hashes:1``'`)
Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of. Also the __init__ can be provided with "node" argument that is either a text string containing exactly one node or another Node instance to begin with. If both "node" and other arguments is provided then the node initially created as replica of "node" provided and then modified to be compliant with other arguments.

source code

calculateHash(self, algo, file_string) Calculate the hash and add it. It is preferable doing it here instead of doing it all over the place in Gajim. | source code

addHash(self, hash_, algo) | source code

Inherited from `simplexml.Node`: `__contains__`, `__delitem__`, `__getattr__`, `__getitem__`, `__setitem__`, `__str__`, `addChild`, `addData`, `clearData`, `delAttr`, `delChild`, `getAttr`, `getAttrs`, `getChildren`, `getData`, `getName`, `getNamespace`, `getParent`, `getPayload`, `getTag`, `getTagAttr`, `getTagData`, `getTags`, `has_attr`, `iterTags`, `lookup_nsp`, `setAttr`, `setData`, `setName`, `setNamespace`, `setParent`, `setPayload`, `setTag`, `setTagAttr`, `setTagData`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| supported = ``(``'``md5``'``,` `'``sha-1``'``,` `'``sha-256``'``,` `'``sha-512``'``)``
Inherited from `simplexml.Node`: `FORCE_NODE_RECREATION`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, nsp=`'``urn:xmpp:hashes:1``'`)
(Constructor)

source code

Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of. Also the __init__ can be provided with "node" argument that is either a text string containing exactly one node or another Node instance to begin with. If both "node" and other arguments is provided then the node initially created as replica of "node" provided and then modified to be compliant with other arguments.

Overrides: object.__init__
  (inherited documentation)

### calculateHash(self, algo, file_string)

source code

Calculate the hash and add it. It is preferable doing it here instead of doing it all over the place in Gajim.

### addHash(self, hash_, algo)

source code

Class Variable Details | [hide private]

### supported

Value:

      ('md5', 'sha-1', 'sha-256', 'sha-512')