1# -*- coding: utf-8 -*- 

2 

3# Copyright 2013-2019 The Distro Tracker Developers 

4# See the COPYRIGHT file at the top-level directory of this distribution and 

5# at https://deb.li/DTAuthors 

6# 

7# This file is part of Distro Tracker. It is subject to the license terms 

8# in the LICENSE file found in the top-level directory of this 

9# distribution and at https://deb.li/DTLicense. No part of Distro Tracker, 

10# including this file, may be copied, modified, propagated, or distributed 

11# except according to the terms contained in the LICENSE file. 

12"""Debci specific panel on the package page.""" 

13 

14from distro_tracker.core.models import PackageData 

15from distro_tracker.core.panels import LinksPanel 

16 

17 

18class DebciLink(LinksPanel.ItemProvider): 

19 """ 

20 If there are any debci report for the package, provides a link to the 

21 debci page. 

22 """ 

23 def get_panel_items(self): 

24 try: 

25 debci_data = self.package.data.get(key='debci') 

26 except PackageData.DoesNotExist: 

27 return [] 

28 

29 return [LinksPanel.SimpleLinkItem('debci', debci_data.value[0]['url'])]