Skip to content

Commit

Permalink
Reprt for Item
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Sep 4, 2014
1 parent 3b305a6 commit a4401ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class Item(object):
def __init__(self, ID, dbname, category, fullname, altname=None):
self.ID, self.dbname, self.category, self.fullname, self.altname = ID, dbname, category, fullname, altname


def name(self):
return self.dbname

Expand All @@ -232,6 +233,13 @@ def __str__(self):
return '{}/{}'.format(self.category.name, self.dbname)


def __repr__(self):
return "Item(ID={}, dbname='{}', category={}, fullname='{}', altName={})".format(
self.ID, re.escape(self.dbname), repr(self.category), re.escape(self.fullname),
"'{}'".format(re.escape(self.altname) if self.altname else 'None')
)


class Trade(object):
"""
Describes what it would cost and how much you would gain
Expand Down

0 comments on commit a4401ce

Please sign in to comment.