Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from gi.repository import GObject
- from zeitgeist.client import ZeitgeistClient
- from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation
- mainloop = GObject.MainLoop ()
- zg = ZeitgeistClient ()
- temps = [Event.new_for_values(subject_interpretation = Interpretation.DOCUMENT),
- Event.new_for_values(subject_interpretation = Interpretation.AUDIO),
- Event.new_for_values(subject_interpretation = Interpretation.WEBSITE),
- Event.new_for_values(subject_interpretation = Interpretation.IMAGE),
- Event.new_for_values(subject_interpretation = Interpretation.VIDEO),
- ]
- end = int(time.time ()*1000)
- start = 0
- t = time.time ()
- def callback (events):
- print len (events), time.time() - t
- mainloop.quit()
- zg.find_event_ids_for_templates(temps, callback, timerange=(start, end), num_events=0, result_type=2)
- mainloop.run ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement