@@ -52,9 +52,7 @@ def __init__(
5252 """
5353 self .topdir = Path (topdir ) if topdir else None
5454 if self .topdir and not self .topdir .is_dir ():
55- raise ValueError (
56- f"AmiCorpus() requires valid directory { self .topdir } "
57- )
55+ raise ValueError (f"AmiCorpus() requires valid directory { self .topdir } " )
5856
5957 self .container_by_file = dict ()
6058 # rootnode
@@ -154,9 +152,7 @@ def make_descendants(self, file: Optional[Union[str, Path]] = None):
154152 if file is None :
155153 file = self .root_dir
156154 if file is None or not Path (file ).is_dir ():
157- logger .error (
158- f"Cannot make file children for { file } "
159- )
155+ logger .error (f"Cannot make file children for { file } " )
160156 return
161157 files = self ._get_children (file )
162158 for f in files :
@@ -269,9 +265,7 @@ def read_json_create_write_html_table(
269265
270266 # Write to file
271267 with open (outfile_h , "w" , encoding = "utf-8" ) as f :
272- f .write (
273- ET .tostring (htmlx , encoding = "unicode" , pretty_print = True )
274- )
268+ f .write (ET .tostring (htmlx , encoding = "unicode" , pretty_print = True ))
275269
276270 def list_files (self , globstr : str ) -> List [Path ]:
277271 """
@@ -284,9 +278,7 @@ def list_files(self, globstr: str) -> List[Path]:
284278 List of matching file paths
285279 """
286280 if globstr and self .root_dir :
287- return self ._posix_glob (
288- str (self .root_dir / globstr ), recursive = True
289- )
281+ return self ._posix_glob (str (self .root_dir / globstr ), recursive = True )
290282 return []
291283
292284 def create_datatables_html_with_filenames (
@@ -358,9 +350,7 @@ def make_infiles(self, maxfiles: int = 999999999) -> List[Path]:
358350 List of file paths
359351 """
360352 if self .globstr :
361- self .infiles = self ._posix_glob (
362- self .globstr , recursive = True
363- )[:maxfiles ]
353+ self .infiles = self ._posix_glob (self .globstr , recursive = True )[:maxfiles ]
364354 return self .infiles
365355
366356 def _make_outfile (self ):
@@ -424,23 +414,15 @@ def search_files_with_queries(
424414 for query_id in query_ids :
425415 query = self .corpus_queries .get (query_id )
426416 if query is None :
427- err_msg = (
428- "cannot find query: "
429- + str (query_id )
430- )
417+ err_msg = "cannot find query: " + str (query_id )
431418 logger .error (err_msg )
432419 continue
433- dbg_msg = (
434- "outfile==> "
435- + str (query .outfile )
436- )
420+ dbg_msg = "outfile==> " + str (query .outfile )
437421 logger .debug (dbg_msg )
438422
439423 # This would need to be implemented based on the search functionality
440424 # For now, we'll create a placeholder
441- logger .info (
442- f"Running query: { query_id } "
443- )
425+ logger .info (f"Running query: { query_id } " )
444426
445427 return html_by_query_id
446428
@@ -487,9 +469,7 @@ def __init__(
487469 exist_ok: Whether to allow existing directory
488470 """
489471 if not isinstance (ami_corpus , AmiCorpus ):
490- raise ValueError (
491- f"ami_corpus has wrong type { type (ami_corpus )} "
492- )
472+ raise ValueError (f"ami_corpus has wrong type { type (ami_corpus )} " )
493473
494474 self .ami_corpus = ami_corpus
495475 self .file = Path (file )
@@ -510,12 +490,8 @@ def child_containers(self) -> List["AmiCorpusContainer"]:
510490 if self .ami_corpus and self .file and self .file .is_dir ():
511491 child_nodes = self .ami_corpus ._get_children (self .file )
512492 for child_node in child_nodes :
513- child_container = AmiCorpusContainer (
514- self .ami_corpus , child_node
515- )
516- child_container .bib_type = (
517- "" if child_node .is_dir () else "file"
518- )
493+ child_container = AmiCorpusContainer (self .ami_corpus , child_node )
494+ child_container .bib_type = "" if child_node .is_dir () else "file"
519495 child_containers .append (child_container )
520496 return child_containers
521497
0 commit comments