forked from KeyviDev/keyvi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce4f1cc
commit 8143b21
Showing
7 changed files
with
63 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
|
||
|
||
def Get(self, index ): | ||
def __getitem__(self, index ): | ||
assert isinstance(index, (int, long)), 'arg index wrong type' | ||
|
||
cdef libcpp_utf8_string _r = self.inst.get().Get((<size_t>index)) | ||
py_result = json.loads(_r.decode('utf-8')) | ||
return py_result | ||
|
||
def Get(self, *args): | ||
return call_deprecated_method("Get", "__getitem__", self.__getitem__, *args) | ||
|
||
def Size(self, *args): | ||
return call_deprecated_method("Size", "__len__", self.__len__, *args) | ||
|
||
def Manifest(self, *args): | ||
return call_deprecated_method("Manifest", "manifest", self.manifest, *args) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
|
||
|
||
def PushBack(self, in_0 ): | ||
def append(self, in_0 ): | ||
dumps = json.dumps(in_0).encode('utf-8') | ||
self.inst.get().PushBack((<libcpp_utf8_string>dumps)) | ||
|
||
def PushBack(self, *args): | ||
return call_deprecated_method("PushBack", "append", self.append, *args) | ||
|
||
def SetManifest(self, *args): | ||
return call_deprecated_method("SetManifest", "set_manifest", self.set_manifest, *args) | ||
|
||
def WriteToFile(self, *args): | ||
return call_deprecated_method("WriteToFile", "write_to_file", self.write_to_file, *args) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
def Get(self, *args): | ||
return call_deprecated_method("Get", "__getitem__", self.__getitem__, *args) | ||
|
||
def Size(self, *args): | ||
return call_deprecated_method("Size", "__len__", self.__len__, *args) | ||
|
||
def Manifest(self, *args): | ||
return call_deprecated_method("Manifest", "manifest", self.manifest, *args) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
def PushBack(self, *args): | ||
return call_deprecated_method("PushBack", "append", self.append, *args) | ||
|
||
def SetManifest(self, *args): | ||
return call_deprecated_method("SetManifest", "set_manifest", self.set_manifest, *args) | ||
|
||
def WriteToFile(self, *args): | ||
return call_deprecated_method("WriteToFile", "write_to_file", self.write_to_file, *args) |
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
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
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