filenametimestamps exclusion not working if excluded directory contains "bad files"
ajft opened this issue · 1 comments
Having moved some old files into a directory scanned by memacs (including a "2002-02-29-journal.org" where there was no 2002-Feb-29), I've found that the "-x" switch of memacs_filenamestamps doesn't seem to exclude the directory from being parsed, only from being reported.
${MEMACS}/bin/memacs_filenametimestamps.py -a --skip-files-with-no-or-wrong-timestamp --skip-file-time-extraction -o ./test.org -f $HOME/lib -x $HOME/lib/repos -v
:
DEBUG 2020-05-14 21:41:04,153 __handle_file: ##################################################
DEBUG 2020-05-14 21:41:04,153 __handle_file: /home/ajft/lib/repos/org-site.hg/.hg/store/data/org/__posts/2002-02-29-journal.org.i
DEBUG 2020-05-14 21:41:04,154 __handle_file: filename_timestamp_match? False
ERROR 2020-05-14 21:41:04,158 Traceback (most recent call last):
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 402, in _main
self.__handle_folder(folder)
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 122, in __handle_folder
self.__handle_file(file, rootdir)
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 354, in __handle_file
orgdate = OrgFormat.strdate(day1, inactive=self._args.inactive_timestamps)
File "/home/ajft/.local/lib/python3.8/site-packages/orgformat/orgformat.py", line 318, in strdate
tuple_date = time.strptime(components.group(1),
File "/usr/lib/python3.8/_strptime.py", line 562, in _strptime_time
tt = _strptime(data_string, format)[0]
File "/usr/lib/python3.8/_strptime.py", line 534, in _strptime
julian = datetime_date(year, month, day).toordinal() -
ValueError: day is out of range for month
Traceback (most recent call last):
File "/home/ajft/src/memacs/bin/memacs_filenametimestamps.py", line 39, in
memacs.handle_main()
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 402, in _main
self.__handle_folder(folder)
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 122, in __handle_folder
self.__handle_file(file, rootdir)
File "/home/ajft/src/memacs/memacs/filenametimestamps.py", line 354, in __handle_file
orgdate = OrgFormat.strdate(day1, inactive=self._args.inactive_timestamps)
File "/home/ajft/.local/lib/python3.8/site-packages/orgformat/orgformat.py", line 318, in strdate
tuple_date = time.strptime(components.group(1),
File "/usr/lib/python3.8/_strptime.py", line 562, in _strptime_time
tt = _strptime(data_string, format)[0]
File "/usr/lib/python3.8/_strptime.py", line 534, in _strptime
julian = datetime_date(year, month, day).toordinal() -
ValueError: day is out of range for month