Skip to content

Commit 817a136

Browse files
authored
use print with round brackets (compatible)
1 parent 76a5576 commit 817a136

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ saml_settings = auth.get_settings()
624624
metadata = saml_settings.get_sp_metadata()
625625
errors = saml_settings.validate_metadata(metadata)
626626
if len(errors) == 0:
627-
print metadata
627+
print(metadata)
628628
else:
629-
print "Error found on Metadata: %s" % (', '.join(errors))
629+
print("Error found on Metadata: %s" % (', '.join(errors)))
630630
```
631631

632632
The get_sp_metadata will return the metadata signed or not based on the security info of the advanced_settings.json ('signMetadata').
@@ -656,11 +656,11 @@ if not errors:
656656
auth.redirect_to(req['post_data']['RelayState'])
657657
else:
658658
for attr_name in request.session['samlUserdata'].keys():
659-
print '%s ==> %s' % (attr_name, '|| '.join(request.session['samlUserdata'][attr_name]))
659+
print('%s ==> %s' % (attr_name, '|| '.join(request.session['samlUserdata'][attr_name])))
660660
else:
661-
print 'Not authenticated'
661+
print('Not authenticated')
662662
else:
663-
print "Error when processing SAML Response: %s" % (', '.join(errors))
663+
print("Error when processing SAML Response: %s" % (', '.join(errors)))
664664
```
665665

666666
The SAML response is processed and then checked that there are no errors. It also verifies that the user is authenticated and stored the userdata in session.
@@ -697,9 +697,9 @@ The following code is equivalent:
697697

698698
```python
699699
attributes = auth.get_attributes();
700-
print attributes['cn']
700+
print(attributes['cn'])
701701

702-
print auth.get_attribute('cn')
702+
print(auth.get_attribute('cn'))
703703
```
704704

705705
Before trying to get an attribute, check that the user is authenticated. If the user isn't authenticated, an empty dict will be returned. For example, if we call to get_attributes before a auth.process_response, the get_attributes() will return an empty dict.
@@ -717,9 +717,9 @@ if len(errors) == 0:
717717
if url is not None:
718718
return redirect(url)
719719
else:
720-
print "Sucessfully Logged out"
720+
print("Sucessfully Logged out")
721721
else:
722-
print "Error when processing SLO: %s" % (', '.join(errors))
722+
print("Error when processing SLO: %s" % (', '.join(errors)))
723723
```
724724

725725
If the SLS endpoints receives a Logout Response, the response is validated and the session could be closed, using the callback.
@@ -848,9 +848,9 @@ elif 'sls' in request.args: # Single
848848
msg = "Sucessfully logged out"
849849

850850
if len(errors) == 0:
851-
print msg
851+
print(msg)
852852
else:
853-
print ', '.join(errors)
853+
print(', '.join(errors))
854854
```
855855

856856

0 commit comments

Comments
 (0)