#13152 closed defect (fixed)
add_hours_by_comment is inconsistent in the way to record muitple time records in a single comment
Reported by: | EmeCas | Owned by: | EmeCas |
---|---|---|---|
Priority: | normal | Component: | TracHoursPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
Problem:
Using an expression like this in the body of a comment:
1 hour 1 hour Description
would result in a single time record to be created.
while using expressions like these as a comment:
1 hour . 1 hour Description
1 hours 1 hours Description
1.5 hours 1 hours Description
Would result in 2 time records to be created by each comment.
For a more complex expression like this:
1 hour 1 hour 2 hours 1 hour 1 hour 1.5 hours 0.5 hours 1 hour 1 hour {5/1/2016} Description
It records
- 1 hour
- 2 hours
- 1 hour
- 1.5 hours
- 0.5 hours
- 1 hour
Missing 3 records
- 1 hour
- 1 hour
- 1 hour
The problem is related to consecutive 1 hour
expressions without space(s) or text in between, where the result matching by the current regular expression is failing.
Solution:
The current regular expression has to be updated from:
# for singular hours: 1 hour singular_hour_regex = r'((^)|(\s))1 *hour((\W)|($))'
to
# for singular hours: 1 hour singular_hour_regex = r'((^)|(\s*))1 *hour((\W)|($))'
Attachments (1)
Change History (5)
Changed 8 years ago by
Attachment: | patch13152 added |
---|
comment:1 Changed 8 years ago by
Owner: | set to EmeCas |
---|---|
Status: | new → assigned |
You are now maintainer of the plugin. Feel free to commit the change.
comment:2 follow-up: 4 Changed 8 years ago by
Also, feel free to CC me on any tickets if you have questions about development or specifically about the plugin. I've done a fair bit of work on the plugin.
comment:3 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Change committed on Revision 16555
comment:4 Changed 8 years ago by
Thanks
Replying to Ryan J Ollos:
Also, feel free to CC me on any tickets if you have questions about development or specifically about the plugin. I've done a fair bit of work on the plugin.
Fixing Regular Expression