Skip to content
Permalink
Browse files

[IMP] handle encoding

  • Loading branch information...
legalsylvain authored and OCA-git-bot committed Jul 22, 2019
1 parent e780829 commit a5b6512c5262fbfb48e439fa74c09b32e80b43bb
Showing with 7 additions and 1 deletion.
  1. +7 −1 module_analysis/models/ir_module_module.py
@@ -77,6 +77,10 @@ def _get_clean_analyse_values(self):
'css_code_qty': 0,
}

@api.model
def _get_module_encoding(self, file_ext):
return 'utf-8'

# Overload Section
@api.model
def update_list(self):
@@ -141,7 +145,9 @@ def button_analyse_code(self):
exclude_files)

for file_path, file_ext in file_list:
file_res = pygount.source_analysis(file_path, '')
file_res = pygount.source_analysis(
file_path, '',
encoding=self._get_module_encoding(file_ext))
for k, v in analysed_datas.get(file_ext).items():
v['value'] += getattr(file_res, k)

0 comments on commit a5b6512

Please sign in to comment.
You can’t perform that action at this time.