GTG

Time tracking feature (hamster-applet integration ?)

Bug #339524 reported by Romeo A. Cioaba
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Wishlist
Kevin Mehall

Bug Description

Would be nice to have a time tracking feature implemented in GTG.

The user should be able to start the timer when he starts working on a task and pause/stop whenever he's not working on that task. This way at the end of the task one could see how long it took to complete it.

This feature would be specially useful for freelancers as most of the work is done on a per hour basis. They could use the time then and add it into an invoice.

Related branches

description: updated
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Instead of developing a time-tracking feature, we would prefer to integrate GTG with hamster-applet. I personnaly don't see the need to reinvent the wheel for this. The question is more : what kind of integration do we want ?

Also, I want to make clear that, currently, neither Bertrand or I are using time-tracking. This make this feature low priority for us right now. Of course, we will strongly support anyone wishing to work on this.

Changed in gtg:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Romeo A. Cioaba (romeo-cioaba) wrote :

Integrating GTG with hamster-applet should work just fine.

Revision history for this message
David Prieto (frandavid100-gmail) wrote :

I was about to open a very similar request - the same one, actually.

+1 from me.

Revision history for this message
labiculum (labiculum) wrote :

I second the integration of time tracking.

Revision history for this message
Kevin Mehall (kevin-mehall) wrote :

I started writing some code to send GTG tasks to Hamster:

https://code.edge.launchpad.net/~kevin-mehall/gtg/hamster-integration

Can anyone tell me how I should structure this? Since GTG doesn't have a plugin system AFAICT.

Revision history for this message
Kevin Mehall (kevin-mehall) wrote :

I made it into a plugin for pcabido's plugin-engine branch

https://code.launchpad.net/~kevin-mehall/gtg/hamster-plugin

Any comments/suggestions/features I should add?

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote : Re: [Bug 339524] Re: Time tracking feature (hamster-applet integration ?)

Hi Kevin,

This is really really nice of you! Using the plugin system is just the
best way of doing that :-)

Unfortunatly, that means that we have to wait that Paulo merge his work
before being able to merge yours. Another solution is to propose to Paulo
to merge your branch in his own.

Anyway, I'm really glad that you did that work, thanks for that!

Can you explain more how it interacts with hamster (from an user
perspective) and what can/should be improved/solved ?

Thanks a lot,

Lionel

Changed in gtg:
assignee: nobody → Kevin Mehall (kevin-mehall)
tags: added: plugin
Revision history for this message
Kevin Mehall (kevin-mehall) wrote :

Hi Lionel

Thanks for your encouragement, and thanks for GTG! This was a feature I wanted, so I decided to make it happen; that's why I love open source.

Quick overview of Hamster-applet if you're not familiar:
It's a panel applet with a timer, essentially. Users set a current activity, and it times it and stores that data. Its records consist of an "activity", and a "description", along with the start time / end time. The activity is typically very short, such as a project name, while the description is a longer freeform text (and probably is left empty most of the time when people are starting tasks the normal way). Activities can be further grouped into categories, and totals are calculated per-activity and per-category.

My plugin adds a button to GTG to start a task in Hamster. The GTG task title is used as the description, and the plugin attempts to guess the activity based on the tags of the task.

The activity selection currently works as follows: If there is only one tag on the task, it's used as the activity. When there are multiple tags, but only one has been previously used as an activity name in Hamster, that tag is chosen. If there are multiple possibilities (>1 tags, but none previously used in Hamster, or >1 tags that have been used in Hamster), the first one is chosen. That case not necessarily ideal, but I don't know a better way to do it, and it's probably relatively unlikely.

Example: If I have a task titled "Write Hamster Plugin" tagged @GTG, and I click "Start", the Hamster timer starts, with the activity set to "GTG" and description "Write Hamster Plugin".

As for other features, it currently does everything I personally need it to, but I'm open to suggestions if anyone has any ideas.

One thing I was thinking about, that might be useful to some people, but probably not critical:
Add a view to the bottom of the GTG task editor that lists the related Hamster activity records and total time for the task (independently of all other records for that "activity"/project/tag, as the Hamster stats window would show). Is there a way for the Task class and backends to store arbitrary data from plugins? (the list of Hamster task IDs, in this case) Or I suppose the plugin could store its own TID=>Hamster ID mapping in a separate file, or something...

Anyway, for now it's just the button to send the task to hamster, and that's ready to be merged. I don't know whether we should wait for the plugin engine to go into trunk, or whether I should propose a merge to Paulo's branch, so let me know what you think.

Kevin

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Hello Kevin,

It sounds really great ! I can't think of anything else I would add to that plugin so far.

I'm sorry but I believe you will have to wait a few days for the merge. Paulo will merge his branch with the trunk today or tomorrow. After that, you will be able to merge yours. I hope it will not be too painful.

Now, we will have to think about packaging as your plugin will depend on hamster-applet, it should be a separate package. We have to ask Luca what he think about that.

Question for you : do you think you would be able to maintain this plugin in the future or do you consider it more a "one shot" work ?

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Kevin,

The plugin branch as been merged with trunk. So you can submit your merge now :-)

tags: added: plugins
removed: plugin
Revision history for this message
Kevin Mehall (kevin-mehall) wrote :

I submitted a merge request.

Yes, I'm willing to maintain the plugin in the future. I think I'm going to add the feature I described above (listing associated hamster activities in the task editor window) at some point, but it can be merged as-is for now.

Changed in gtg:
milestone: none → 0.2
status: Confirmed → Fix Committed
Revision history for this message
tm (toms-baugis) wrote :

Thanks for the work Kevin, Lionel - really cool!

I hope you don't mind i'll drop this little bug i found here:

Plugin could check if there are any tags on task. Otherwise it fails when grabbing the first one:

Traceback (most recent call last):
  File "/home/toms/cvs/gtg/GTG/plugins/hamster/hamster.py", line 98, in browser_cb
    self.sendTask(plugin_api.get_selected_task())
  File "/home/toms/cvs/gtg/GTG/plugins/hamster/hamster.py", line 44, in sendTask
    activity=tags[0]
IndexError: list index out of range

Regards
Toms

Changed in gtg:
status: Fix Committed → Fix Released
Revision history for this message
Mani Sabri (mani-sabri) wrote :

the "start a new activity in hamster" button does nothing as of 11.04 64bit. I think its worth mentioning that Hamster is running as an indicator with the script in http://albertomilone.com/wordpress/?p=502 page...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.