1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

# Copyright 2013 The Distro Tracker Developers 

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

# at https://deb.li/DTAuthors 

# 

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

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

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

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

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

"""Implements a command to update available pseudo packages.""" 

from django.core.management.base import BaseCommand 

 

from distro_tracker.core.models import PseudoPackageName 

from distro_tracker.core.retrieve_data import update_pseudo_package_list 

 

 

class Command(BaseCommand): 

""" 

A Django management command which performs the update of available pseudo 

packages. 

""" 

help = "Update the available pseudo packages" # noqa 

 

def handle(self, *args, **kwargs): 

verbose = int(kwargs['verbosity']) > 1 

26 ↛ 27line 26 didn't jump to line 27, because the condition on line 26 was never true if verbose: 

self.stdout.write('Retrieving new list of pseudo-packages...') 

 

update_pseudo_package_list() 

 

31 ↛ 32line 31 didn't jump to line 32, because the condition on line 31 was never true if verbose: 

self.stdout.write("The updated list of pseudo-packages is:") 

for package in PseudoPackageName.objects.all(): 

self.stdout.write('- ' + str(package))