GithubHelp home page GithubHelp logo

bilelmoussaoui / appstream Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 24.44 MB

Appstream files parser

Home Page: https://bilelmoussaoui.github.io/appstream/appstream

License: MIT License

Rust 100.00%

appstream's People

Contributors

a6gibkm avatar bilelmoussaoui avatar carlschwan avatar davidmhewitt avatar haecker-felix avatar sophie-h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

appstream's Issues

try_from fails on empty translations

Any file which includes

<translation></translation>

or

<translation/>

Will result in an error when loading as

        let element = xmltree::Element::parse(data).unwrap();
        let appdata = Component::try_from(&element).unwrap();

For some reason that it is beyond the grasp of the author, this is a very common practice in metainfo files.

Error InvalidTag("kudo") with comment in kudos

Removing the comment <!-- GNOME Software kudos: https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md --> makes it parse the file successfully.
Appmeta data file used:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Julian Sparber 2022 <[email protected]> -->
<component type="desktop-application">
  <id>@app-id@</id>
  <metadata_license>CC0</metadata_license>
  <!-- Insert your license of choice here -->
  <!-- <project_license>MIT</project_license> -->
  <name>App Metadata Editor</name>
  <summary>Write a GTK + Rust application</summary>
  <description>
    <p>A boilerplate template for GTK + Rust. It uses Meson as a build system and has flatpak support by default.</p>
  </description>
  <screenshots>
    <screenshot type="default">
      <image>https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor/raw/master/data/resources/screenshots/screenshot1.png</image>
      <caption>Main window</caption>
    </screenshot>
  </screenshots>
  <url type="homepage">https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor</url>
  <url type="bugtracker">https://gitlab.gnome.org/bilelmoussaoui/app-metadata-editor/issues</url>
  <content_rating type="oars-1.0" />
  <releases>
    <release version="0.1.0" date="2019-07-11" />
  </releases>
  <kudos>
     <!--
       GNOME Software kudos:
       https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md
     -->
     <kudo>ModernToolkit</kudo>
     <kudo>HiDpiIcon</kudo>
  </kudos>
  <developer_name>Julian Sparber</developer_name>
  <update_contact>[email protected]</update_contact>
  <translation type="gettext">@gettext-package@</translation>
  <launchable type="desktop-id">@[email protected]</launchable>
</component>

"display_length" seems unsupported

The following in Software's metainfo

<requires>
<!--  Adaptive  -->
<display_length compare="ge">small</display_length>
</requires>

causes

Error: InvalidTag("id")

Support relative "media URLs"

So Flathub moved to relative media URLs. (They are still lacking the media_baseurl, though.)

media_baseurl
The base URL for media (screenshots, icons, ...) referenced in the metadata file. If this is set, all urls in the document referencing media will be treated relative to the base url.

https://www.freedesktop.org/software/appstream/docs/chap-CatalogData.html#spec-asxml-general

It looks like it could be relatively annoying to directly parse URL fields into absolute URLs because you would have to pass the base URL to decoders all the time. An alternative might be to have an enum with Relative/Absolute where relative URLs have to be made absolute by the API user.

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.