[doc] Fix bugs in code examples
authorElodie Thieblin <ethieblin@logilab.fr>
Wed, 18 Mar 2020 11:30:05 +0100
changeset 12928 327b11ee0914
parent 12927 89acc8d3d462
child 12929 edfee40475bb
[doc] Fix bugs in code examples
doc/tutorials/advanced/part02_security.rst
doc/tutorials/advanced/part03_bfss.rst
--- a/doc/tutorials/advanced/part02_security.rst	Wed Mar 18 11:29:30 2020 +0100
+++ b/doc/tutorials/advanced/part02_security.rst	Wed Mar 18 11:30:05 2020 +0100
@@ -174,7 +174,7 @@
 Step 2: security propagation in hooks
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-To fullfill the requirements, we have to implement::
+To fullfill the requirements defined earlier, we have to implement:
 
   Also, unless explicity specified, visibility of an image should be the same as
   its parent folder, as well as visibility of a comment should be the same as the
@@ -348,7 +348,7 @@
                                            visibility=u'restricted')
                 photo1 = cnx.create_entity('File',
                                            data_name=u'photo1.jpg',
-                                           data=Binary('xxx'),
+                                           data=Binary(b'xxx'),
                                            filed_under=folder)
 
                 cnx.commit()
@@ -359,7 +359,7 @@
                 # unless explicitly specified
                 photo2 = cnx.create_entity('File',
                                            data_name=u'photo2.jpg',
-                                           data=Binary('xxx'),
+                                           data=Binary(b'xxx'),
                                            visibility=u'public',
                                            filed_under=folder)
 
--- a/doc/tutorials/advanced/part03_bfss.rst	Wed Mar 18 11:29:30 2020 +0100
+++ b/doc/tutorials/advanced/part03_bfss.rst	Wed Mar 18 11:30:05 2020 +0100
@@ -31,7 +31,7 @@
             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)