Skip to content

Commit 601ae34

Browse files
committed
Add docstrings for file counting and moving functions in file_classifier.py and file_organiser.py
1 parent db3e8dc commit 601ae34

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/tidyfile/modules/file_classifier.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ def categorize_files_by_type(files: List[str]) -> Dict[str, List[str]]:
154154

155155

156156
def file_count(files: list):
157+
"""
158+
Counts the total number of files and categories in the given list of files.
159+
160+
Args:
161+
files (list): A list of file paths to be categorized and counted.
162+
163+
Returns:
164+
tuple: A tuple containing the total number of files and the total number of categories.
165+
"""
157166
category_count = 0
158167
file_count = 0
159168
categorized_data = categorize_files_by_type(files)

src/tidyfile/modules/file_organiser.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77

88
def move_files_to_categories(files: list):
9+
"""
10+
Moves files into categorized folders based on their type.
11+
12+
Args:
13+
files (list): A list of file paths to be categorized and moved.
14+
15+
The function categorizes the given files by their type and moves them into corresponding folders.
16+
If the category folder does not exist, it creates the folder. Logs the actions performed and any errors encountered.
17+
"""
918
categorised_files = categorize_files_by_type(files)
1019

1120
for category, filenames in categorised_files.items():

0 commit comments

Comments
 (0)