Spaces:
Sleeping
Sleeping
MilanCalegari
commited on
Commit
·
fe1d98b
1
Parent(s):
15c6b6b
fix: path
Browse files- modules/tarot/card.py +11 -4
- scripts/get_cards.py +1 -3
modules/tarot/card.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
import os
|
2 |
import json
|
|
|
3 |
import random
|
4 |
|
5 |
from ..utils.commom import Card, CardReadingMethod
|
@@ -12,9 +12,9 @@ class TarotDeck:
|
|
12 |
)
|
13 |
data_dir = os.path.join(base_dir, "data")
|
14 |
json_file = os.path.join(data_dir, "tarot-images.json")
|
15 |
-
|
16 |
print(f"TarotDeck looking for JSON at: {json_file}")
|
17 |
-
|
18 |
with open(json_file) as f:
|
19 |
self.cards_json = json.load(f)
|
20 |
|
@@ -24,7 +24,14 @@ class TarotDeck:
|
|
24 |
name = card_data["name"]
|
25 |
number = int(card_data["number"])
|
26 |
is_major_arcana = card_data["arcana"]
|
27 |
-
image_pth =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
card = Card(
|
30 |
name=name,
|
|
|
|
|
1 |
import json
|
2 |
+
import os
|
3 |
import random
|
4 |
|
5 |
from ..utils.commom import Card, CardReadingMethod
|
|
|
12 |
)
|
13 |
data_dir = os.path.join(base_dir, "data")
|
14 |
json_file = os.path.join(data_dir, "tarot-images.json")
|
15 |
+
|
16 |
print(f"TarotDeck looking for JSON at: {json_file}")
|
17 |
+
|
18 |
with open(json_file) as f:
|
19 |
self.cards_json = json.load(f)
|
20 |
|
|
|
24 |
name = card_data["name"]
|
25 |
number = int(card_data["number"])
|
26 |
is_major_arcana = card_data["arcana"]
|
27 |
+
image_pth = os.path.join(
|
28 |
+
os.path.dirname(
|
29 |
+
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
30 |
+
),
|
31 |
+
"data",
|
32 |
+
"cards",
|
33 |
+
card_data["img"],
|
34 |
+
)
|
35 |
|
36 |
card = Card(
|
37 |
name=name,
|
scripts/get_cards.py
CHANGED
@@ -5,9 +5,7 @@ import requests
|
|
5 |
|
6 |
|
7 |
def get_cards():
|
8 |
-
base_dir = os.path.dirname(
|
9 |
-
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
10 |
-
)
|
11 |
data_dir = os.path.join(base_dir, "data")
|
12 |
os.makedirs(data_dir, exist_ok=True)
|
13 |
|
|
|
5 |
|
6 |
|
7 |
def get_cards():
|
8 |
+
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
9 |
data_dir = os.path.join(base_dir, "data")
|
10 |
os.makedirs(data_dir, exist_ok=True)
|
11 |
|