From 421c9933e5e97e4819e8a1aaad712601d64337eb Mon Sep 17 00:00:00 2001 From: Antony Woods Date: Thu, 22 Nov 2012 15:24:21 +0000 Subject: [PATCH] Further improvements :) --- cockatrice/data_scraper.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cockatrice/data_scraper.py b/cockatrice/data_scraper.py index 7227d63..c7dbdd0 100644 --- a/cockatrice/data_scraper.py +++ b/cockatrice/data_scraper.py @@ -66,7 +66,8 @@ def add_field(card_dict, key, tds_list, index): card_dict[key] = tds_list[index].text.encode("UTF-8") index += 1 return index - + + # -------------------------------------------------- class CardSetEntry ( threading.Thread ): def __init__(self, name): super(CardSetEntry, self).__init__() @@ -120,10 +121,14 @@ def run ( self ): current_card["set/rarity"] = tds[td_idx + 1].text.encode("UTF-8") elif td.text.encode("UTF-8") == "Color:": current_card["color"] = tds[td_idx + 1].text.encode("UTF-8") - + + # don't forget the last one :) + self.cards.append( current_card ) +# -------------------------------------------------- + threads = list() - #for set in sets_name_list[4:5]: - threads.append(CardSetEntry("Innistrad")) + for set in sets_name_list: + threads.append(CardSetEntry(set)) for t in threads: t.start()