Commit 7da5d585 authored by wanli's avatar wanli

更新

parent ec21ca71
...@@ -15,8 +15,6 @@ import threading ...@@ -15,8 +15,6 @@ import threading
import decimal import decimal
import uuid import uuid
from app.setting import config
class DecimalEncoder(json.JSONEncoder): class DecimalEncoder(json.JSONEncoder):
def default(self, o): def default(self, o):
if isinstance(o, decimal.Decimal): if isinstance(o, decimal.Decimal):
...@@ -118,7 +116,7 @@ def writeFile(fpath, result): ...@@ -118,7 +116,7 @@ def writeFile(fpath, result):
f.write(result) f.write(result)
def md5_salt(s): def md5_salt(s):
md5 = hashlib.md5(config['MD5_SALT'].encode("utf-8")) md5 = hashlib.md5("EhuqUkwV".encode("utf-8"))
md5.update(s.encode('utf-8')) md5.update(s.encode('utf-8'))
return md5.hexdigest() return md5.hexdigest()
...@@ -149,4 +147,5 @@ def get_days_before_datetime(dt, dayAgo): ...@@ -149,4 +147,5 @@ def get_days_before_datetime(dt, dayAgo):
return dayAgo.strftime("%Y-%m-%d %H:%M:%S") return dayAgo.strftime("%Y-%m-%d %H:%M:%S")
if __name__ == "__main__": if __name__ == "__main__":
print(os.path.abspath(__file__))
print(random_string(7)) print(random_string(7))
\ No newline at end of file
...@@ -14,10 +14,12 @@ import hashlib ...@@ -14,10 +14,12 @@ import hashlib
from ctypes import * from ctypes import *
import platform import platform
current_abspath = os.path.dirname(os.path.realpath(__file__))
if platform.system() == 'Windows': if platform.system() == 'Windows':
pDll = CDLL("lib/eheatshrink.dll") pDll = CDLL(os.sep.join([current_abspath, "lib", "eheatshrink.dll"]))
elif platform.system() == 'Linux': elif platform.system() == 'Linux':
pDll = CDLL("lib/libeheatshrink.so") pDll = CDLL(os.sep.join([current_abspath, "lib", "libeheatshrink.so"]))
pDll.ecompress_size.restype = c_uint32 pDll.ecompress_size.restype = c_uint32
pDll.ecompress_size.argtypes = [c_void_p, c_uint32] pDll.ecompress_size.argtypes = [c_void_p, c_uint32]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment