Skip to content

Commit

Permalink
Further improvements :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony Woods committed Nov 22, 2012
1 parent 4cd3600 commit 421c993
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cockatrice/data_scraper.py
Expand Up @@ -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__()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 421c993

Please sign in to comment.