[packagekit] GetMimeTypes API addition?

Tim Lauridsen tim.lauridsen at googlemail.com
Sun Oct 5 22:29:42 PDT 2008


Richard Hughes wrote:
> On Fri, 2008-10-03 at 14:07 +0200, Tim Lauridsen wrote:
>   
>> Thanks, i will wait.
>>     
>
> Cool, some comments:
>
> * Tons of trailing whitespace - pet hate of mine
>   
I will clean it up
> * We're already using collection for a meta-group -- can you use
>   Categories and SubCategories? as method names?
>   
but the meta-packages is the same as a collection, this is why i use 
GetCollections.
'seach-group none collection' will return all collections as meta packages.
GetCollections(cat_id) will return all collections in a given Category.
GetCollections("") will return all collections as collections.
I might fell a little clumsy to have 2 way to get the same stuff, but it 
was because i dont want to brake the current api.
So you can say that metapackages is uncategorized collections 
(search-group) "groupid;;;meta" and
the a collection is a categorized collection "@groupid;;;".
One other difference is that you can do a "search-group none @groupid" 
to get the packages in the group, you cant do that with
the 'groupid;;;meta".
you can to both InstallPackages('groupid;;;meta") and 
InstallPackages(''@groupid;;;')

> * I'm still not convinced you need two methods and signals to populate a
> tree. What if the tree is four layers deep, or one layer deep?
>   
in comps, you only have 2 levels
1. level categories. (a group of groups)
2. level groups (a group of packages)

I other package backends in might be different.
> Couldn't you do something like this:
>
> GetCategoryTree()
>   
> CategoryNode(s=parent, s=id, s=icon, s=name)
>   
i dont see the need of the parent.
C:GetCategories()

S:Category("apps", "cat-apps", "Applications")
S:Category("games", "accessories-games", "Games")
S:Category("games;board", "board-games", "Board Games")
S:Category("games;action", "action-games", "Action Games")
S:Category("games;action;quake", "quake", "Quake games")
S:Category("system-tools", "media-system", "System tools")
S:Finished ()

Could deliver the same infomation, i dont see the need send to much redundant information.

> C:GetCategoryTree()
> S:CategoryNode("", "apps", "cat-apps", "Applications")
> S:CategoryNode("", "games", "accessories-games", "Games")
> S:CategoryNode("games", "games;board", "board-games", "Board Games")
> S:CategoryNode("games", "games;action", "action-games", "Action Games")
> S:CategoryNode("games;action", "games;action;quake", "quake", "Quake games")
> S:CategoryNode("", "system-tools", "media-system", "System tools")
> S:Finished ()
>
> Then you only need to send one request to the server, and you get one
> set of requests back, and you get an n-deep tree without hardcoding lots
> of policy in the API.
>
> It would be trivial to handle in python, and slightly trickier to do in
> C.
>   
We could limit the tree to 4 levels and always send 4 level categories 
to make it easier to decode in C :)
catid:
apps;;;
apps;desktops-system;;
games;action;firstperson-shooter;

GetCategories() return the Categories as a 4 level tree.
GetCollections(catid) returns the collections in a given level in the tree.
SearchGroup(filter,'@groupid') returns the packages in the group 
(mandatory,default, optional and conditional)
InstallPackages('@groupid') install the group (only the mandatory and 
default packages)

in time we can replace the use of SearchGroup(filters,'collections') 
with GetCollections("") and deprecate the 'collections' group enum.
the '@' prefix it the indicator for a dynamic group (collection) , so we 
can separate group enums and dynamic group (collection)

Tim



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20081006/bf6ac894/attachment-0003.htm>


More information about the PackageKit mailing list