Require suffix for tasks that are being synced

This commit is contained in:
Tomas Babej 2014-12-19 23:54:02 +01:00
parent 3a289ce24b
commit f85f7dc18e

View file

@ -13,6 +13,7 @@ TEXT = r'(?P<text>.+(?!{0}))'.format(UUID_UNNAMED)
DUE = r'(?P<due>\(\d{4}-\d\d-\d\d( \d\d:\d\d)?\))'
COMPLETION_MARK = r'(?P<completed>.)'
UUID_COMMENT = ' #{0}'.format(UUID)
TW_SYNC_MARK = ' #TW'
# Middle building blocks
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
TASKS_TO_SAVE_TO_TW = ''.join([
INCOMPLETE_TASK_PREFIX, # any amount of whitespace followed by uncompleted square
# Any of the following:
'(',
UUID_COMMENT, # Task UUID
')?'
TEXT,
'(', DUE, ')?' # Due is optional
'(', UUID_COMMENT, '|', TW_SYNC_MARK, ')' # UUID is not there for new tasks
])
GENERIC_TASK = ''.join([
@ -33,7 +33,7 @@ GENERIC_TASK = ''.join([
BRACKET_CLOSING,
TEXT,
'(', 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
])