Skip to content

Commit

Permalink
Fix def being unusable because python moment
Browse files Browse the repository at this point in the history
  • Loading branch information
EllieJaybee committed Jan 7, 2023
1 parent 3498eab commit fb2923b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Monster Attributes
+--------------------+---------------------------------+
| attribute | The card's attribute |
+--------------------+---------------------------------+
| def | The card's defense points |
| def_ | The card's defense points |
+--------------------+---------------------------------+
| desc | The card's description |
+--------------------+---------------------------------+
Expand Down
5 changes: 4 additions & 1 deletion yugioh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ class Card:
def __init__(self, q):
for key, value in q.items():
if key not in ("card_sets", "card_images", "card_prices"):
setattr(self, key, value)
if key == "def":
setattr(self, "def_", value)
else:
setattr(self, key, value)

def __get(parameters):
return requests.get('https://db.ygoprodeck.com/api/v7/cardinfo.php',
Expand Down

0 comments on commit fb2923b

Please sign in to comment.