From 479338cc7b43b55740ba2396d94dd88c3d8fc445 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 3 Feb 2015 15:40:41 +0000 Subject: bitbake: toaster: All machines add a column to link back to machine conf Add a column with the "path" to the machine file and add a link back to the vcs web to view the machine configuration file. (Bitbake rev: c1462c0530fe6c34ffef87bcde7a363995b503c9) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/orm/models.py | 7 ++++++- bitbake/lib/toaster/toastergui/templates/machines.html | 1 + bitbake/lib/toaster/toastergui/views.py | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 454f3692be..ad7a8569f2 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -538,6 +538,11 @@ class Machine(models.Model): name = models.CharField(max_length=255) description = models.CharField(max_length=255) + def get_vcs_machine_file_link_url(self): + path = 'conf/machine/'+self.name+'.conf' + + return self.layer_version.get_vcs_file_link_url(path) + def __unicode__(self): return "Machine " + self.name + "(" + self.description + ")" @@ -901,7 +906,7 @@ class Layer_Version(models.Model): # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ def _handle_url_path(self, base_url, path): - import re + import re, posixpath if base_url: if self.dirpath: if path: diff --git a/bitbake/lib/toaster/toastergui/templates/machines.html b/bitbake/lib/toaster/toastergui/templates/machines.html index c0d4c6cc33..e3329bf238 100644 --- a/bitbake/lib/toaster/toastergui/templates/machines.html +++ b/bitbake/lib/toaster/toastergui/templates/machines.html @@ -48,6 +48,7 @@ {{o.layer_version.layer.name}} {{o.layer_source.name}} {{o.layer_version.commit}} + /machine/conf/{{o.name}}.conf Select machine diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 9d85a93b7b..c89b67bcd1 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -2797,7 +2797,6 @@ if toastermain.settings.MANAGED: # retrieve the objects that will be displayed in the table; machines a paginator and gets a page range to display machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1)) - context = { 'objects' : machine_info, 'project_layers' : project_layers, @@ -2834,6 +2833,10 @@ if toastermain.settings.MANAGED: 'qhelp' : "The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project", 'hidden': 1, }, + { 'name' : 'Machine file', + 'clclass' : 'machinefile', + 'hidden' : 1, + }, { 'name': 'Select', 'dclass': 'span2', 'qhelp': "Add or delete machines to / from your project ", -- cgit v1.2.3-54-g00ecf