|
from Base.Class.Json import *
|
|
from Base.Class.Yaml import *
|
|
|
|
|
|
def auto_decode(data):
|
|
if data is None:
|
|
return None
|
|
try:
|
|
try:
|
|
return json_decode(data)
|
|
except:
|
|
return yaml_decode(data)
|
|
except:
|
|
raise Exception('非Json或Yaml数据格式 | String in not a Json or Yaml format.')
|