diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2016-05-26 16:12:21 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-15 08:35:04 +0100 |
| commit | 32d1e2dd25f288790450db48766cf115854712ba (patch) | |
| tree | 0957025538fdd29b111884891f14becc55dcc018 /bitbake/lib/toaster/toastergui/buildtables.py | |
| parent | a786ac14f1c6c02c38dc141125035445413f1250 (diff) | |
| download | poky-32d1e2dd25f288790450db48766cf115854712ba.tar.gz | |
bitbake: toaster: port Built recipes table to toastertables
(Bitbake rev: 9434d3925bb7768876aae8d649ea00b8d849c6e9)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/buildtables.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/buildtables.py | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/buildtables.py b/bitbake/lib/toaster/toastergui/buildtables.py index cf07ea8789..dc742b9fe5 100644 --- a/bitbake/lib/toaster/toastergui/buildtables.py +++ b/bitbake/lib/toaster/toastergui/buildtables.py | |||
| @@ -150,3 +150,132 @@ class BuiltPackagesTable(BuildTablesMixin, BuiltPackagesTableBase): | |||
| 150 | yield column | 150 | yield column |
| 151 | 151 | ||
| 152 | self.columns = list(remove_dep_cols(self.columns)) | 152 | self.columns = list(remove_dep_cols(self.columns)) |
| 153 | |||
| 154 | |||
| 155 | class BuiltRecipesTable(BuildTablesMixin): | ||
| 156 | """ Table to show the recipes that have been built in this build """ | ||
| 157 | |||
| 158 | def __init__(self, *args, **kwargs): | ||
| 159 | super(BuiltRecipesTable, self).__init__(*args, **kwargs) | ||
| 160 | self.title = "Recipes built" | ||
| 161 | self.default_orderby = "name" | ||
| 162 | |||
| 163 | def setup_queryset(self, *args, **kwargs): | ||
| 164 | build = Build.objects.get(pk=kwargs['build_id']) | ||
| 165 | self.static_context_extra['build'] = build | ||
| 166 | self.queryset = build.get_recipes() | ||
| 167 | self.queryset = self.queryset.order_by(self.default_orderby) | ||
| 168 | |||
| 169 | def setup_columns(self, *args, **kwargs): | ||
| 170 | recipe_name_tmpl =\ | ||
| 171 | '<a href="{% url "recipe" extra.build.pk data.pk %}">'\ | ||
| 172 | '{{data.name}}'\ | ||
| 173 | '</a>' | ||
| 174 | |||
| 175 | recipe_version_tmpl =\ | ||
| 176 | '<a href="{% url "recipe" extra.build.pk data.pk %}">'\ | ||
| 177 | '{{data.version}}'\ | ||
| 178 | '</a>' | ||
| 179 | |||
| 180 | recipe_file_tmpl =\ | ||
| 181 | '{{data.file_path}}'\ | ||
| 182 | '{% if data.pathflags %}<i>({{data.pathflags}})</i>'\ | ||
| 183 | '{% endif %}' | ||
| 184 | |||
| 185 | git_rev_template = ''' | ||
| 186 | {% with vcs_ref=data.layer_version.commit %} | ||
| 187 | {% include 'snippets/gitrev_popover.html' %} | ||
| 188 | {% endwith %} | ||
| 189 | ''' | ||
| 190 | |||
| 191 | depends_on_tmpl = ''' | ||
| 192 | {% with deps=data.r_dependencies_recipe.all %} | ||
| 193 | {% with count=deps|length %} | ||
| 194 | {% if count %} | ||
| 195 | <a class="btn" title=" | ||
| 196 | <a href='{% url "recipe" extra.build.pk data.pk %}#dependencies'> | ||
| 197 | {{data.name}}</a> dependencies" | ||
| 198 | data-content="<ul class='unstyled'> | ||
| 199 | {% for dep in deps|dictsort:"depends_on.name"%} | ||
| 200 | <li><a href='{% url "recipe" extra.build.pk dep.depends_on.pk %}'> | ||
| 201 | {{dep.depends_on.name}}</a></li> | ||
| 202 | {% endfor %} | ||
| 203 | </ul>"> | ||
| 204 | {{count}} | ||
| 205 | </a> | ||
| 206 | {% endif %}{% endwith %}{% endwith %} | ||
| 207 | ''' | ||
| 208 | |||
| 209 | rev_depends_tmpl = ''' | ||
| 210 | {% with revs=data.r_dependencies_depends.all %} | ||
| 211 | {% with count=revs|length %} | ||
| 212 | {% if count %} | ||
| 213 | <a class="btn" | ||
| 214 | title=" | ||
| 215 | <a href='{% url "recipe" extra.build.pk data.pk %}#brought-in-by'> | ||
| 216 | {{data.name}}</a> reverse dependencies" | ||
| 217 | data-content="<ul class='unstyled'> | ||
| 218 | {% for dep in revs|dictsort:"recipe.name" %} | ||
| 219 | <li> | ||
| 220 | <a href='{% url "recipe" extra.build.pk dep.recipe.pk %}'> | ||
| 221 | {{dep.recipe.name}} | ||
| 222 | </a></li> | ||
| 223 | {% endfor %} | ||
| 224 | </ul>"> | ||
| 225 | {{count}} | ||
| 226 | </a> | ||
| 227 | {% endif %}{% endwith %}{% endwith %} | ||
| 228 | ''' | ||
| 229 | |||
| 230 | self.add_column(title="Name", | ||
| 231 | field_name="name", | ||
| 232 | static_data_name='name', | ||
| 233 | orderable=True, | ||
| 234 | static_data_template=recipe_name_tmpl) | ||
| 235 | |||
| 236 | self.add_column(title="Version", | ||
| 237 | field_name="version", | ||
| 238 | static_data_name='version', | ||
| 239 | static_data_template=recipe_version_tmpl) | ||
| 240 | |||
| 241 | self.add_column(title="Dependencies", | ||
| 242 | static_data_name="dependencies", | ||
| 243 | static_data_template=depends_on_tmpl, | ||
| 244 | hidden=True) | ||
| 245 | |||
| 246 | self.add_column(title="Reverse dependencies", | ||
| 247 | static_data_name="revdeps", | ||
| 248 | static_data_template=rev_depends_tmpl, | ||
| 249 | help_text='Recipe build-time reverse dependencies' | ||
| 250 | ' (i.e. the recipes that depend on this recipe)', | ||
| 251 | hidden=True) | ||
| 252 | |||
| 253 | self.add_column(title="Recipe file", | ||
| 254 | field_name="file_path", | ||
| 255 | static_data_name="file_path", | ||
| 256 | static_data_template=recipe_file_tmpl) | ||
| 257 | |||
| 258 | self.add_column(title="Section", | ||
| 259 | field_name="section", | ||
| 260 | orderable=True) | ||
| 261 | |||
| 262 | self.add_column(title="License", | ||
| 263 | field_name="license", | ||
| 264 | help_text='Multiple license names separated by the' | ||
| 265 | ' pipe character indicates a choice between licenses.' | ||
| 266 | ' Multiple license names separated by the ampersand' | ||
| 267 | ' character indicates multiple licenses exist that' | ||
| 268 | ' cover different parts of the source', | ||
| 269 | orderable=True) | ||
| 270 | |||
| 271 | self.add_column(title="Layer", | ||
| 272 | field_name="layer_version__layer__name", | ||
| 273 | orderable=True) | ||
| 274 | |||
| 275 | self.add_column(title="Layer branch", | ||
| 276 | field_name="layer_version__branch", | ||
| 277 | orderable=True) | ||
| 278 | |||
| 279 | self.add_column(title="Layer commit", | ||
| 280 | static_data_name="commit", | ||
| 281 | static_data_template=git_rev_template) | ||
