rabin 7 年之前
父節點
當前提交
e029979f3c
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      core.py

+ 9 - 0
core.py

@@ -158,6 +158,15 @@ class Demeter(object):
 		fromtimestamp = getattr(datetime, 'fromtimestamp')
 		return str(fromtimestamp(value).strftime(string))
 
+	@staticmethod
+	def isJson(value):
+		result = False
+		try:
+			result = json.loads(value)
+		except ValueError:
+			return result
+		return result
+
 	@staticmethod
 	def error(string):
 		print string