Commit 7ff62cff authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[py3] use print function

parent daee1b520c1d
...@@ -5,6 +5,7 @@ Usage: cubicweb-ctl update-webstats [options] <instance-name> startdate [stopdat ...@@ -5,6 +5,7 @@ Usage: cubicweb-ctl update-webstats [options] <instance-name> startdate [stopdat
This command will generate webstats objects for all linked document types. This command will generate webstats objects for all linked document types.
""" """
from __future__ import print_function
import os.path as osp import os.path as osp
from datetime import datetime, timedelta from datetime import datetime, timedelta
...@@ -56,7 +57,7 @@ def parse_input_date(date, periodicity): ...@@ -56,7 +57,7 @@ def parse_input_date(date, periodicity):
try: try:
return datetime.strptime(date, input_formats[periodicity]) return datetime.strptime(date, input_formats[periodicity])
except ValueError: except ValueError:
print 'Error : %s not a proper date' % date print('Error : %s not a proper date' % date)
return None return None
...@@ -236,7 +237,7 @@ class UpdateWebstatsCommand(Command): ...@@ -236,7 +237,7 @@ class UpdateWebstatsCommand(Command):
stats_updater = StatsUpdater(cnx, start, stop) stats_updater = StatsUpdater(cnx, start, stop)
stats_report = stats_updater.update_stats( stats_report = stats_updater.update_stats(
self.config.skip_compress) self.config.skip_compress)
print '''=== Update Report === print('''=== Update Report ===
Number of periods imported : %(periods)s Number of periods imported : %(periods)s
Number of stat objects created : %(created)s Number of stat objects created : %(created)s
Number of stat objects updated : %(updated)s Number of stat objects updated : %(updated)s
...@@ -244,6 +245,6 @@ Number of stat objects already existed : %(exists no change)s ...@@ -244,6 +245,6 @@ Number of stat objects already existed : %(exists no change)s
Number of stat objects skipped : %(skipped)s Number of stat objects skipped : %(skipped)s
Number of stat objects ignored : %(ignored)s Number of stat objects ignored : %(ignored)s
Number of stat objects compressed : %(compressed)s Number of stat objects compressed : %(compressed)s
''' % stats_report ''' % stats_report)
CWCTL.register(UpdateWebstatsCommand) CWCTL.register(UpdateWebstatsCommand)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment