104 self.key_.append(x) |
106 self.key_.append(x) |
105 |
107 |
106 def clear_key(self): |
108 def clear_key(self): |
107 self.key_ = [] |
109 self.key_ = [] |
108 |
110 |
|
111 def name_space(self): return self.name_space_ |
|
112 |
|
113 def set_name_space(self, x): |
|
114 self.has_name_space_ = 1 |
|
115 self.name_space_ = x |
|
116 |
|
117 def clear_name_space(self): |
|
118 if self.has_name_space_: |
|
119 self.has_name_space_ = 0 |
|
120 self.name_space_ = "" |
|
121 |
|
122 def has_name_space(self): return self.has_name_space_ |
|
123 |
109 |
124 |
110 def MergeFrom(self, x): |
125 def MergeFrom(self, x): |
111 assert x is not self |
126 assert x is not self |
112 for i in xrange(x.key_size()): self.add_key(x.key(i)) |
127 for i in xrange(x.key_size()): self.add_key(x.key(i)) |
|
128 if (x.has_name_space()): self.set_name_space(x.name_space()) |
113 |
129 |
114 def Equals(self, x): |
130 def Equals(self, x): |
115 if x is self: return 1 |
131 if x is self: return 1 |
116 if len(self.key_) != len(x.key_): return 0 |
132 if len(self.key_) != len(x.key_): return 0 |
117 for e1, e2 in zip(self.key_, x.key_): |
133 for e1, e2 in zip(self.key_, x.key_): |
118 if e1 != e2: return 0 |
134 if e1 != e2: return 0 |
|
135 if self.has_name_space_ != x.has_name_space_: return 0 |
|
136 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 |
119 return 1 |
137 return 1 |
120 |
138 |
121 def IsInitialized(self, debug_strs=None): |
139 def IsInitialized(self, debug_strs=None): |
122 initialized = 1 |
140 initialized = 1 |
123 return initialized |
141 return initialized |
124 |
142 |
125 def ByteSize(self): |
143 def ByteSize(self): |
126 n = 0 |
144 n = 0 |
127 n += 1 * len(self.key_) |
145 n += 1 * len(self.key_) |
128 for i in xrange(len(self.key_)): n += self.lengthString(len(self.key_[i])) |
146 for i in xrange(len(self.key_)): n += self.lengthString(len(self.key_[i])) |
|
147 if (self.has_name_space_): n += 1 + self.lengthString(len(self.name_space_)) |
129 return n + 0 |
148 return n + 0 |
130 |
149 |
131 def Clear(self): |
150 def Clear(self): |
132 self.clear_key() |
151 self.clear_key() |
|
152 self.clear_name_space() |
133 |
153 |
134 def OutputUnchecked(self, out): |
154 def OutputUnchecked(self, out): |
135 for i in xrange(len(self.key_)): |
155 for i in xrange(len(self.key_)): |
136 out.putVarInt32(10) |
156 out.putVarInt32(10) |
137 out.putPrefixedString(self.key_[i]) |
157 out.putPrefixedString(self.key_[i]) |
|
158 if (self.has_name_space_): |
|
159 out.putVarInt32(18) |
|
160 out.putPrefixedString(self.name_space_) |
138 |
161 |
139 def TryMerge(self, d): |
162 def TryMerge(self, d): |
140 while d.avail() > 0: |
163 while d.avail() > 0: |
141 tt = d.getVarInt32() |
164 tt = d.getVarInt32() |
142 if tt == 10: |
165 if tt == 10: |
143 self.add_key(d.getPrefixedString()) |
166 self.add_key(d.getPrefixedString()) |
|
167 continue |
|
168 if tt == 18: |
|
169 self.set_name_space(d.getPrefixedString()) |
144 continue |
170 continue |
145 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
171 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
146 d.skipData(tt) |
172 d.skipData(tt) |
147 |
173 |
148 |
174 |
152 for e in self.key_: |
178 for e in self.key_: |
153 elm="" |
179 elm="" |
154 if printElemNumber: elm="(%d)" % cnt |
180 if printElemNumber: elm="(%d)" % cnt |
155 res+=prefix+("key%s: %s\n" % (elm, self.DebugFormatString(e))) |
181 res+=prefix+("key%s: %s\n" % (elm, self.DebugFormatString(e))) |
156 cnt+=1 |
182 cnt+=1 |
|
183 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) |
157 return res |
184 return res |
158 |
185 |
159 kkey = 1 |
186 kkey = 1 |
|
187 kname_space = 2 |
160 |
188 |
161 _TEXT = ( |
189 _TEXT = ( |
162 "ErrorCode", |
190 "ErrorCode", |
163 "key", |
191 "key", |
|
192 "name_space", |
164 ) |
193 ) |
165 |
194 |
166 _TYPES = ( |
195 _TYPES = ( |
167 ProtocolBuffer.Encoder.NUMERIC, |
196 ProtocolBuffer.Encoder.NUMERIC, |
|
197 ProtocolBuffer.Encoder.STRING, |
|
198 |
168 ProtocolBuffer.Encoder.STRING, |
199 ProtocolBuffer.Encoder.STRING, |
169 |
200 |
170 ) |
201 ) |
171 |
202 |
172 _STYLE = """""" |
203 _STYLE = """""" |
590 } |
621 } |
591 |
622 |
592 def SetPolicy_Name(cls, x): return cls._SetPolicy_NAMES.get(x, "") |
623 def SetPolicy_Name(cls, x): return cls._SetPolicy_NAMES.get(x, "") |
593 SetPolicy_Name = classmethod(SetPolicy_Name) |
624 SetPolicy_Name = classmethod(SetPolicy_Name) |
594 |
625 |
|
626 has_name_space_ = 0 |
|
627 name_space_ = "" |
595 |
628 |
596 def __init__(self, contents=None): |
629 def __init__(self, contents=None): |
597 self.item_ = [] |
630 self.item_ = [] |
598 if contents is not None: self.MergeFromString(contents) |
631 if contents is not None: self.MergeFromString(contents) |
599 |
632 |
611 self.item_.append(x) |
644 self.item_.append(x) |
612 return x |
645 return x |
613 |
646 |
614 def clear_item(self): |
647 def clear_item(self): |
615 self.item_ = [] |
648 self.item_ = [] |
|
649 def name_space(self): return self.name_space_ |
|
650 |
|
651 def set_name_space(self, x): |
|
652 self.has_name_space_ = 1 |
|
653 self.name_space_ = x |
|
654 |
|
655 def clear_name_space(self): |
|
656 if self.has_name_space_: |
|
657 self.has_name_space_ = 0 |
|
658 self.name_space_ = "" |
|
659 |
|
660 def has_name_space(self): return self.has_name_space_ |
|
661 |
616 |
662 |
617 def MergeFrom(self, x): |
663 def MergeFrom(self, x): |
618 assert x is not self |
664 assert x is not self |
619 for i in xrange(x.item_size()): self.add_item().CopyFrom(x.item(i)) |
665 for i in xrange(x.item_size()): self.add_item().CopyFrom(x.item(i)) |
|
666 if (x.has_name_space()): self.set_name_space(x.name_space()) |
620 |
667 |
621 def Equals(self, x): |
668 def Equals(self, x): |
622 if x is self: return 1 |
669 if x is self: return 1 |
623 if len(self.item_) != len(x.item_): return 0 |
670 if len(self.item_) != len(x.item_): return 0 |
624 for e1, e2 in zip(self.item_, x.item_): |
671 for e1, e2 in zip(self.item_, x.item_): |
625 if e1 != e2: return 0 |
672 if e1 != e2: return 0 |
|
673 if self.has_name_space_ != x.has_name_space_: return 0 |
|
674 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 |
626 return 1 |
675 return 1 |
627 |
676 |
628 def IsInitialized(self, debug_strs=None): |
677 def IsInitialized(self, debug_strs=None): |
629 initialized = 1 |
678 initialized = 1 |
630 for p in self.item_: |
679 for p in self.item_: |
633 |
682 |
634 def ByteSize(self): |
683 def ByteSize(self): |
635 n = 0 |
684 n = 0 |
636 n += 2 * len(self.item_) |
685 n += 2 * len(self.item_) |
637 for i in xrange(len(self.item_)): n += self.item_[i].ByteSize() |
686 for i in xrange(len(self.item_)): n += self.item_[i].ByteSize() |
|
687 if (self.has_name_space_): n += 1 + self.lengthString(len(self.name_space_)) |
638 return n + 0 |
688 return n + 0 |
639 |
689 |
640 def Clear(self): |
690 def Clear(self): |
641 self.clear_item() |
691 self.clear_item() |
|
692 self.clear_name_space() |
642 |
693 |
643 def OutputUnchecked(self, out): |
694 def OutputUnchecked(self, out): |
644 for i in xrange(len(self.item_)): |
695 for i in xrange(len(self.item_)): |
645 out.putVarInt32(11) |
696 out.putVarInt32(11) |
646 self.item_[i].OutputUnchecked(out) |
697 self.item_[i].OutputUnchecked(out) |
647 out.putVarInt32(12) |
698 out.putVarInt32(12) |
|
699 if (self.has_name_space_): |
|
700 out.putVarInt32(58) |
|
701 out.putPrefixedString(self.name_space_) |
648 |
702 |
649 def TryMerge(self, d): |
703 def TryMerge(self, d): |
650 while d.avail() > 0: |
704 while d.avail() > 0: |
651 tt = d.getVarInt32() |
705 tt = d.getVarInt32() |
652 if tt == 11: |
706 if tt == 11: |
653 self.add_item().TryMerge(d) |
707 self.add_item().TryMerge(d) |
|
708 continue |
|
709 if tt == 58: |
|
710 self.set_name_space(d.getPrefixedString()) |
654 continue |
711 continue |
655 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
712 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
656 d.skipData(tt) |
713 d.skipData(tt) |
657 |
714 |
658 |
715 |
664 if printElemNumber: elm="(%d)" % cnt |
721 if printElemNumber: elm="(%d)" % cnt |
665 res+=prefix+("Item%s {\n" % elm) |
722 res+=prefix+("Item%s {\n" % elm) |
666 res+=e.__str__(prefix + " ", printElemNumber) |
723 res+=e.__str__(prefix + " ", printElemNumber) |
667 res+=prefix+"}\n" |
724 res+=prefix+"}\n" |
668 cnt+=1 |
725 cnt+=1 |
|
726 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) |
669 return res |
727 return res |
670 |
728 |
671 kItemGroup = 1 |
729 kItemGroup = 1 |
672 kItemkey = 2 |
730 kItemkey = 2 |
673 kItemvalue = 3 |
731 kItemvalue = 3 |
674 kItemflags = 4 |
732 kItemflags = 4 |
675 kItemset_policy = 5 |
733 kItemset_policy = 5 |
676 kItemexpiration_time = 6 |
734 kItemexpiration_time = 6 |
|
735 kname_space = 7 |
677 |
736 |
678 _TEXT = ( |
737 _TEXT = ( |
679 "ErrorCode", |
738 "ErrorCode", |
680 "Item", |
739 "Item", |
681 "key", |
740 "key", |
682 "value", |
741 "value", |
683 "flags", |
742 "flags", |
684 "set_policy", |
743 "set_policy", |
685 "expiration_time", |
744 "expiration_time", |
|
745 "name_space", |
686 ) |
746 ) |
687 |
747 |
688 _TYPES = ( |
748 _TYPES = ( |
689 ProtocolBuffer.Encoder.NUMERIC, |
749 ProtocolBuffer.Encoder.NUMERIC, |
690 ProtocolBuffer.Encoder.STARTGROUP, |
750 ProtocolBuffer.Encoder.STARTGROUP, |
696 ProtocolBuffer.Encoder.FLOAT, |
756 ProtocolBuffer.Encoder.FLOAT, |
697 |
757 |
698 ProtocolBuffer.Encoder.NUMERIC, |
758 ProtocolBuffer.Encoder.NUMERIC, |
699 |
759 |
700 ProtocolBuffer.Encoder.FLOAT, |
760 ProtocolBuffer.Encoder.FLOAT, |
|
761 |
|
762 ProtocolBuffer.Encoder.STRING, |
701 |
763 |
702 ) |
764 ) |
703 |
765 |
704 _STYLE = """""" |
766 _STYLE = """""" |
705 _STYLE_CONTENT_TYPE = """""" |
767 _STYLE_CONTENT_TYPE = """""" |
896 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) |
958 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) |
897 if self.has_delete_time_: res+=prefix+("delete_time: %s\n" % self.DebugFormatFixed32(self.delete_time_)) |
959 if self.has_delete_time_: res+=prefix+("delete_time: %s\n" % self.DebugFormatFixed32(self.delete_time_)) |
898 return res |
960 return res |
899 |
961 |
900 class MemcacheDeleteRequest(ProtocolBuffer.ProtocolMessage): |
962 class MemcacheDeleteRequest(ProtocolBuffer.ProtocolMessage): |
|
963 has_name_space_ = 0 |
|
964 name_space_ = "" |
901 |
965 |
902 def __init__(self, contents=None): |
966 def __init__(self, contents=None): |
903 self.item_ = [] |
967 self.item_ = [] |
904 if contents is not None: self.MergeFromString(contents) |
968 if contents is not None: self.MergeFromString(contents) |
905 |
969 |
917 self.item_.append(x) |
981 self.item_.append(x) |
918 return x |
982 return x |
919 |
983 |
920 def clear_item(self): |
984 def clear_item(self): |
921 self.item_ = [] |
985 self.item_ = [] |
|
986 def name_space(self): return self.name_space_ |
|
987 |
|
988 def set_name_space(self, x): |
|
989 self.has_name_space_ = 1 |
|
990 self.name_space_ = x |
|
991 |
|
992 def clear_name_space(self): |
|
993 if self.has_name_space_: |
|
994 self.has_name_space_ = 0 |
|
995 self.name_space_ = "" |
|
996 |
|
997 def has_name_space(self): return self.has_name_space_ |
|
998 |
922 |
999 |
923 def MergeFrom(self, x): |
1000 def MergeFrom(self, x): |
924 assert x is not self |
1001 assert x is not self |
925 for i in xrange(x.item_size()): self.add_item().CopyFrom(x.item(i)) |
1002 for i in xrange(x.item_size()): self.add_item().CopyFrom(x.item(i)) |
|
1003 if (x.has_name_space()): self.set_name_space(x.name_space()) |
926 |
1004 |
927 def Equals(self, x): |
1005 def Equals(self, x): |
928 if x is self: return 1 |
1006 if x is self: return 1 |
929 if len(self.item_) != len(x.item_): return 0 |
1007 if len(self.item_) != len(x.item_): return 0 |
930 for e1, e2 in zip(self.item_, x.item_): |
1008 for e1, e2 in zip(self.item_, x.item_): |
931 if e1 != e2: return 0 |
1009 if e1 != e2: return 0 |
|
1010 if self.has_name_space_ != x.has_name_space_: return 0 |
|
1011 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 |
932 return 1 |
1012 return 1 |
933 |
1013 |
934 def IsInitialized(self, debug_strs=None): |
1014 def IsInitialized(self, debug_strs=None): |
935 initialized = 1 |
1015 initialized = 1 |
936 for p in self.item_: |
1016 for p in self.item_: |
939 |
1019 |
940 def ByteSize(self): |
1020 def ByteSize(self): |
941 n = 0 |
1021 n = 0 |
942 n += 2 * len(self.item_) |
1022 n += 2 * len(self.item_) |
943 for i in xrange(len(self.item_)): n += self.item_[i].ByteSize() |
1023 for i in xrange(len(self.item_)): n += self.item_[i].ByteSize() |
|
1024 if (self.has_name_space_): n += 1 + self.lengthString(len(self.name_space_)) |
944 return n + 0 |
1025 return n + 0 |
945 |
1026 |
946 def Clear(self): |
1027 def Clear(self): |
947 self.clear_item() |
1028 self.clear_item() |
|
1029 self.clear_name_space() |
948 |
1030 |
949 def OutputUnchecked(self, out): |
1031 def OutputUnchecked(self, out): |
950 for i in xrange(len(self.item_)): |
1032 for i in xrange(len(self.item_)): |
951 out.putVarInt32(11) |
1033 out.putVarInt32(11) |
952 self.item_[i].OutputUnchecked(out) |
1034 self.item_[i].OutputUnchecked(out) |
953 out.putVarInt32(12) |
1035 out.putVarInt32(12) |
|
1036 if (self.has_name_space_): |
|
1037 out.putVarInt32(34) |
|
1038 out.putPrefixedString(self.name_space_) |
954 |
1039 |
955 def TryMerge(self, d): |
1040 def TryMerge(self, d): |
956 while d.avail() > 0: |
1041 while d.avail() > 0: |
957 tt = d.getVarInt32() |
1042 tt = d.getVarInt32() |
958 if tt == 11: |
1043 if tt == 11: |
959 self.add_item().TryMerge(d) |
1044 self.add_item().TryMerge(d) |
|
1045 continue |
|
1046 if tt == 34: |
|
1047 self.set_name_space(d.getPrefixedString()) |
960 continue |
1048 continue |
961 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
1049 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
962 d.skipData(tt) |
1050 d.skipData(tt) |
963 |
1051 |
964 |
1052 |
970 if printElemNumber: elm="(%d)" % cnt |
1058 if printElemNumber: elm="(%d)" % cnt |
971 res+=prefix+("Item%s {\n" % elm) |
1059 res+=prefix+("Item%s {\n" % elm) |
972 res+=e.__str__(prefix + " ", printElemNumber) |
1060 res+=e.__str__(prefix + " ", printElemNumber) |
973 res+=prefix+"}\n" |
1061 res+=prefix+"}\n" |
974 cnt+=1 |
1062 cnt+=1 |
|
1063 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) |
975 return res |
1064 return res |
976 |
1065 |
977 kItemGroup = 1 |
1066 kItemGroup = 1 |
978 kItemkey = 2 |
1067 kItemkey = 2 |
979 kItemdelete_time = 3 |
1068 kItemdelete_time = 3 |
|
1069 kname_space = 4 |
980 |
1070 |
981 _TEXT = ( |
1071 _TEXT = ( |
982 "ErrorCode", |
1072 "ErrorCode", |
983 "Item", |
1073 "Item", |
984 "key", |
1074 "key", |
985 "delete_time", |
1075 "delete_time", |
|
1076 "name_space", |
986 ) |
1077 ) |
987 |
1078 |
988 _TYPES = ( |
1079 _TYPES = ( |
989 ProtocolBuffer.Encoder.NUMERIC, |
1080 ProtocolBuffer.Encoder.NUMERIC, |
990 ProtocolBuffer.Encoder.STARTGROUP, |
1081 ProtocolBuffer.Encoder.STARTGROUP, |
991 |
1082 |
992 ProtocolBuffer.Encoder.STRING, |
1083 ProtocolBuffer.Encoder.STRING, |
993 |
1084 |
994 ProtocolBuffer.Encoder.FLOAT, |
1085 ProtocolBuffer.Encoder.FLOAT, |
|
1086 |
|
1087 ProtocolBuffer.Encoder.STRING, |
995 |
1088 |
996 ) |
1089 ) |
997 |
1090 |
998 _STYLE = """""" |
1091 _STYLE = """""" |
999 _STYLE_CONTENT_TYPE = """""" |
1092 _STYLE_CONTENT_TYPE = """""" |
1129 self.has_key_ = 0 |
1224 self.has_key_ = 0 |
1130 self.key_ = "" |
1225 self.key_ = "" |
1131 |
1226 |
1132 def has_key(self): return self.has_key_ |
1227 def has_key(self): return self.has_key_ |
1133 |
1228 |
|
1229 def name_space(self): return self.name_space_ |
|
1230 |
|
1231 def set_name_space(self, x): |
|
1232 self.has_name_space_ = 1 |
|
1233 self.name_space_ = x |
|
1234 |
|
1235 def clear_name_space(self): |
|
1236 if self.has_name_space_: |
|
1237 self.has_name_space_ = 0 |
|
1238 self.name_space_ = "" |
|
1239 |
|
1240 def has_name_space(self): return self.has_name_space_ |
|
1241 |
1134 def delta(self): return self.delta_ |
1242 def delta(self): return self.delta_ |
1135 |
1243 |
1136 def set_delta(self, x): |
1244 def set_delta(self, x): |
1137 self.has_delta_ = 1 |
1245 self.has_delta_ = 1 |
1138 self.delta_ = x |
1246 self.delta_ = x |
1159 |
1267 |
1160 |
1268 |
1161 def MergeFrom(self, x): |
1269 def MergeFrom(self, x): |
1162 assert x is not self |
1270 assert x is not self |
1163 if (x.has_key()): self.set_key(x.key()) |
1271 if (x.has_key()): self.set_key(x.key()) |
|
1272 if (x.has_name_space()): self.set_name_space(x.name_space()) |
1164 if (x.has_delta()): self.set_delta(x.delta()) |
1273 if (x.has_delta()): self.set_delta(x.delta()) |
1165 if (x.has_direction()): self.set_direction(x.direction()) |
1274 if (x.has_direction()): self.set_direction(x.direction()) |
1166 |
1275 |
1167 def Equals(self, x): |
1276 def Equals(self, x): |
1168 if x is self: return 1 |
1277 if x is self: return 1 |
1169 if self.has_key_ != x.has_key_: return 0 |
1278 if self.has_key_ != x.has_key_: return 0 |
1170 if self.has_key_ and self.key_ != x.key_: return 0 |
1279 if self.has_key_ and self.key_ != x.key_: return 0 |
|
1280 if self.has_name_space_ != x.has_name_space_: return 0 |
|
1281 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 |
1171 if self.has_delta_ != x.has_delta_: return 0 |
1282 if self.has_delta_ != x.has_delta_: return 0 |
1172 if self.has_delta_ and self.delta_ != x.delta_: return 0 |
1283 if self.has_delta_ and self.delta_ != x.delta_: return 0 |
1173 if self.has_direction_ != x.has_direction_: return 0 |
1284 if self.has_direction_ != x.has_direction_: return 0 |
1174 if self.has_direction_ and self.direction_ != x.direction_: return 0 |
1285 if self.has_direction_ and self.direction_ != x.direction_: return 0 |
1175 return 1 |
1286 return 1 |
1183 return initialized |
1294 return initialized |
1184 |
1295 |
1185 def ByteSize(self): |
1296 def ByteSize(self): |
1186 n = 0 |
1297 n = 0 |
1187 n += self.lengthString(len(self.key_)) |
1298 n += self.lengthString(len(self.key_)) |
|
1299 if (self.has_name_space_): n += 1 + self.lengthString(len(self.name_space_)) |
1188 if (self.has_delta_): n += 1 + self.lengthVarInt64(self.delta_) |
1300 if (self.has_delta_): n += 1 + self.lengthVarInt64(self.delta_) |
1189 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_) |
1301 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_) |
1190 return n + 1 |
1302 return n + 1 |
1191 |
1303 |
1192 def Clear(self): |
1304 def Clear(self): |
1193 self.clear_key() |
1305 self.clear_key() |
|
1306 self.clear_name_space() |
1194 self.clear_delta() |
1307 self.clear_delta() |
1195 self.clear_direction() |
1308 self.clear_direction() |
1196 |
1309 |
1197 def OutputUnchecked(self, out): |
1310 def OutputUnchecked(self, out): |
1198 out.putVarInt32(10) |
1311 out.putVarInt32(10) |
1201 out.putVarInt32(16) |
1314 out.putVarInt32(16) |
1202 out.putVarUint64(self.delta_) |
1315 out.putVarUint64(self.delta_) |
1203 if (self.has_direction_): |
1316 if (self.has_direction_): |
1204 out.putVarInt32(24) |
1317 out.putVarInt32(24) |
1205 out.putVarInt32(self.direction_) |
1318 out.putVarInt32(self.direction_) |
|
1319 if (self.has_name_space_): |
|
1320 out.putVarInt32(34) |
|
1321 out.putPrefixedString(self.name_space_) |
1206 |
1322 |
1207 def TryMerge(self, d): |
1323 def TryMerge(self, d): |
1208 while d.avail() > 0: |
1324 while d.avail() > 0: |
1209 tt = d.getVarInt32() |
1325 tt = d.getVarInt32() |
1210 if tt == 10: |
1326 if tt == 10: |
1214 self.set_delta(d.getVarUint64()) |
1330 self.set_delta(d.getVarUint64()) |
1215 continue |
1331 continue |
1216 if tt == 24: |
1332 if tt == 24: |
1217 self.set_direction(d.getVarInt32()) |
1333 self.set_direction(d.getVarInt32()) |
1218 continue |
1334 continue |
|
1335 if tt == 34: |
|
1336 self.set_name_space(d.getPrefixedString()) |
|
1337 continue |
1219 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
1338 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
1220 d.skipData(tt) |
1339 d.skipData(tt) |
1221 |
1340 |
1222 |
1341 |
1223 def __str__(self, prefix="", printElemNumber=0): |
1342 def __str__(self, prefix="", printElemNumber=0): |
1224 res="" |
1343 res="" |
1225 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) |
1344 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) |
|
1345 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) |
1226 if self.has_delta_: res+=prefix+("delta: %s\n" % self.DebugFormatInt64(self.delta_)) |
1346 if self.has_delta_: res+=prefix+("delta: %s\n" % self.DebugFormatInt64(self.delta_)) |
1227 if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_)) |
1347 if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_)) |
1228 return res |
1348 return res |
1229 |
1349 |
1230 kkey = 1 |
1350 kkey = 1 |
|
1351 kname_space = 4 |
1231 kdelta = 2 |
1352 kdelta = 2 |
1232 kdirection = 3 |
1353 kdirection = 3 |
1233 |
1354 |
1234 _TEXT = ( |
1355 _TEXT = ( |
1235 "ErrorCode", |
1356 "ErrorCode", |
1236 "key", |
1357 "key", |
1237 "delta", |
1358 "delta", |
1238 "direction", |
1359 "direction", |
|
1360 "name_space", |
1239 ) |
1361 ) |
1240 |
1362 |
1241 _TYPES = ( |
1363 _TYPES = ( |
1242 ProtocolBuffer.Encoder.NUMERIC, |
1364 ProtocolBuffer.Encoder.NUMERIC, |
1243 ProtocolBuffer.Encoder.STRING, |
1365 ProtocolBuffer.Encoder.STRING, |
1244 |
1366 |
1245 ProtocolBuffer.Encoder.NUMERIC, |
1367 ProtocolBuffer.Encoder.NUMERIC, |
1246 |
1368 |
1247 ProtocolBuffer.Encoder.NUMERIC, |
1369 ProtocolBuffer.Encoder.NUMERIC, |
|
1370 |
|
1371 ProtocolBuffer.Encoder.STRING, |
1248 |
1372 |
1249 ) |
1373 ) |
1250 |
1374 |
1251 _STYLE = """""" |
1375 _STYLE = """""" |
1252 _STYLE_CONTENT_TYPE = """""" |
1376 _STYLE_CONTENT_TYPE = """""" |