Git Product home page Git Product logo

Comments (5)

hughsie avatar hughsie commented on July 22, 2024

What's the use-case? There is quite a lot of metadata on each object and it would be tricky to push all the translations, enum values, etc through a hash function without a lot of code.

from appstream-glib.

lots0logs avatar lots0logs commented on July 22, 2024

Oh, okay. I wasn't sure whether or not it would be an easy/quick change. We're working on a front-end package management application that presents a more app-centric layout. We are combining appstream data with data from alpm and displaying it in the UI. Honestly its not a big deal, it just would have been nice to have the option to get the data all at once instead of calling a function for each field. Admittedly, more a personal preference than anything else 😉

from appstream-glib.

hughsie avatar hughsie commented on July 22, 2024

The problem with exporting a JSON-like blob is that it then becomes API. If you're after everything you could just parse the XML and convert that to an in-memory store, although obviously you'd have to handle all the fallbacks and type conversion yourself too.

What exactly are you doing that requires all the data to everything? At least in Fedora there are so many apps that trying to load all the translations of all the fields of all the apps means you've got hundreds of MBs in RSS. There are quite a few optimisations we've created like only populating the keyword cache when we perform a search to speed up startup, searching the icon path when required and that kind of thing, and so loading everything would be a huge performance regression.

from appstream-glib.

lots0logs avatar lots0logs commented on July 22, 2024

That makes sense. I wasnt considering how much larger fedora repos are than Arch's. I guess I'm just trying to make the data easier to work with (we're using Python). But that's (again) not an issue so much as a personal preference. Thanks for explaining why it isn't a good idea. ..this is totally OT but I can't figure out why I'm getting this error when calling app.get_keywords() (note: it happens on a few other methods too):

>>> app.get_keywords()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: AppStreamGlib.App.get_keywords() takes exactly 2 arguments (1 given)

The docs say it doesnt take any arguments (though I assume 1 is the object itself) Have you seen this before? I'm using appstream 0.8.4 with appstream-glib 0.5.0

from appstream-glib.

hughsie avatar hughsie commented on July 22, 2024

You need to give the method the locale of the data you want to return, e.g. en_GB or C. The docs say:

  • @app: a #AsApp instance.
  • @Locale: the locale, or %NULL. e.g. "en_GB"

from appstream-glib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.