add error for items with no reward data
This commit is contained in:
@@ -64,6 +64,4 @@ if __name__ == '__main__':
|
|||||||
if item_row is None:
|
if item_row is None:
|
||||||
sys.exit(os.EX_DATAERR)
|
sys.exit(os.EX_DATAERR)
|
||||||
ir = rewards.ItemRewards(db, item_row)
|
ir = rewards.ItemRewards(db, item_row)
|
||||||
ir.print_recommended_hunts(out)
|
ir.print_all(out)
|
||||||
ir.print_monsters(out)
|
|
||||||
ir.print_quests(out)
|
|
||||||
|
|||||||
@@ -35,6 +35,4 @@ if __name__ == '__main__':
|
|||||||
if item_row is None:
|
if item_row is None:
|
||||||
sys.exit(os.EX_DATAERR)
|
sys.exit(os.EX_DATAERR)
|
||||||
ir = rewards.ItemRewards(db, item_row)
|
ir = rewards.ItemRewards(db, item_row)
|
||||||
ir.print_recommended_hunts(out)
|
ir.print_all(out)
|
||||||
ir.print_monsters(out)
|
|
||||||
ir.print_quests(out)
|
|
||||||
|
|||||||
@@ -519,6 +519,9 @@ class ItemRewards(object):
|
|||||||
self._find_hunt_items()
|
self._find_hunt_items()
|
||||||
self._find_quest_items()
|
self._find_quest_items()
|
||||||
|
|
||||||
|
def is_empty(self):
|
||||||
|
return (not self._hunt_items and not self._quest_items)
|
||||||
|
|
||||||
def _find_hunt_items(self):
|
def _find_hunt_items(self):
|
||||||
monsters = self.db.get_item_monsters(self.item_id)
|
monsters = self.db.get_item_monsters(self.item_id)
|
||||||
|
|
||||||
@@ -658,3 +661,12 @@ class ItemRewards(object):
|
|||||||
if shiny_ev:
|
if shiny_ev:
|
||||||
out.write(" %20s %5.2f / 100\n" % ("Shiny", shiny_ev))
|
out.write(" %20s %5.2f / 100\n" % ("Shiny", shiny_ev))
|
||||||
out.write("\n")
|
out.write("\n")
|
||||||
|
|
||||||
|
def print_all(self, out):
|
||||||
|
if self.is_empty():
|
||||||
|
# TODO: this happens for Wymporium tradeable monster parts.
|
||||||
|
out.write("ERROR: data for this item is not yet available\n")
|
||||||
|
return
|
||||||
|
self.print_recommended_hunts(out)
|
||||||
|
self.print_monsters(out)
|
||||||
|
self.print_quests(out)
|
||||||
|
|||||||
Reference in New Issue
Block a user