Hi,

On Wed, Nov 17, 2010 at 5:16 PM, Nikolaus Rath <nikol...@rath.org> wrote:

> Martyn Russell 
> <martyn-bhgbangmcjvqt0dzr+a...@public.gmane.org<martyn-bhgbangmcjvqt0dzr%2ba...@public.gmane.org>>
> writes:
> > On 17/11/10 00:02, Nikolaus Rath wrote:
> >
> This gives me the following result:
>
> ...
>
> So it seems that I still have to parse the entire string. Is there a way
> to get the data in more structured form?
>

 We have code in python doing that for our extraction test cases. Check the
class ExtractorHelper in:

http://git.gnome.org/browse/tracker/tree/tests/functional-tests/common/utils/helpers.py

  Basically:
extractor = ExtractorHelper ()
results = extractor.get_metadata (filename)

results is a dictionary with property as key, and a list of values as value.
There are few tricks in the translation property->key (because of anonymous
nodes)... but i think that with some prints you can figure out how it works.

In our tests we don't specify the mimetype and they work fine.

Hope this helps.

Ivan




>
> Also, with a plain text document
>
>    tracker.GetMetadata('file:///home/nikratio/misc/Victoria.tex',
> 'text/plain')
>
> I do not get any contents:
>
> (dbus.String(u''), dbus.String(u' a nfo:PlainTextDocument .\n'))
>
> Am I doing something wrong?
>
>
> And finally, is there a way to omit the mime type and have tracker
> determine it automatically?
>
>
> Thanks!
>
>   -Nikolaus
>
> --
>  »Time flies like an arrow, fruit flies like a Banana.«
>
>  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
> _______________________________________________
> tracker-list mailing list
> tracker-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/tracker-list
>
_______________________________________________
tracker-list mailing list
tracker-list@gnome.org
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to