|
@ -14,9 +14,7 @@ class Procedure(Document): |
|
|
if self.procedure_details: |
|
|
if self.procedure_details: |
|
|
for x in self.get("procedure_details"): |
|
|
for x in self.get("procedure_details"): |
|
|
if x.content: |
|
|
if x.content: |
|
|
# try: |
|
|
|
|
|
# title = x.content.encode('cp1252').decode('UTF-8') |
|
|
|
|
|
# frappe.msgprint(str(x.as_dict())+":" +str(title)) |
|
|
|
|
|
res_str = re.sub("–", "—", x.content) |
|
|
res_str = re.sub("–", "—", x.content) |
|
|
res_str = re.sub("—", "–", res_str) |
|
|
res_str = re.sub("—", "–", res_str) |
|
|
res_str = re.sub("‘", "‘", res_str) |
|
|
res_str = re.sub("‘", "‘", res_str) |
|
@ -24,12 +22,8 @@ class Procedure(Document): |
|
|
res_str = re.sub("“", "“", res_str) |
|
|
res_str = re.sub("“", "“", res_str) |
|
|
res_str = re.sub("â€", "”", res_str) |
|
|
res_str = re.sub("â€", "”", res_str) |
|
|
res_str = re.sub("Â", "", res_str) |
|
|
res_str = re.sub("Â", "", res_str) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x.content = res_str |
|
|
x.content = res_str |
|
|
# frappe.msgprint(str(title)) |
|
|
|
|
|
# except Exception as e: |
|
|
|
|
|
# frappe.log_error("validate encoding",frappe.get_traceback()) |
|
|
|
|
|
if x.content_type == "File": |
|
|
if x.content_type == "File": |
|
|
if not x.file: |
|
|
if not x.file: |
|
|
frappe.throw("Please choose the file in row no " + str(x.idx)) |
|
|
frappe.throw("Please choose the file in row no " + str(x.idx)) |
|
|