Last active
December 23, 2015 12:19
-
-
Save jirihnidek/6634901 to your computer and use it in GitHub Desktop.
Subclassing of VerseNode and VerseTag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vrsent as v | |
class CustomNode(v.VerseNode): | |
""" | |
Custom subclass of VeseNode | |
""" | |
custom_type = 10 | |
def __str__(self): | |
""" | |
Custrom string representation | |
""" | |
return 'CustomNode, id' + str(self.id) | |
@classmethod | |
def _receive_node_create(cls, session, node_id, parent_id, user_id, custom_type): | |
""" | |
Custom callback method | |
""" | |
print('Custom create callback method') | |
return super(CustomNode, cls)._receive_node_create(session, node_id, \ | |
parent_id, user_id, custom_type) | |
s = v.VerseSession(hostname='localhost', service='12344', \ | |
callback_thread=True, username='your_name', password='your_pass') | |
n = v.VerseNode(s, custom_type=10) | |
print(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment