88import pathlib
99import re
1010import sys
11- from typing import Dict , List , Optional , TextIO , Tuple
11+ from typing import Any , Optional , TextIO
1212
1313
14- def main (args : List [str ]) -> None :
14+ def main (args : list [str ]) -> None :
1515 """The main function.
1616
1717 Args:
@@ -28,7 +28,7 @@ def main(args: List[str]) -> None:
2828 wxs_path = pathlib .Path (args [1 ])
2929
3030 destination_tree : _DestinationDirectory = _build_destination_tree (source_path )
31- feature_map : Dict [str , List [str ]] = _build_feature_map (destination_tree )
31+ feature_map : dict [str , list [str ]] = _build_feature_map (destination_tree )
3232 _save_wxs (destination_tree , feature_map , wxs_path )
3333
3434
@@ -76,17 +76,17 @@ class _DestinationDirectory:
7676
7777 level : int
7878
79- children : Dict
79+ children : dict [ str , Any ]
8080
81- files : List [File ]
81+ files : list [File ]
8282
83- envvars : List [EnvVar ]
83+ envvars : list [EnvVar ]
8484
8585 def __init__ (self , id : str , name : str , level : int ):
8686 self .id = id
8787 self .name = name
8888 self .level = level
89- self .children : Dict [str , _DestinationDirectory ] = {}
89+ self .children : dict [str , _DestinationDirectory ] = {}
9090 self .files = []
9191 self .envvars = []
9292
@@ -154,14 +154,14 @@ def _build_destination_tree(source_path: pathlib.Path) -> _DestinationDirectory:
154154 return destination_tree
155155
156156
157- def _build_feature_map (destination_tree : _DestinationDirectory ) -> Dict [str , List [str ]]:
158- map : Dict [str , List [str ]] = {}
157+ def _build_feature_map (destination_tree : _DestinationDirectory ) -> dict [str , list [str ]]:
158+ map : dict [str , list [str ]] = {}
159159 _build_feature_map_iter (destination_tree , map )
160160 return map
161161
162162
163163def _build_feature_map_iter (
164- destination_tree : _DestinationDirectory , feature_map : Dict [str , List [str ]]
164+ destination_tree : _DestinationDirectory , feature_map : dict [str , list [str ]]
165165) -> None :
166166 for file in destination_tree .files :
167167 if not file .feature in feature_map :
@@ -177,7 +177,7 @@ def _build_feature_map_iter(
177177
178178def _save_wxs (
179179 destination_tree : _DestinationDirectory ,
180- feature_map : Dict [str , List [str ]],
180+ feature_map : dict [str , list [str ]],
181181 wxs_path : pathlib .Path ,
182182) -> None :
183183 preamble : str = """<?xml version="1.0" encoding="UTF-8"?>
@@ -248,7 +248,7 @@ def _write_directory_fragment_iter(
248248 print ("{}</Directory>" .format (indent ), file = stream )
249249
250250
251- def _write_feature_fragment (feature_map : Dict [str , List [str ]], stream : TextIO ):
251+ def _write_feature_fragment (feature_map : dict [str , list [str ]], stream : TextIO ) -> None :
252252 print (' <Fragment Id="Features">' , file = stream )
253253 print (' <Feature Id="All">' , file = stream )
254254 for feature in feature_map :
0 commit comments