anoy 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {anoy-0.3.0/src/anoy.egg-info → anoy-0.3.1}/PKG-INFO +1 -1
- {anoy-0.3.0 → anoy-0.3.1}/pyproject.toml +1 -1
- {anoy-0.3.0 → anoy-0.3.1/src/anoy.egg-info}/PKG-INFO +1 -1
- {anoy-0.3.0 → anoy-0.3.1}/src/cli.py +1 -1
- {anoy-0.3.0 → anoy-0.3.1}/src/modules/dictTraversal.py +25 -12
- {anoy-0.3.0 → anoy-0.3.1}/LICENSE.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/README.md +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/setup.cfg +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/anoy.egg-info/SOURCES.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/anoy.egg-info/dependency_links.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/anoy.egg-info/entry_points.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/anoy.egg-info/requires.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/anoy.egg-info/top_level.txt +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/modules/__init__.py +0 -0
- {anoy-0.3.0 → anoy-0.3.1}/src/modules/errors.py +0 -0
|
@@ -67,12 +67,16 @@ class DictTraversal():
|
|
|
67
67
|
newConfigDict={} # 整形されたconfigDict
|
|
68
68
|
for annoKey in configDict.keys():
|
|
69
69
|
newAnnoValue={} #annotation keyに対応する値。
|
|
70
|
-
if(annoKey
|
|
70
|
+
if(type(annoKey)!=str):
|
|
71
|
+
raise ConfigYamlError([annoKey],"Annotaion key should start with `@`.")
|
|
72
|
+
elif(annoKey[0]!="@"):
|
|
71
73
|
raise ConfigYamlError([annoKey],"Annotaion key should start with `@`.")
|
|
72
74
|
valueDict=configDict[annoKey]
|
|
73
75
|
if(type(valueDict)!=dict):
|
|
74
76
|
raise ConfigYamlError([annoKey])
|
|
75
77
|
for key,value in valueDict.items():
|
|
78
|
+
if(type(key)!=str):
|
|
79
|
+
raise ConfigYamlError([annoKey,key], "Invalid value as !Parent.")
|
|
76
80
|
if(key[0]=="@"):
|
|
77
81
|
continue
|
|
78
82
|
elif(key=="!Parent"):
|
|
@@ -82,7 +86,7 @@ class DictTraversal():
|
|
|
82
86
|
validConfChild=self.checkChild(annoKey,value)
|
|
83
87
|
newAnnoValue["!Child"]=validConfChild
|
|
84
88
|
else:
|
|
85
|
-
raise ConfigYamlError([annoKey], "
|
|
89
|
+
raise ConfigYamlError([annoKey,key], "Invalid value as !Parent.")
|
|
86
90
|
# isVisit keyの追加。
|
|
87
91
|
newAnnoValue["isVisit"]=False
|
|
88
92
|
newConfigDict[annoKey]=newAnnoValue
|
|
@@ -246,7 +250,9 @@ class DictTraversal():
|
|
|
246
250
|
raise ConfigYamlError([annoKey,"!Child","!AnnoMap"])
|
|
247
251
|
for i in range(len(typeOption)):
|
|
248
252
|
item=typeOption[i]
|
|
249
|
-
if(item
|
|
253
|
+
if(type(item)!=str):
|
|
254
|
+
raise ConfigYamlError([annoKey,"!Child","!AnnoMap",item])
|
|
255
|
+
elif(item[0]!="@"):
|
|
250
256
|
raise ConfigYamlError([annoKey,"!Child","!AnnoMap",item])
|
|
251
257
|
return {"!AnnoMap":typeOption}
|
|
252
258
|
case _:
|
|
@@ -355,18 +361,24 @@ class DictTraversal():
|
|
|
355
361
|
self._pathQueue.append(newPath)
|
|
356
362
|
elif(type(childValue)==dict):
|
|
357
363
|
# !Child=nullであってもfree keyとannotation keyの混合は許さない。
|
|
364
|
+
# keyがstr型でない時は!FreeMapとして扱う。
|
|
358
365
|
isAnnoMap=None
|
|
359
366
|
for key,value in childValue.items():
|
|
360
|
-
if(
|
|
361
|
-
if(
|
|
362
|
-
isAnnoMap=True
|
|
363
|
-
else:
|
|
367
|
+
if(type(key)!=str):
|
|
368
|
+
if(isAnnoMap is None):
|
|
364
369
|
isAnnoMap=False
|
|
365
|
-
|
|
366
|
-
if(isAnnoMap==True and key[0]!="@"):
|
|
370
|
+
elif(isAnnoMap==True):
|
|
367
371
|
raise AnnotationTypeError(self._curAnoy,self._anoyPath,"!AnnoMap")
|
|
368
|
-
|
|
372
|
+
elif(key[0]=="@"):
|
|
373
|
+
if(isAnnoMap is None):
|
|
374
|
+
isAnnoMap=True
|
|
375
|
+
elif(isAnnoMap==False):
|
|
369
376
|
raise AnnotationTypeError(self._curAnoy,self._anoyPath,"!FreeMap")
|
|
377
|
+
else:
|
|
378
|
+
if(isAnnoMap is None):
|
|
379
|
+
isAnnoMap=False
|
|
380
|
+
elif(isAnnoMap==True):
|
|
381
|
+
raise AnnotationTypeError(self._curAnoy,self._anoyPath,"!AnnoMap")
|
|
370
382
|
newPath=self._anoyPath+[key]
|
|
371
383
|
self._visitQueue.append((key,value))
|
|
372
384
|
self._pathQueue.append(newPath)
|
|
@@ -511,8 +523,9 @@ class DictTraversal():
|
|
|
511
523
|
newPath=self._anoyPath+[key]
|
|
512
524
|
self._visitQueue.append((key,value))
|
|
513
525
|
self._pathQueue.append(newPath)
|
|
514
|
-
if(key
|
|
515
|
-
|
|
526
|
+
if(type(key)==str):
|
|
527
|
+
if(key[0]=="@"):
|
|
528
|
+
raise AnnotationTypeError(self._curAnoy,newPath,"!FreeMap")
|
|
516
529
|
else:
|
|
517
530
|
raise AnnotationTypeError(self._curAnoy,self._anoyPath,"!FreeMap")
|
|
518
531
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|