File tree Expand file tree Collapse file tree 2 files changed +29
-12
lines changed
Expand file tree Collapse file tree 2 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 3333 'Web Mercator'
3434}
3535
36- # A set of category folder names for legacy support .
36+ # A set of category folder names.
3737categories = {
38- 'Maps' ,
39- 'Layers' ,
40- 'Features' ,
41- 'Display information' ,
42- 'Search' ,
43- 'Edit data' ,
44- 'Geometry' ,
45- 'Route and directions' ,
4638 'Analysis' ,
47- 'Cloud and portal' ,
39+ 'Augmented Reality' ,
40+ 'Cloud and Portal' ,
41+ 'Edit and Manage Data' ,
42+ 'Layers' ,
43+ 'Maps' ,
4844 'Scenes' ,
49- 'Utility network' ,
50- 'Augmented reality'
45+ 'Routing and Logistics' ,
46+ 'Search and Query' ,
47+ 'Utility Networks' ,
48+ 'Visualization'
5149}
5250# endregion
5351
@@ -379,6 +377,19 @@ def flush_to_json_string(self) -> str:
379377
380378 return json .dumps (data , indent = 4 , sort_keys = True )
381379
380+ def check_category (self ) -> None :
381+ """
382+ Check if
383+ 1. metadata contains a category.
384+ 2. category is valid.
385+
386+ :return: None. Throws if exception occurs.
387+ """
388+ if not self .category :
389+ raise Exception (f'Error category - Missing category.' )
390+ elif self .category not in categories :
391+ raise Exception (f'Error category - Invalid category - "{ self .category } ".' )
392+
382393
383394class Readme :
384395 essential_headers = {
Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ def run_check(path: str) -> None:
7878 diff = '\n ' .join (unified_diff (expected , actual ))
7979 raise Exception (f'Error inconsistent metadata - { path } - { diff } ' )
8080
81+ # 4. Check category.
82+ try :
83+ checker .check_category ()
84+ except Exception as err :
85+ raise Exception (f'{ checker .folder_path } - { err } ' )
86+
8187
8288def all_samples (path : str ):
8389 """
You can’t perform that action at this time.
0 commit comments