Commit 368f5366 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cd63c735
......@@ -23,6 +23,7 @@
def main():
pyprotog = {}
execfile('../../neo/lib/protocol.py', pyprotog)
pypacket = pyprotog['Packet']
pypackets = pyprotog['Packets']
# dump to go what to expect
......@@ -33,11 +34,31 @@ def main():
emit("package neo")
emit("\nvar pyMsgRegistry = map[uint16]string{")
pycodev = pypackets.keys()
pycodev.sort()
for pycode in pycodev:
pymsg = pypackets[pycode]
emit('\t%d:\t"%s",' % (pycode, pymsg.__name__))
# access packet structures by names they are defined under Packets
# class and thus in neo/py code which uses them.
#
# ( this is not the same as packet class name as e.g. currently
# AcceptIdentification has class name AnswerRequestIdentification )
pypktv = []
for k in dir(pypackets):
v = getattr(pypackets, k)
if isinstance(v, type) and issubclass(v, pypacket):
v._x_use_name = k
pypktv.append(v)
# order by message code
pypktv.sort(key=lambda pkt: pkt._code)
for pypkt in pypktv:
emit('\t%d:\t"%s",' % (pypkt._code, pypkt._x_use_name))
#pycodev = pypackets.keys()
#pycodev.sort()
#for pycode in pycodev:
# pymsg = pypackets[pycode]
# emit('\t%d:\t"%s",' % (pycode, pymsg.__name__))
emit("}")
if __name__ == '__main__':
......
......@@ -5,71 +5,71 @@ var pyMsgRegistry = map[uint16]string{
1: "RequestIdentification",
3: "Ping",
5: "CloseClient",
6: "PrimaryMaster",
6: "AskPrimary",
8: "NotPrimaryMaster",
9: "NotifyNodeInformation",
10: "Recovery",
12: "LastIDs",
14: "PartitionTable",
16: "NotifyPartitionTable",
17: "PartitionChanges",
10: "AskRecovery",
12: "AskLastIDs",
14: "AskPartitionTable",
16: "SendPartitionTable",
17: "NotifyPartitionChanges",
18: "StartOperation",
19: "StopOperation",
20: "UnfinishedTransactions",
22: "LockedTransactions",
24: "FinalTID",
20: "AskUnfinishedTransactions",
22: "AskLockedTransactions",
24: "AskFinalTID",
26: "ValidateTransaction",
27: "BeginTransaction",
27: "AskBeginTransaction",
29: "FailedVote",
30: "FinishTransaction",
32: "LockInformation",
30: "AskFinishTransaction",
32: "AskLockInformation",
34: "InvalidateObjects",
35: "UnlockInformation",
36: "GenerateOIDs",
38: "Deadlock",
39: "RebaseTransaction",
41: "RebaseObject",
43: "StoreObject",
35: "NotifyUnlockInformation",
36: "AskNewOIDs",
38: "NotifyDeadlock",
39: "AskRebaseTransaction",
41: "AskRebaseObject",
43: "AskStoreObject",
45: "AbortTransaction",
46: "StoreTransaction",
48: "VoteTransaction",
50: "GetObject",
52: "TIDList",
54: "TransactionInformation",
56: "ObjectHistory",
58: "PartitionList",
60: "NodeList",
46: "AskStoreTransaction",
48: "AskVoteTransaction",
50: "AskObject",
52: "AskTIDs",
54: "AskTransactionInformation",
56: "AskObjectHistory",
58: "AskPartitionList",
60: "AskNodeList",
62: "SetNodeState",
63: "AddPendingNodes",
64: "TweakPartitionTable",
65: "SetClusterState",
66: "Repair",
67: "RepairOne",
68: "ClusterInformation",
69: "ClusterState",
71: "ObjectUndoSerial",
73: "TIDListFrom",
75: "Pack",
67: "NotifyRepair",
68: "NotifyClusterInformation",
69: "AskClusterState",
71: "AskObjectUndoSerial",
73: "AskTIDsFrom",
75: "AskPack",
77: "CheckReplicas",
78: "CheckPartition",
79: "CheckTIDRange",
81: "CheckSerialRange",
83: "PartitionCorrupted",
79: "AskCheckTIDRange",
81: "AskCheckSerialRange",
83: "NotifyPartitionCorrupted",
84: "NotifyReady",
85: "LastTransaction",
87: "CheckCurrentSerial",
85: "AskLastTransaction",
87: "AskCheckCurrentSerial",
89: "NotifyTransactionFinished",
90: "Replicate",
91: "ReplicationDone",
92: "FetchTransactions",
94: "FetchObjects",
91: "NotifyReplicationDone",
92: "AskFetchTransactions",
94: "AskFetchObjects",
96: "AddTransaction",
97: "AddObject",
98: "Truncate",
32768: "Error",
32769: "AnswerRequestIdentification",
32771: "AnswerPing",
32774: "AnswerPrimaryMaster",
32769: "AcceptIdentification",
32771: "Pong",
32774: "AnswerPrimary",
32778: "AnswerRecovery",
32780: "AnswerLastIDs",
32782: "AnswerPartitionTable",
......@@ -77,23 +77,23 @@ var pyMsgRegistry = map[uint16]string{
32790: "AnswerLockedTransactions",
32792: "AnswerFinalTID",
32795: "AnswerBeginTransaction",
32798: "AnswerFinishTransaction",
32800: "AnswerLockInformation",
32804: "AnswerGenerateOIDs",
32798: "AnswerTransactionFinished",
32800: "AnswerInformationLocked",
32804: "AnswerNewOIDs",
32807: "AnswerRebaseTransaction",
32809: "AnswerRebaseObject",
32811: "AnswerStoreObject",
32814: "AnswerStoreTransaction",
32816: "AnswerVoteTransaction",
32818: "AnswerGetObject",
32820: "AnswerTIDList",
32818: "AnswerObject",
32820: "AnswerTIDs",
32822: "AnswerTransactionInformation",
32824: "AnswerObjectHistory",
32826: "AnswerPartitionList",
32828: "AnswerNodeList",
32837: "AnswerClusterState",
32839: "AnswerObjectUndoSerial",
32841: "AnswerTIDListFrom",
32841: "AnswerTIDsFrom",
32843: "AnswerPack",
32847: "AnswerCheckTIDRange",
32849: "AnswerCheckSerialRange",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment