Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filenametimestamps exclusion not working if excluded directory contains "bad files" #97

Closed
ajft opened this issue May 14, 2020 · 1 comment
Assignees
Labels

Comments

@ajft
Copy link
Contributor

ajft commented May 14, 2020

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

@novoid novoid self-assigned this May 27, 2020
@novoid novoid added the bug label May 27, 2020
@novoid novoid pinned this issue May 27, 2020
@novoid novoid closed this as completed in e20e6cd May 31, 2020
@novoid
Copy link
Owner

novoid commented May 31, 2020

Thanks @ajft,
The issue should be fixed with the latest version.

I can not confirm that "the -x switch of memacs_filenamestamps doesn't seem to exclude the directory from being parsed, only from being reported". If you can reproduce it please open up another issue for that.

@novoid novoid unpinned this issue May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants