spells-mtg 0.9.2__tar.gz → 0.9.3__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.
Potentially problematic release.
This version of spells-mtg might be problematic. Click here for more details.
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/PKG-INFO +1 -1
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/pyproject.toml +1 -1
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/__init__.py +3 -1
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/draft_data.py +4 -3
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/log.py +9 -9
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/LICENSE +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/README.md +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/cache.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/cards.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/columns.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/config.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/enums.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/extension.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/external.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/filter.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/manifest.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/spells/schema.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/tests/__init__.py +0 -0
- {spells_mtg-0.9.2 → spells_mtg-0.9.3}/tests/filter_test.py +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
1
3
|
from spells.columns import ColSpec
|
|
2
4
|
from spells.enums import ColType, ColName
|
|
3
5
|
from spells.draft_data import summon, view_select, get_names
|
|
@@ -5,4 +7,4 @@ from spells.log import setup_logging
|
|
|
5
7
|
|
|
6
8
|
setup_logging()
|
|
7
9
|
|
|
8
|
-
__all__ = ["summon", "view_select", "get_names", "ColSpec", "ColType", "ColName"]
|
|
10
|
+
__all__ = ["summon", "view_select", "get_names", "ColSpec", "ColType", "ColName", "logging"]
|
|
@@ -356,10 +356,11 @@ def _fetch_or_cache(
|
|
|
356
356
|
|
|
357
357
|
if read_cache:
|
|
358
358
|
if cache.cache_exists(set_code, key):
|
|
359
|
-
logging.
|
|
359
|
+
logging.info(f"Cache {key} found")
|
|
360
360
|
return cache.read_cache(set_code, key)
|
|
361
361
|
|
|
362
|
-
logging.
|
|
362
|
+
logging.info("Cache not found, calculating")
|
|
363
|
+
logging.debug(f"Signature:\n{cache_args}")
|
|
363
364
|
df = calc_fn()
|
|
364
365
|
|
|
365
366
|
if write_cache:
|
|
@@ -490,7 +491,7 @@ def summon(
|
|
|
490
491
|
|
|
491
492
|
concat_dfs = []
|
|
492
493
|
for code in codes:
|
|
493
|
-
logging.
|
|
494
|
+
logging.info(f"Calculating agg df for {code}")
|
|
494
495
|
if isinstance(card_context, pl.DataFrame):
|
|
495
496
|
set_card_context = card_context.filter(pl.col("expansion") == code)
|
|
496
497
|
elif isinstance(card_context, dict):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from contextlib import contextmanager
|
|
2
|
+
from functools import wraps
|
|
2
3
|
import logging
|
|
3
4
|
import logging.handlers
|
|
4
5
|
from pathlib import Path
|
|
@@ -42,8 +43,9 @@ def rotate_logs():
|
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
@contextmanager
|
|
45
|
-
def
|
|
46
|
+
def console_logging(log_level):
|
|
46
47
|
console_handler = logging.StreamHandler(sys.stdout)
|
|
48
|
+
console_handler.setLevel(log_level)
|
|
47
49
|
formatter = logging.Formatter(
|
|
48
50
|
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
49
51
|
)
|
|
@@ -57,12 +59,10 @@ def add_console_logging():
|
|
|
57
59
|
logger.removeHandler(console_handler)
|
|
58
60
|
|
|
59
61
|
|
|
60
|
-
def make_verbose(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
else:
|
|
66
|
-
return callable(*args, **kwargs)
|
|
67
|
-
|
|
62
|
+
def make_verbose(func: Callable) -> Callable:
|
|
63
|
+
@wraps(func)
|
|
64
|
+
def wrapped(*args, logging: int=logging.ERROR, **kwargs):
|
|
65
|
+
with console_logging(logging):
|
|
66
|
+
return func(*args, **kwargs)
|
|
68
67
|
return wrapped
|
|
68
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|