Permalink
Browse files

Improve get records stdout

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information...
1 parent 1fd3097 commit 5b4e1274aacd00bfd70ed737028c3d4ee320600e @mkouhei committed Apr 27, 2012
Showing with 15 additions and 1 deletion.
  1. +4 −0 src/tonicdnscli/converter.py
  2. +11 −1 src/tonicdnscli/processing.py
View
4 src/tonicdnscli/converter.py
@@ -91,3 +91,7 @@ def separateInputFile(self, file):
line_index += 1
separated_str += line
self.separated_list.append(separated_str)
+
+ def decodeJSON(self, data):
+ import json
+ json.load(data, 'utf-8')
View
12 src/tonicdnscli/processing.py
@@ -53,7 +53,6 @@ def tonicDNSClient(uri, method, token, data):
if method == 'GET':
datas = json.loads(url.read().decode('utf-8'))
formattedPrint(datas)
-
else:
data = url.read()
print(data)
@@ -165,3 +164,14 @@ def getAllTemplates():
# method: GET
# uri: /template
unprovide()
+
+
+def searchRecord(key, type, data):
+ # search target JSON -> dictionary
+ # key target is "name" or "content"
+ # type is "type", default null
+ # either key and type, or on the other hand
+ # data is dictionaly
+ import re
+ for item in data:
+ re.search(key, str(item['key']))

0 comments on commit 5b4e127

Please sign in to comment.