Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some errors

  • Loading branch information...
commit 3c6745572c4dc22cfb7faa4261742dfc16986b2e 1 parent b8b05b2
@Jwsonic authored
Showing with 7 additions and 6 deletions.
  1. +1 −1  app.yaml
  2. +1 −2  cards.txt
  3. +5 −3 main.py
View
2  app.yaml
@@ -1,5 +1,5 @@
application: sealed-generator
-version: 1
+version: 2
runtime: python27
api_version: 1
threadsafe: true
View
3  cards.txt
@@ -1,4 +1,3 @@
-name~rarity~guild
Angel of Serenity~Mythic Rare~Azorius|Selesnya
Armory Guard~Common~Azorius|Selesnya
Arrest~Uncommon~Azorius|Selesnya
@@ -26,7 +25,7 @@ Sphere of Safety~Uncommon~Azorius|Selesnya
Sunspire Griffin~Common~Azorius|Selesnya
Swift Justice~Common~Azorius|Selesnya
Trained Caracal~Common~Azorius|Selesnya
-Trostani's Judgment~Common~Azorius|Selesnya
+Trostani's Judegment~Common~Azorius|Selesnya
Aquus Steed~Uncommon~Azorius|Izzet
Blustersquall~Uncommon~Azorius|Izzet
Cancel~Common~Azorius|Izzet
View
8 main.py
@@ -54,12 +54,16 @@ def generate_pack(mythics, rares, uncommons, commons, basic_lands=None):
with open('cards.txt') as f:
cards = [Card(name=row[0], rarity=row[1], guild=row[2]) for row in csv.reader(f, delimiter='~')]
+ for card in cards:
+ if str(card).find('Mythic Rare') > -1:
+ logging.info(str(card) + '\n')
+
def r(cards, rarity):
return [card.name for card in cards if card.rarity == rarity]
def gen_pack(card_pool):
"""Generate a normal pack of cards for sealed"""
- return generate_pack(mythics=(card_pool, 'Mythic Rare'), rares=r(card_pool, 'Rare'), uncommons=r(card_pool, 'Uncommon'), commons=r(card_pool, 'Common'), basic_lands=r(card_pool, 'Basic Land'))
+ return generate_pack(mythics=r(card_pool, 'Mythic Rare'), rares=r(card_pool, 'Rare'), uncommons=r(card_pool, 'Uncommon'), commons=r(card_pool, 'Common'), basic_lands=r(card_pool, 'Basic Land'))
class MainPage(webapp2.RequestHandler):
def get(self):
@@ -123,6 +127,4 @@ def post(self):
logging.info('Writing response')
self.response.write(deck_file_str.format('\n'.join([card_str.format(number, name) for name, number in pool.items()])))
-
-
app = webapp2.WSGIApplication([('/', MainPage)], debug=True)
Please sign in to comment.
Something went wrong with that request. Please try again.