#wip(py): Errors in base64 done.
This commit is contained in:
parent
3571f6aba7
commit
ac82b0a78b
@ -242,7 +242,7 @@ class Anonymous(MemWeb.Abstracts.Common):
|
|||||||
data[processed_key] = self.__get_method(data, subkey)
|
data[processed_key] = self.__get_method(data, subkey)
|
||||||
|
|
||||||
error |= (
|
error |= (
|
||||||
(1 << 0 if i else 0) if data[processed_key] == None else
|
(0 if i else 1 << 0) if data[processed_key] == None else
|
||||||
1 << 1 if not callable(data[processed_key]) else
|
1 << 1 if not callable(data[processed_key]) else
|
||||||
0) << (38 + i * 2)
|
0) << (38 + i * 2)
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ from inspect import stack as get_stack
|
|||||||
from traceback import format_stack as trace_format_stack
|
from traceback import format_stack as trace_format_stack
|
||||||
from traceback import extract_tb as extract_traceback
|
from traceback import extract_tb as extract_traceback
|
||||||
from time import time as timestamp
|
from time import time as timestamp
|
||||||
|
from base64 import b64encode as base64_encode
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
if "common" not in globals():
|
if "common" not in globals():
|
||||||
@ -529,6 +530,13 @@ class MemWeb:
|
|||||||
"method" : stack.function,
|
"method" : stack.function,
|
||||||
"line" : stack.lineno
|
"line" : stack.lineno
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def base64_encode(data):
|
||||||
|
return base64_encode(bytes(
|
||||||
|
data.to_bytes((data.bit_length() + 7) // 8, byteorder = "big") if isinstance(data, (int, float)) else
|
||||||
|
data.encode() if isinstance(data, str) else
|
||||||
|
data.encode("ascii"))).decode()
|
||||||
|
|
||||||
def _print(self, _type, message, inputs = None, i = 1):
|
def _print(self, _type, message, inputs = None, i = 1):
|
||||||
|
|
||||||
@ -738,7 +746,8 @@ class MemWeb:
|
|||||||
if error_message:
|
if error_message:
|
||||||
|
|
||||||
own = {
|
own = {
|
||||||
"code" : error,
|
"code" : self.base64_encode(error),
|
||||||
|
"raw_code" : error,
|
||||||
"end" : "",
|
"end" : "",
|
||||||
**{key : value for subset in (variables if isinstance(variables, (list, tuple)) else (variables,)) for key, value in (subset if isinstance(subset, dict) else {}).items()}
|
**{key : value for subset in (variables if isinstance(variables, (list, tuple)) else (variables,)) for key, value in (subset if isinstance(subset, dict) else {}).items()}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user