Modify

Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#12627 closed enhancement (fixed)

Call TracHoursPlugin directly instead of posting comments

Reported by: Robert Becker Owned by: Robert Becker
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords:
Cc: trac-hacks.org@… Trac Release:

Description (last modified by Robert Becker)

I have created a small patch which calls the corresponding method of TracHoursPlugin directly to post the worked time instead of creating a comment which is to be parsed by TracHoursByComment.

This may cause hours to be counted twice if WorkLogPlugin is set to create comments and TracHoursByComment is enabled. If noted in the wiki I think this is a rather light tradeoff for being able to skip comments at all. Alternatively the comment message could be changed to "worked X hours and Y minutes" which won't be parsed by TracHoursByComment. (Circumvented by changing the output format a bit if TracHours is enabled)

Attachments (3)

manager.py.diff (2.0 KB) - added by Robert Becker 9 years ago.
manager.py.2.diff (2.6 KB) - added by Robert Becker 9 years ago.
manager.py.patch (2.7 KB) - added by Robert Becker 8 years ago.
I have updated my patch to add the comment message to the trachours log. Also, if comments are enabled, the worklog message will be added again, but with a decimal hours representation to prevent parsing.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 9 years ago by Robert Becker

Adding an attachment did not work:

Trac detected an internal error:
OSError: [Errno 13] Permission denied: '/srv/trac-hacks.org/trac/files/attachments/ticket/719/71924e41595afe78e108a402bff1b0b2334873e3'

I have uploaded the diff file here: http://pastebin.com/UQ5J8smT

comment:2 in reply to:  1 Changed 9 years ago by Ryan J Ollos

Replying to roben:

Adding an attachment did not work:

Trac detected an internal error:
OSError: [Errno 13] Permission denied: '/srv/trac-hacks.org/trac/files/attachments/ticket/719/71924e41595afe78e108a402bff1b0b2334873e3'

Should be fixed now. Could you please try uploading the attachment again to confirm?

Changed 9 years ago by Robert Becker

Attachment: manager.py.diff added

comment:3 Changed 9 years ago by Robert Becker

Confirmed, thanks :)

Changed 9 years ago by Robert Becker

Attachment: manager.py.2.diff added

comment:4 Changed 9 years ago by Robert Becker

I have updated the patch to disable the "Stopping work on this ticket to start work on #XXX." comment if comments are set to be disabled in the configuration.

comment:5 Changed 8 years ago by Robert Becker

*bump*

It would really be great if you could incorporate this patch which really improves the plugin's behaviour when no comments are desired.

comment:6 Changed 8 years ago by Ryan J Ollos

Owner: Colin Guthrie deleted

Changed 8 years ago by Robert Becker

Attachment: manager.py.patch added

I have updated my patch to add the comment message to the trachours log. Also, if comments are enabled, the worklog message will be added again, but with a decimal hours representation to prevent parsing.

comment:7 Changed 8 years ago by Robert Becker

Description: modified (diff)

comment:8 Changed 7 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

comment:9 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16796:

WorkLog 1.0dev: Use TracHoursPlugin to post hours

Patch by roben.

Fixes #12627.

comment:10 Changed 7 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Robert Becker

comment:11 Changed 7 years ago by Ryan J Ollos

In 16797:

WorkLog 1.0dev: Refactor and remove debug print statement

Refs #12627.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Becker.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.