mirror of
https://github.com/star-inc/yuuki.git
synced 2024-11-10 17:13:10 +08:00
v6.5.0-alpha_RC2
This commit is contained in:
parent
1985c8f4ed
commit
9f286fe7b0
1 changed files with 4 additions and 4 deletions
|
@ -131,15 +131,15 @@ class Yuuki_Data:
|
||||||
return time.strftime(format, Time)
|
return time.strftime(format, Time)
|
||||||
|
|
||||||
def getData(self, Type, Query=None):
|
def getData(self, Type, Query=None):
|
||||||
if type(Query) == list:
|
if Query != None:
|
||||||
if len(Query) == 1:
|
if type(Query) == str:
|
||||||
if Query not in self.Data[Type]:
|
if Query not in self.Data[Type]:
|
||||||
if Type in self.initType:
|
if Type in self.initType:
|
||||||
self.Data[Type][Query] = self.initType[Type]
|
self.Data[Type][Query] = self.initType[Type]
|
||||||
else:
|
else:
|
||||||
assert "Unknown DataType"
|
assert "Unknown DataType"
|
||||||
return self.Data[Type][Query]
|
return self.Data[Type][Query]
|
||||||
elif len(Query) == 2:
|
elif type(Query) == list and len(Query) == 2:
|
||||||
if Query[0] not in self.Data[Type]:
|
if Query[0] not in self.Data[Type]:
|
||||||
if Type in self.initType:
|
if Type in self.initType:
|
||||||
self.Data[Type][Query[0]] = self.initType[Type]
|
self.Data[Type][Query[0]] = self.initType[Type]
|
||||||
|
@ -152,7 +152,7 @@ class Yuuki_Data:
|
||||||
assert "Unknown DataType"
|
assert "Unknown DataType"
|
||||||
return self.Data[Type][Query[0]][Query[1]]
|
return self.Data[Type][Query[0]][Query[1]]
|
||||||
else:
|
else:
|
||||||
assert "Error Query Level"
|
assert "Error Query"
|
||||||
else:
|
else:
|
||||||
return self.Data[Type]
|
return self.Data[Type]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue