Skip to content

Commit a5af694

Browse files
committed
use: only_partial context
1 parent f416a3a commit a5af694

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

foliant/preprocessors/showcommits.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ def process_file(self, markdown_file_path):
360360
with open(markdown_file_path, 'w', encoding='utf8') as markdown_file:
361361
markdown_file.write(processed_markdown_content)
362362

363-
def process_all_files(self):
363+
def process_all_files(self, list_of_files):
364364
threads = []
365-
for markdown_file_path in self.working_dir.rglob('*.md'):
365+
for markdown_file_path in list_of_files:
366366
process_file_thread = threading.Thread(target=self.process_file,
367367
args=[markdown_file_path])
368368
process_file_thread.start()
@@ -392,6 +392,9 @@ def apply(self):
392392
f'User-specified path does not exist, trying to use the default one: {self.repo_path}')
393393

394394
self.repo_web_url = self._get_repo_web_url()
395-
self.process_all_files()
395+
if self.context['only_partial']:
396+
self.process_all_files(self.context['only_partial'])
397+
else:
398+
self.process_all_files(self.working_dir.rglob('*.md'))
396399

397400
self.logger.info('Preprocessor applied')

0 commit comments

Comments
 (0)