Skip to content

Commit

Permalink
Fixed group tree on fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
anaselli committed Oct 23, 2016
1 parent 6ee23bb commit d920627
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions dnfdragora/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def _fillPackageList(self, groupName=None, filter="all") :
# }
pkgs = ()
if (groupName != 'All') :
pkgs = self.backend.get_group_packages(groupName, 'all')
#NOTE fedora gets packages using the leaf and not a group called X/Y/Z
grp = groupName.split("/")
pkgs = self.backend.get_group_packages(grp[-1], 'all')
if pkgs :
v = []
for pkg in pkgs :
Expand Down Expand Up @@ -436,13 +438,19 @@ def _groupNameFromItem(self, group, treeItem) :

return None

def _getAllGroupIDList(self, groups, new_groups):
for g in groups :
if (type(g) is str) :
new_groups.append(g)
break
else :
self. _getAllGroupIDList(g, new_groups)
def _getAllGroupIDList(self, groups, new_groups, g_id=None) :
'''
return a list of group ID as pathnames
'''
gid = g_id
for gl in groups:
if (isinstance(gl, list)):
if (type(gl[0]) is str) :
new_groups.append(gid + "/" + gl[0] if (gid) else gl[0])
if not gid :
gid = gl[0]
else :
self._getAllGroupIDList(gl, new_groups, gid)

def _fillGroupTree(self) :
'''
Expand Down

0 comments on commit d920627

Please sign in to comment.