diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-25 22:55:05 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-15 14:22:49 +0000 |
commit | d7bf8c17eca8f8c89898a7794462c773c449e983 (patch) | |
tree | d18618fca85ca5f0c077032cc7b009344b60f663 /import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py | |
parent | e2b5abdc9f28cdf8578e5b9be803c8e697443c20 (diff) | |
download | talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.tar.gz talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.zip |
Yocto 2.4
Move OpenBMC to Yocto 2.4(rocko)
Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py')
-rw-r--r-- | import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py index 58c650f8f..5aa0f8d88 100644 --- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py +++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py @@ -100,6 +100,36 @@ class MachinesTypeAhead(ToasterTypeAhead): return results +class DistrosTypeAhead(ToasterTypeAhead): + """ Typeahead for all the distros available in the current project's + configuration """ + def __init__(self): + super(DistrosTypeAhead, self).__init__() + + def apply_search(self, search_term, prj, request): + distros = prj.get_available_distros() + distros = distros.order_by("name") + + primary_results = distros.filter(name__istartswith=search_term) + secondary_results = distros.filter(name__icontains=search_term).exclude(pk__in=primary_results) + tertiary_results = distros.filter(layer_version__layer__name__icontains=search_term).exclude(pk__in=primary_results).exclude(pk__in=secondary_results) + + results = [] + + for distro in list(primary_results) + list(secondary_results) + list(tertiary_results): + + detail = "[ %s ]" % (distro.layer_version.layer.name) + needed_fields = { + 'id' : distro.pk, + 'name' : distro.name, + 'detail' : detail, + } + + results.append(needed_fields) + + return results + + class RecipesTypeAhead(ToasterTypeAhead): """ Typeahead for all the recipes available in the current project's configuration """ |