mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
enable writing of only selected output paths
- add WRITE_SELECTED setting - add --write-selected commandline option
This commit is contained in:
parent
34ef5ab098
commit
6703950abe
7 changed files with 81 additions and 2 deletions
|
|
@ -658,3 +658,17 @@ class FileStampDataCacher(FileDataCacher):
|
|||
if stamp != self._get_file_stamp(filename):
|
||||
return default
|
||||
return data
|
||||
|
||||
|
||||
def is_selected_for_writing(settings, path):
|
||||
'''Check whether path is selected for writing
|
||||
according to the WRITE_SELECTED list
|
||||
|
||||
If WRITE_SELECTED is an empty list (default),
|
||||
any path is selected for writing.
|
||||
'''
|
||||
if settings['WRITE_SELECTED']:
|
||||
return path in settings['WRITE_SELECTED']
|
||||
else:
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue