Skip to content

Commit

Permalink
Merge pull request #108 from AstuteSource/issue-#5
Browse files Browse the repository at this point in the history
Display Counts of files in each directory when running Chasten Integrate.
  • Loading branch information
laurennevill authored Nov 21, 2023
2 parents c364ebf + 48b04a5 commit dca2f64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chasten/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ def integrate( # noqa: PLR0913
output.print_list_contents(json_path)
# extract all of the JSON dictionaries from the specified files
json_dicts = filesystem.get_json_results(json_path)
count = len(json_path)
output.console.print(f"\n:sparkles: Total of {count} files in all directories.")
# combine all of the dictionaries into a single string
combined_json_dict = process.combine_dicts(json_dicts)
# write the combined JSON file string to the filesystem
Expand Down
5 changes: 5 additions & 0 deletions chasten/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ def print_list_contents(container: List[Path]) -> None:
# --> display the name of each file stored in this directory
for directory, files in grouped_files.items():
console.print(f"{small_bullet_unicode} Directory: {directory}")
filecount = 0
for file_name in files:
filecount = +1
console.print(
f" {small_bullet_unicode} File: '{shorten_file_name(file_name, 120)}'"
)
console.print(
f" {small_bullet_unicode} file(s) {int(filecount)} in this directory"
)


def print_analysis_details(chasten: results.Chasten, verbose: bool = False) -> None:
Expand Down

0 comments on commit dca2f64

Please sign in to comment.