refactor to auto import

This commit is contained in:
hsafaei
2025-01-13 10:50:00 +03:30
parent e991cc84cb
commit d819408715
35 changed files with 3832 additions and 1504 deletions
+8
View File
@@ -6,6 +6,8 @@ from re import sub
import textwrap
from html import escape
from bs4 import BeautifulSoup
import json
from decimal import Decimal
# from lxml import etree
import datetime
@@ -29,6 +31,12 @@ for tag in tableTag:
regTable = r'<(?P<slash>\/)*(?P<tag>'+strTable+')(?P<class>[^>]+)*>'
regTableReplace = r'#[#\g<slash>\g<tag>\g<class>#]#'
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return float(obj)
return json.JSONEncoder.default(self, obj)
def isNeedHtml(html):
if "<TABLE" in html or "<table" in html or "</TR" in html or "</tr" in html :