formatize 1.0.4__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {formatize-1.0.4 → formatize-1.0.6}/PKG-INFO +1 -1
- {formatize-1.0.4 → formatize-1.0.6}/setup.cfg +1 -1
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize/__init__.py +1 -1
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize/form.py +37 -5
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize.egg-info/PKG-INFO +1 -1
- {formatize-1.0.4 → formatize-1.0.6}/LICENSE +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/README.md +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/pyproject.toml +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize/const.py +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize.egg-info/SOURCES.txt +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize.egg-info/dependency_links.txt +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize.egg-info/requires.txt +0 -0
- {formatize-1.0.4 → formatize-1.0.6}/src/formatize.egg-info/top_level.txt +0 -0
|
@@ -3,15 +3,18 @@ from typing import List, Dict, Optional
|
|
|
3
3
|
from importlib import import_module
|
|
4
4
|
from bs4 import BeautifulSoup
|
|
5
5
|
|
|
6
|
-
import datetime
|
|
7
|
-
import hashlib
|
|
8
|
-
import json
|
|
9
|
-
import math
|
|
10
6
|
import re
|
|
11
|
-
import
|
|
7
|
+
import sys
|
|
8
|
+
import types
|
|
12
9
|
import string
|
|
10
|
+
import inspect
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import math
|
|
13
14
|
import uuid
|
|
14
15
|
import yaml
|
|
16
|
+
import hashlib
|
|
17
|
+
import datetime
|
|
15
18
|
|
|
16
19
|
import socket
|
|
17
20
|
import smtplib
|
|
@@ -620,6 +623,35 @@ def update_module(Module, vals: dict) -> bool:
|
|
|
620
623
|
except:
|
|
621
624
|
return False
|
|
622
625
|
|
|
626
|
+
def create_nested_module (nested_module_name: str) -> types.ModuleType:
|
|
627
|
+
parts = nested_module_name.split('.')
|
|
628
|
+
module = None
|
|
629
|
+
parent = None
|
|
630
|
+
full_name = ''
|
|
631
|
+
for part in parts:
|
|
632
|
+
full_name = f'{full_name}.{part}' if full_name else part
|
|
633
|
+
if full_name in sys.modules:
|
|
634
|
+
module = sys.modules[full_name]
|
|
635
|
+
else:
|
|
636
|
+
module = types.ModuleType(full_name)
|
|
637
|
+
sys.modules[full_name] = module
|
|
638
|
+
if parent:
|
|
639
|
+
setattr(parent, part, module)
|
|
640
|
+
parent = module
|
|
641
|
+
return module
|
|
642
|
+
|
|
643
|
+
def add_function_to_nested_module (module, func_name, func):
|
|
644
|
+
setattr(module, func_name, func)
|
|
645
|
+
|
|
646
|
+
def add_class_to_nested_module (module, class_name, cls):
|
|
647
|
+
setattr(module, class_name, cls)
|
|
648
|
+
|
|
649
|
+
def frender (non_f_str: str):
|
|
650
|
+
return eval(f'f"""{non_f_str}"""', globals())
|
|
651
|
+
|
|
652
|
+
def punctescape (text: str) -> str:
|
|
653
|
+
return re.compile(f'[{re.escape(string.punctuation)}]').sub('', text)
|
|
654
|
+
|
|
623
655
|
## FRONTEND FORMATTINGS
|
|
624
656
|
|
|
625
657
|
def load_yaml_temp (filepath):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|