Giter Club home page Giter Club logo

appstream.dart's Introduction

Pub Package

A parser for Appstream data. This package allows Dart applications to access package metadata on Linux systems.

import 'package:appstream/appstream.dart';

var pool = AppstreamPool();
await pool.load();
for (var component in pool.components) {
  print(component);
}

Contributing to appstream.dart

We welcome contributions! See the contribution guide for more details.

appstream.dart's People

Contributors

d-loose avatar robert-ancell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

appstream.dart's Issues

default example failed with error

kp@kp-B550:~/trials/my_app$ dart run
Building package executable...
Built my_app:my_app.
Unhandled exception:
FormatException: Missing component package
#0 new AppstreamCollection.fromYaml (package:appstream/src/collection.dart:421:9)
#1 AppstreamPool._loadYamlCollection (package:appstream/src/pool.dart:45:32)

#2 Future.wait. (dart:async/future.dart)

#3 AppstreamPool.load (package:appstream/src/pool.dart:24:23)

#4 main (file:///home/kp/trials/my_app/bin/my_app.dart:5:3)

Fails to work on Ubuntu/Debian due to "Duplicate mapping key"

If you run the example on Ubuntu you get:

Unhandled exception:
Error on line 25023, column 3: Duplicate mapping key.
      ╷
25023 │   ca_ES:
      │   ^^^^^
      ╵
#0      Loader._loadMapping (package:yaml/src/loader.dart:168:9)

This is because appstream-generator was generating invalid YAML, specifically the translation merging was leading to duplicate keys in maps (i.e. two ca_ES translations in the above example). While this is now fixed upstream, Ubuntu/Debian releases will continue to have invalid YAML files.

Possible solutions:

  • We manage to update all the existing YAML in Ubuntu/Debian - however this can't fix any systems that haven't updated.
  • The Dart YAML implementation slackens its requirements on maps (seems extremely unlikely/undesirable).
  • We pre-process the YAML to remove these duplicates.
  • We make a small YAML decoder in appstream.dart that handles this case.

No such directory `/var/lib/app-info` on 22.10

On Ubuntu 22.10 with Dart 2.18.4:

$ dart run example/example.dart 
Unhandled exception:
FileSystemException: Directory listing failed, path = '/var/lib/app-info/' (OS Error: No such file or directory, errno = 2)

Callstack:

AppstreamPool._listFiles (appstream.dart/lib/src/pool.dart:40)
<asynchronous gap> (Unknown Source:0)
AppstreamPool.load (appstream.dart/lib/src/pool.dart:21)
<asynchronous gap> (Unknown Source:0)
main (appstream.dart/example/example.dart:5)
<asynchronous gap> (Unknown Source:0)

Can't use appstream.dart and packagekit.dart from the latest version

I need the latest packagekit release for the getUpdateDetail method :) But I can't use appstream then because that one uses older deps

[software] flutter pub get
Running "flutter pub get" in software...                        
Because every version of packagekit from git depends on dbus ^0.7.6 which depends on xml ^6.1.0, every version of packagekit from git requires xml ^6.1.0.
And because every version of appstream depends on xml ^5.1.1, packagekit from git is incompatible with appstream.
So, because software depends on both appstream ^0.2.4 and packagekit from git, version solving failed.
pub get failed (1; So, because software depends on both appstream ^0.2.4 and packagekit from git, version solving failed.)
exit code 1

Would be nice if you could update the deps of appstream. Best regards

Keyword list may contain null entries

I'm running the simple example in the README that iterates on all the components in the pool and prints them.
This raises an exception, because AppstreamComponent.toString() wants to print the value of its keywords attribute, but it turns out some entries are null. This is caused by possibly invalid YAML:

[…]
  pt_BR:
  - bate-papo
  - chat
  - mensagem
  - 
  - instantânea
[…]

The YAML parser doesn't complain, but these null entries should probably be filtered out.

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.