Re: [Tracker] Tomboy note extractor
- From: Jamie McCracken <jamiemcc blueyonder co uk>
- To: Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
- Cc: Tracker List <tracker-list gnome org>
- Subject: Re: [Tracker] Tomboy note extractor
- Date: Sun, 19 Nov 2006 13:06:07 +0000
Mikkel Kamstrup Erlandsen wrote:
2006/11/18, Jamie McCracken <jamiemcc blueyonder co uk 
<mailto:jamiemcc blueyonder co uk>>:
    Mikkel Kamstrup Erlandsen wrote:
     > 2006/11/17, Jamie McCracken <jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>
     > <mailto:jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>>>:
     >
     >     Mikkel Kamstrup Erlandsen wrote:
     >      > 2006/11/16, Jamie McCracken <jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>
     >     <mailto: jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>>
     >      > <mailto:jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>
     >     <mailto:jamiemcc blueyonder co uk
    <mailto:jamiemcc blueyonder co uk>>>>:
     >      >
     >      >     Mikkel Kamstrup Erlandsen wrote:
     >      >      > I created a small tomboy note extractor
    (attached)... It
     >     should
     >      >     run on
     >      >      > any system with a Python installation - I think the XML
     >     parser I
     >      >     use is
     >      >      > bundled with Python.
     >      >
     >      >
     >      >     hmm would prefer it internal to tracker in C to be honest.
     >     The external
     >      >     metadata extractors are driven by mime type so it would be
     >     tricky/hacky
     >      >     to do them via that mechanism (this is the same as our
    email
     >     stuff -
     >      >     its
     >      >     all internal)
     >      >
     >      >     It should be real easy to do this in C if anyone's willing
     >      >
     >      >
     >      > I could do that - I digged around the extraction code and
    it seemed
     >      > fairly intuitive. Should I use libxml or just plain hardcoded
     >     grep-like
     >      > hacks (or libXYZ)?
     >
     >     use the glib xml parser (see abiword extractor)?
     >
     >
     > Done. The abiword extractor uses custom "grepping" through the xml
     > without any real parsing going on. I could probably do that too
    (and it
     > might be simpler) but I felt the urge to get into this whole glib
     > business :-)
     >
     > I haven't tested it with tracker though, I didn't know how to get
     > trackerd to pick up my notes files (they have mime type
    text/plain and
     > are in ~/.tomboy which isn't indexed by default).
     >
     > There is a small outcommented test main-function so you can
    compile the
     > extractor as stand alone.
     >
     > Please don't publicly humiliate me - I'm really not a C-hacker...
    :-D
     >
     > Cheers,
     > Mikkel
     >
    its mostly okay - just needs some tidying up of the code (spaces in
    between function name and opening bracket, no underscores for private
    functions etc)
I think I have done this now... There was also some jumbled up space/tab 
issues making the code look all weird, I hope that is fixed now too. I 
also added a GPL header.
There are missing GPL headers in many if the other extractors too. If 
you wish I can add those (on which I can dig out the original author).
    will need to integrate it in trackerd along with code to pick up new or
    changed tomboy notes - will do this for you after the 0.5.2 release
    tomorrow (with some new dbus methods to make your life easier!)
Rock on!
Another thing; when I run my test prog through valgrind it reports a few 
leaks. I really can't find any in my code - does this perhaps come from 
glib messing up with valgrind?
unlikely - you are not freeing up the hashtable in your test code but I 
will sort it out soonish.
--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]