This commit is contained in:
flaskfarm
2022-10-17 21:37:31 +09:00
parent a78ac3442e
commit 672d8016a8
2 changed files with 10 additions and 10 deletions

View File

@@ -1 +1 @@
VERSION="4.0.17" VERSION="4.0.18"

View File

@@ -12,7 +12,7 @@ class SupportSC:
LIBRARY_LOADING = False LIBRARY_LOADING = False
try: try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'libsc')) sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'libsc'))
import support.base.support_sc as support_sc import sc
LIBRARY_LOADING = True LIBRARY_LOADING = True
except: except:
pass pass
@@ -21,8 +21,8 @@ class SupportSC:
@classmethod @classmethod
def encode(cls, text, mode=0): def encode(cls, text, mode=0):
try: try:
import support.base.support_sc as support_sc import sc
return support_sc.encode(text, mode) return sc.encode(text, mode)
except Exception as e: except Exception as e:
logger.error(f'Exception:{str(e)}') logger.error(f'Exception:{str(e)}')
logger.error(traceback.format_exc()) logger.error(traceback.format_exc())
@@ -32,16 +32,16 @@ class SupportSC:
@classmethod @classmethod
def decode(cls, text): def decode(cls, text):
try: try:
import support.base.support_sc as support_sc import sc
return support_sc.decode(text) return sc.decode(text)
except: except:
return None return None
@classmethod @classmethod
def load_module(cls, module_name, module_code): def load_module(cls, module_name, module_code):
try: try:
import support.base.support_sc as support_sc import sc
mod = support_sc.load_module(module_name, module_code) mod = sc.load_module(module_name, module_code)
sys.modules[mod] = mod sys.modules[mod] = mod
logger.warning(f"C-LOADING : {module_name}") logger.warning(f"C-LOADING : {module_name}")
return mod return mod
@@ -65,8 +65,8 @@ class SupportSC:
@classmethod @classmethod
def td(self, mediacode, ts, url): def td(self, mediacode, ts, url):
try: try:
import support.base.support_sc as support_sc import sc
ret = support_sc.td1(mediacode, str(ts), url).strip() ret = sc.td1(mediacode, str(ts), url).strip()
ret = re.sub('[^ -~]+', '', ret).strip() ret = re.sub('[^ -~]+', '', ret).strip()
return ret return ret
except: except: