]> git.0d.be Git - panikdb.git/commitdiff
commands: use print as a function
authorFrédéric Péters <fpeters@0d.be>
Mon, 6 Jan 2020 19:04:33 +0000 (20:04 +0100)
committerFrédéric Péters <fpeters@0d.be>
Mon, 6 Jan 2020 19:04:33 +0000 (20:04 +0100)
panikdb/aa/management/commands/load-csv-users.py
panikdb/stats/management/commands/load-piwik-stats.py

index eb6543192c4f58cf053fb2165032c1d42b553911..663483b3d529c34f648dc6bb59441fc184c9ac1d 100644 (file)
@@ -40,6 +40,6 @@ class Command(BaseCommand):
                 try:
                     emissions.append(Emission.objects.get(slug=slug))
                 except Emission.DoesNotExist:
-                    print 'E: missing emission:', slug
+                    print('E: missing emission:', slug)
             user.emissions = emissions
             user.save()
index 044655dfa4f7f20c417bc05593dffd1d78f6962a..33908568c70d4f101cb8408327f5a533eba4ccc5 100644 (file)
@@ -21,10 +21,10 @@ class Command(BaseCommand):
         request = urllib2.Request(url)
         request.add_header('Accept', 'application/json')
         if self.verbose:
-            print 'calling piwik'
+            print('calling piwik')
         result = json.load(urllib2.urlopen(request))
         if self.verbose:
-            print 'collecting results'
+            print('collecting results')
         for day in result:
             day_datetime = datetime.datetime.strptime(day, '%Y-%m-%d')
             for stat_segment in result.get(day):
@@ -36,7 +36,7 @@ class Command(BaseCommand):
                         soundfile = SoundFile.objects.get(id=sound_id)
                     except (SoundFile.DoesNotExist, ValueError):
                         if self.verbose:
-                            print 'failed to process', entry.get('label')
+                            print('failed to process', entry.get('label'))
                         continue
                     try:
                         stat = DailyStat.objects.get(soundfile=soundfile,