Commit 41eabb5b authored by Jérome Perrin's avatar Jérome Perrin

corporate_identity: pylint on py3

parent f9bea035
...@@ -85,7 +85,7 @@ book_version = html_quote(override_document_version) if override_document_versio ...@@ -85,7 +85,7 @@ book_version = html_quote(override_document_version) if override_document_versio
book_description = html_quote(override_document_description) if override_document_description else book.getDescription() book_description = html_quote(override_document_description) if override_document_description else book.getDescription()
book_title = html_quote(override_document_title) if override_document_title else book.getTitle() book_title = html_quote(override_document_title) if override_document_title else book.getTitle()
if six.PY2 and isinstance(book_content, unicode): if six.PY2 and isinstance(book_content, six.text_type):
book_content = book_content.encode("UTF-8") book_content = book_content.encode("UTF-8")
# backcompat # backcompat
......
...@@ -37,7 +37,7 @@ contract_version = context.getVersion() or "001" ...@@ -37,7 +37,7 @@ contract_version = context.getVersion() or "001"
contract_description = context.getDescription() contract_description = context.getDescription()
contract_title = context.getTitle() contract_title = context.getTitle()
if six.PY2 and isinstance(contract_content, unicode): if six.PY2 and isinstance(contract_content, six.text_type):
contract_content = contract_content.encode("UTF-8") contract_content = contract_content.encode("UTF-8")
contract_history_section_list = re.findall('<section.+?>.+?</section>', contract_content, re.S) contract_history_section_list = re.findall('<section.+?>.+?</section>', contract_content, re.S)
......
...@@ -149,9 +149,9 @@ if leaflet_display_side: ...@@ -149,9 +149,9 @@ if leaflet_display_side:
#leaflet_content = leaflet_legalese.decode() + leaflet_content.decode() #leaflet_content = leaflet_legalese.decode() + leaflet_content.decode()
if six.PY2: if six.PY2:
if isinstance(leaflet_legalese, unicode): if isinstance(leaflet_legalese, six.text_type):
leaflet_legalese = leaflet_legalese.encode("UTF-8") leaflet_legalese = leaflet_legalese.encode("UTF-8")
if isinstance(leaflet_content, unicode): if isinstance(leaflet_content, six.text_type):
leaflet_content = leaflet_content.encode("UTF-8") leaflet_content = leaflet_content.encode("UTF-8")
leaflet_content = leaflet_legalese + leaflet_content leaflet_content = leaflet_legalese + leaflet_content
......
...@@ -140,9 +140,9 @@ if release_display_about: ...@@ -140,9 +140,9 @@ if release_display_about:
) )
#release_content = release_content.decode() + release_about.decode() #release_content = release_content.decode() + release_about.decode()
if six.PY2: if six.PY2:
if isinstance(release_content, unicode): if isinstance(release_content, six.text_type):
release_content = release_content.encode("UTF-8") release_content = release_content.encode("UTF-8")
if isinstance(release_about, unicode): if isinstance(release_about, six.text_type):
release_about = release_about.encode("UTF-8") release_about = release_about.encode("UTF-8")
release_content = release_content + release_about release_content = release_content + release_about
......
...@@ -71,24 +71,8 @@ if portal_type == 'Web Page': ...@@ -71,24 +71,8 @@ if portal_type == 'Web Page':
if portal_type == 'Web Section': if portal_type == 'Web Section':
websection = context websection = context
return generateOpenGraphParamaters(websection) return generateOpenGraphParamaters(websection)
"""
default_document = websection.getDefaultDocumentValue()
if default_document is not None:
return generateOpenGraphParamaters(default_document, True)
else:
return generateOpenGraphParamaters(websection)
"""
if portal_type == 'Web Site': if portal_type == 'Web Site':
return generateOpenGraphParamaters(website) return generateOpenGraphParamaters(website)
"""
default_document = website.getDefaultDocumentValue()
if default_document is not None:
return generateOpenGraphParamaters(default_document, True)
else:
return generateOpenGraphParamaters(website)
"""
return '' return ''
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