2to3: use py3 compatible functions
authorNsukami Patrick <ndkpatt at gmail dot com>
Tue, 19 Mar 2019 08:27:55 +0000
changeset 81 5ec2c14fade9
parent 80 f2b596741f6f
child 82 fec2bbdeee20
2to3: use py3 compatible functions - use print as a function - use range function instead of xrange function
cubicweb_fresh/hooks.py
cubicweb_fresh/views/accounting.py
--- a/cubicweb_fresh/hooks.py	Tue Mar 19 08:20:33 2019 +0000
+++ b/cubicweb_fresh/hooks.py	Tue Mar 19 08:27:55 2019 +0000
@@ -12,6 +12,6 @@
         bfssdir = join(self.repo.config.appdatahome, 'bfss')
         if not exists(bfssdir):
             makedirs(bfssdir)
-            print 'created', bfssdir
+            print('created', bfssdir)
         storage = storages.BytesFileSystemStorage(bfssdir)
         storages.set_attribute_storage(self.repo, 'File', 'data', storage)
--- a/cubicweb_fresh/views/accounting.py	Tue Mar 19 08:20:33 2019 +0000
+++ b/cubicweb_fresh/views/accounting.py	Tue Mar 19 08:27:55 2019 +0000
@@ -28,14 +28,14 @@
         self.w(u'<?xml-stylesheet href="%saccounting-entries.xsl" '
                u'rel="stylesheet" type="text/xsl"?>\n' % self._cw.datadir_url)
         self.w(u'<ecritures>\n')
-        for i in xrange(self.cw_rset.rowcount):
+        for i in range(self.cw_rset.rowcount):
             self.cell_call(i, 0)
         self.w(u'</ecritures>\n')
 
     def cell_call(self, row, col):
         entity = self.cw_rset.get_entity(row, col)
         rset = entity.related('has_lines')
-        for i in xrange(len(rset)):
+        for i in range(len(rset)):
             self.wview('accentry', rset, row=i, col=0)
 
 
@@ -54,7 +54,7 @@
         self.w(u'<?xml-stylesheet href="%saccounting-entries.xsl" '
                u'rel="stylesheet" type="text/xsl"?>\n' % self._cw.datadir_url)
         self.w(u'<ecritures>\n')
-        for i in xrange(self.cw_rset.rowcount):
+        for i in range(self.cw_rset.rowcount):
             self.cell_call(i, 0)
         self.w(u'</ecritures>\n')