Re: Oops, where did GetCurrentFact go?



Thanks Toms, very helpful! My software is in python, and I learn best
from examples, so I really appreciate the code chunk. Got everything
working again. I was confused by the syntax of the method calls,...
looking through hamster/storage.py shows capitalized methods like
GetTodaysFacts() but instead I use get_todays_facts(). Can you
de-noobify me?

GetCurrentFact was very convenient way to check if there was anything
currently being tracked (in my case I needed to stop the task if it was
something other than my art project and then start the art project, just
start the art project if nothing was being tracked or do nothing if the
art project was already being tracked).

Once my website is overhauled I'll be putting the software up there,
I'll let you know when it's ready. Hamster has really made the project
shine.

I dunno what is up with the idle tracking, I suspect it has nothing to
do with Hamster, but I need to investigate more before I have a handle
on it. I also use Workrave and it's idle tracking works fine. Hamster
uses dbus and the screensaver idle detection right? I'm on a desktop and
have screensaver disabled, but the monitor powers down correctly which I
assume is also through the same idle detection.

Cheers,
Ryan

On 10-04-20 04:09 AM, Toms wrote:
> Sorry, forgot to copy the list.
> Also i'll correct myself - i don't remember what was i thinking when i
> dropped GetCurrentFact, but i certainly was thinking something. Maybe
> something about "there are too many dbus methods now out there, some
> can be skipped as trivial to figure" or something. Or maybe the
> short-cut seemed to be too small to provide an extra method.
> Well, in case i was wrong, next six month will show that and i'll put
> the method back for the stable.
>
> I also wonder if this is relevant to your interests:
> http://github.com/tbaugis/hamster_experiments/blob/master/hamster_tracks.py
>
> To run a hamster experiment, just check out the whole thing and run
> specific script (as in `python hamster_tracks.py`)
>
> Toms
>
> On Tue, Apr 20, 2010 at 8:57 AM, Toms <toms baugis gmail com> wrote:
>   
>> Hey Ryan!
>>
>> In case if your art project is in Python, you can import
>> hamster.client.Storage and skip the d-bus bit (it will do that for
>> you).
>> But GetCurrentFact was dropped as it was ambiguous, you get most
>> recent fact by calling GetTodaysFacts and the last one is the one you
>> are looking for, provided the end time is 0.
>>
>> So, in python:
>>
>> import hamster.client
>> storage = hamster.client.Storage()
>>
>> todays_facts = storage.get_todays_facts()
>> last = None
>> if todays_facts and todays_facts[-1]['end_time'] is None:
>>  last = todays_facts[-1]
>>
>>
>> As for the idle detection - don't remember which bit you refer to as
>> broken, but i don't think anything has changed there.
>>
>> Would love to see that project of yours!
>>
>> Regards,
>> Toms
>>
>>
>> On Tue, Apr 20, 2010 at 6:53 AM, Ryan Kelln <ryankelln gmail com> wrote:
>>     
>>> Hi Toms,
>>>
>>> I've been using Hamster in an art project of mine (which creates
>>> collages of the stuff I do every day) and today I thought, "this dang
>>> idle detection isn't working and it's really bugging me, maybe I'll pull
>>> the latest and see if that fixes it" (I think was running some random
>>> pull from a few months ago before).
>>>
>>> Anyways, the idle stuff is less important, my poor art software is
>>> complaining and I notice now that GetCurrentFact() seems to be gone when
>>> I fire up D-Feet and check out what's happening on dbus. If I want to
>>> get the name of the current fact (or query if there is any current fact)
>>> what should I be using now?
>>>
>>> Thanks very much, I love the Hamster,
>>> Ryan
>>>
>>> _______________________________________________
>>> hamster-applet-devel-list mailing list
>>> hamster-applet-devel-list gnome org
>>> http://mail.gnome.org/mailman/listinfo/hamster-applet-devel-list
>>>
>>>       
>>     



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]