@@ -59,7 +59,7 @@ def is_packagedir(dirname: str | None = None, files: list[str] | None = None) ->
5959 return any (f for f in files if is_initpy (f ))
6060
6161
62- def write_file (name : str , text : str , opts : CliOptions ) -> Path :
62+ def write_file (name : str , text : str , opts : ApidocOptions ) -> Path :
6363 """Write the output file for module/package <name>."""
6464 fname = Path (opts .destdir , f'{ name } .{ opts .suffix } ' )
6565 if opts .dryrun :
@@ -80,7 +80,7 @@ def write_file(name: str, text: str, opts: CliOptions) -> Path:
8080def create_module_file (
8181 package : str | None ,
8282 basename : str ,
83- opts : CliOptions ,
83+ opts : ApidocOptions ,
8484 user_template_dir : str | None = None ,
8585) -> Path :
8686 """Build the text of the file and write the file."""
@@ -108,7 +108,7 @@ def create_package_file(
108108 master_package : str | None ,
109109 subroot : str ,
110110 py_files : list [str ],
111- opts : CliOptions ,
111+ opts : ApidocOptions ,
112112 subs : list [str ],
113113 is_namespace : bool ,
114114 excludes : Sequence [re .Pattern [str ]] = (),
@@ -173,7 +173,7 @@ def create_package_file(
173173
174174def create_modules_toc_file (
175175 modules : list [str ],
176- opts : CliOptions ,
176+ opts : ApidocOptions ,
177177 name : str = 'modules' ,
178178 user_template_dir : str | None = None ,
179179) -> Path :
@@ -201,7 +201,7 @@ def create_modules_toc_file(
201201
202202
203203def is_skipped_package (
204- dirname : str | Path , opts : CliOptions , excludes : Sequence [re .Pattern [str ]] = ()
204+ dirname : str | Path , opts : ApidocOptions , excludes : Sequence [re .Pattern [str ]] = ()
205205) -> bool :
206206 """Check if we want to skip this module."""
207207 if not Path (dirname ).is_dir ():
@@ -218,7 +218,7 @@ def is_skipped_package(
218218
219219
220220def is_skipped_module (
221- filename : str | Path , opts : CliOptions , _excludes : Sequence [re .Pattern [str ]]
221+ filename : str | Path , opts : ApidocOptions , _excludes : Sequence [re .Pattern [str ]]
222222) -> bool :
223223 """Check if we want to skip this module."""
224224 filename = Path (filename )
@@ -232,7 +232,7 @@ def is_skipped_module(
232232def walk (
233233 rootpath : str ,
234234 excludes : Sequence [re .Pattern [str ]],
235- opts : CliOptions ,
235+ opts : ApidocOptions ,
236236) -> Iterator [tuple [str , list [str ], list [str ]]]:
237237 """Walk through the directory and list files and subdirectories up."""
238238 for root , subs , files in os .walk (rootpath , followlinks = opts .followlinks ):
@@ -261,7 +261,7 @@ def walk(
261261
262262
263263def has_child_module (
264- rootpath : str , excludes : Sequence [re .Pattern [str ]], opts : CliOptions
264+ rootpath : str , excludes : Sequence [re .Pattern [str ]], opts : ApidocOptions
265265) -> bool :
266266 """Check the given directory contains child module/s (at least one)."""
267267 return any (files for _root , _subs , files in walk (rootpath , excludes , opts ))
@@ -270,7 +270,7 @@ def has_child_module(
270270def recurse_tree (
271271 rootpath : str | os .PathLike [str ],
272272 excludes : Sequence [re .Pattern [str ]],
273- opts : CliOptions ,
273+ opts : ApidocOptions ,
274274 user_template_dir : str | None = None ,
275275) -> tuple [list [Path ], list [str ]]:
276276 """
@@ -352,7 +352,7 @@ def is_excluded(root: str | Path, excludes: Sequence[re.Pattern[str]]) -> bool:
352352
353353
354354@dataclasses .dataclass (frozen = True , kw_only = True , slots = True )
355- class CliOptions :
355+ class ApidocOptions :
356356 """Options for apidoc."""
357357
358358 module_path : Path
0 commit comments