mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-23 02:23:07 +02:00
Require suffix for tasks that are being synced
This commit is contained in:
parent
3a289ce24b
commit
f85f7dc18e
1 changed files with 6 additions and 6 deletions
|
@ -12,7 +12,8 @@ UUID = r'(?P<uuid>{0})'.format(UUID_UNNAMED)
|
||||||
TEXT = r'(?P<text>.+(?!{0}))'.format(UUID_UNNAMED)
|
TEXT = r'(?P<text>.+(?!{0}))'.format(UUID_UNNAMED)
|
||||||
DUE = r'(?P<due>\(\d{4}-\d\d-\d\d( \d\d:\d\d)?\))'
|
DUE = r'(?P<due>\(\d{4}-\d\d-\d\d( \d\d:\d\d)?\))'
|
||||||
COMPLETION_MARK = r'(?P<completed>.)'
|
COMPLETION_MARK = r'(?P<completed>.)'
|
||||||
UUID_COMMENT = ' #{0}'.format(UUID)
|
UUID_COMMENT = ' #{0}'.format(UUID)
|
||||||
|
TW_SYNC_MARK = ' #TW'
|
||||||
|
|
||||||
# Middle building blocks
|
# Middle building blocks
|
||||||
INCOMPLETE_TASK_PREFIX = EMPTY_SPACE + BRACKET_OPENING + '[^X]' + BRACKET_CLOSING + TEXT
|
INCOMPLETE_TASK_PREFIX = EMPTY_SPACE + BRACKET_OPENING + '[^X]' + BRACKET_CLOSING + TEXT
|
||||||
|
@ -20,10 +21,9 @@ INCOMPLETE_TASK_PREFIX = EMPTY_SPACE + BRACKET_OPENING + '[^X]' + BRACKET_CLOSIN
|
||||||
# Final regexps
|
# Final regexps
|
||||||
TASKS_TO_SAVE_TO_TW = ''.join([
|
TASKS_TO_SAVE_TO_TW = ''.join([
|
||||||
INCOMPLETE_TASK_PREFIX, # any amount of whitespace followed by uncompleted square
|
INCOMPLETE_TASK_PREFIX, # any amount of whitespace followed by uncompleted square
|
||||||
# Any of the following:
|
TEXT,
|
||||||
'(',
|
'(', DUE, ')?' # Due is optional
|
||||||
UUID_COMMENT, # Task UUID
|
'(', UUID_COMMENT, '|', TW_SYNC_MARK, ')' # UUID is not there for new tasks
|
||||||
')?'
|
|
||||||
])
|
])
|
||||||
|
|
||||||
GENERIC_TASK = ''.join([
|
GENERIC_TASK = ''.join([
|
||||||
|
@ -33,7 +33,7 @@ GENERIC_TASK = ''.join([
|
||||||
BRACKET_CLOSING,
|
BRACKET_CLOSING,
|
||||||
TEXT,
|
TEXT,
|
||||||
'(', DUE, ')?' # Due is optional
|
'(', DUE, ')?' # Due is optional
|
||||||
'(', UUID_COMMENT, ')?' # UUID is optional, it can't be there for new tasks
|
'(', UUID_COMMENT, '|', TW_SYNC_MARK, ')' # UUID is not there for new tasks
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue