forked from Techsystech/web
[FLAKE8] fix falke 8 issues
parent
ac4724a98d
commit
679e03c668
|
@ -121,11 +121,11 @@ class ExportHelpWizard(models.TransientModel):
|
||||||
continue
|
continue
|
||||||
page_url = '/page/%s' % page_prefix
|
page_url = '/page/%s' % page_prefix
|
||||||
template_url = '/page/%s' % template_prefix
|
template_url = '/page/%s' % template_prefix
|
||||||
if not page_url in href and not template_url in href:
|
if page_url not in href and template_url not in href:
|
||||||
continue
|
continue
|
||||||
elif page_url in href and not template_url in href:
|
elif page_url in href and template_url not in href:
|
||||||
pass
|
pass
|
||||||
elif not page_url in href and template_url in href:
|
elif page_url not in href and template_url in href:
|
||||||
page_url = template_url
|
page_url = template_url
|
||||||
else:
|
else:
|
||||||
if page_prefix in template_prefix:
|
if page_prefix in template_prefix:
|
||||||
|
@ -157,7 +157,7 @@ class ExportHelpWizard(models.TransientModel):
|
||||||
thumbnail = ET.SubElement(main_div,
|
thumbnail = ET.SubElement(main_div,
|
||||||
'div',
|
'div',
|
||||||
attrib={'class': 'oe_snippet_thumbnail'})
|
attrib={'class': 'oe_snippet_thumbnail'})
|
||||||
img = ET.SubElement(thumbnail,
|
ET.SubElement(thumbnail,
|
||||||
'img',
|
'img',
|
||||||
attrib={'class': 'oe_snippet_thumbnail_img',
|
attrib={'class': 'oe_snippet_thumbnail_img',
|
||||||
'src': HELP_ONLINE_SNIPPET_IMAGE_PATH})
|
'src': HELP_ONLINE_SNIPPET_IMAGE_PATH})
|
||||||
|
@ -167,7 +167,7 @@ class ExportHelpWizard(models.TransientModel):
|
||||||
span.text = page_node.attrib['name'].replace(template_prefix, '')
|
span.text = page_node.attrib['name'].replace(template_prefix, '')
|
||||||
body = ET.SubElement(main_div,
|
body = ET.SubElement(main_div,
|
||||||
'section',
|
'section',
|
||||||
attrib={'class': 'oe_snippet_body '\
|
attrib={'class': 'oe_snippet_body '
|
||||||
'mt_simple_snippet'})
|
'mt_simple_snippet'})
|
||||||
|
|
||||||
template = page.find(".//div[@id='wrap']")
|
template = page.find(".//div[@id='wrap']")
|
||||||
|
@ -272,6 +272,6 @@ class ExportHelpWizard(models.TransientModel):
|
||||||
backup_file.write(xml_data)
|
backup_file.write(xml_data)
|
||||||
backup_file.close
|
backup_file.close
|
||||||
except:
|
except:
|
||||||
_logger.warning(_('Unable to write autobackup file '\
|
_logger.warning(_('Unable to write autobackup file '
|
||||||
'in given directory: %s'
|
'in given directory: %s'
|
||||||
% autobackup_path))
|
% autobackup_path))
|
||||||
|
|
|
@ -58,7 +58,7 @@ class test_export_help_wizard(object):
|
||||||
attrib={'class': 'row'})
|
attrib={'class': 'row'})
|
||||||
bodyDivNode = ET.SubElement(rowNode,
|
bodyDivNode = ET.SubElement(rowNode,
|
||||||
'div',
|
'div',
|
||||||
attrib={'class': 'col-md-12 '\
|
attrib={'class': 'col-md-12 '
|
||||||
'text-center mt16 mb32'})
|
'text-center mt16 mb32'})
|
||||||
style = "font-family: 'Helvetica Neue', Helvetica,"\
|
style = "font-family: 'Helvetica Neue', Helvetica,"\
|
||||||
" Arial, sans-serif; color: rgb(51, 51, 51);"\
|
" Arial, sans-serif; color: rgb(51, 51, 51);"\
|
||||||
|
@ -73,7 +73,7 @@ class test_export_help_wizard(object):
|
||||||
attrib={'style': 'text-align: left;'})
|
attrib={'style': 'text-align: left;'})
|
||||||
src = "/website/image?field=datas&"\
|
src = "/website/image?field=datas&"\
|
||||||
"model=ir.attachment&id=%s" % str(imgId)
|
"model=ir.attachment&id=%s" % str(imgId)
|
||||||
imgNode = ET.SubElement(imgDivNode,
|
ET.SubElement(imgDivNode,
|
||||||
'img',
|
'img',
|
||||||
attrib={'class': 'img-thumbnail',
|
attrib={'class': 'img-thumbnail',
|
||||||
'src': src})
|
'src': src})
|
||||||
|
@ -81,7 +81,7 @@ class test_export_help_wizard(object):
|
||||||
'div',
|
'div',
|
||||||
attrib={'style': 'text-align: left;'})
|
attrib={'style': 'text-align: left;'})
|
||||||
src = "/website/image/ir.attachment/%s_ccc838d/datas" % str(imgId)
|
src = "/website/image/ir.attachment/%s_ccc838d/datas" % str(imgId)
|
||||||
imgNode = ET.SubElement(imgDivNode,
|
ET.SubElement(imgDivNode,
|
||||||
'img',
|
'img',
|
||||||
attrib={'class': 'img-thumbnail',
|
attrib={'class': 'img-thumbnail',
|
||||||
'src': src})
|
'src': src})
|
||||||
|
@ -128,7 +128,7 @@ class test_export_help_wizard(object):
|
||||||
for imgElem in templateNodeList[0].iter('img'):
|
for imgElem in templateNodeList[0].iter('img'):
|
||||||
imgSrc = imgElem.get('src')
|
imgSrc = imgElem.get('src')
|
||||||
if '/ir.attachment/' in imgSrc:
|
if '/ir.attachment/' in imgSrc:
|
||||||
self.assertIn("/ir.attachment/%s_img_02|" \
|
self.assertIn("/ir.attachment/%s_img_02|"
|
||||||
% self.pageName, imgSrc)
|
% self.pageName, imgSrc)
|
||||||
else:
|
else:
|
||||||
self.assertIn("id=%s_img_01" % self.pageName, imgSrc)
|
self.assertIn("id=%s_img_01" % self.pageName, imgSrc)
|
||||||
|
@ -155,7 +155,7 @@ class test_export_help_template(test_export_help_wizard,
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(test_export_help_template, self).setUp()
|
super(test_export_help_template, self).setUp()
|
||||||
parameter_model = self.env['ir.config_parameter']
|
parameter_model = self.env['ir.config_parameter']
|
||||||
template_prefix = parameter_model.get_param(
|
param = 'help_online_template_prefix'
|
||||||
'help_online_template_prefix')
|
template_prefix = parameter_model.get_param(param)
|
||||||
self.pageName = '%stest-template' % template_prefix
|
self.pageName = '%stest-template' % template_prefix
|
||||||
self.pageTemplate = True
|
self.pageTemplate = True
|
||||||
|
|
Loading…
Reference in New Issue