def __init__(self, game_json, appid):
        """
        This sets member variables for the various values
        that the game object should have. Not all of these exist on all
        appids, so there's some defaults whenever there is a key error.

        TODO: This is so awful. Rewrite this whole ugly method into
        smaller ones.

        """

        self.appid = appid
        if 'success' in game_json:
            self.success = game_json['success']
            if self.success:
                self.store_url = self._store_url(self.appid)
                data = game_json['data']
                self.raw_json = data
                self.type = data['type']
                self.descriptidataon = data['detailed_description']

                # Some appids don't have names
                try:
                    self.name = data['name']
                except KeyError:
                    self.name = "No Name"

                try:
                    self.supported_languages = data['supported_languages']
                except __HOLE__:
                    self.supported_languages = None

                self.header_image = "http://cdn.steampowered.com/v/gfx/apps/{}/capsule_184x69.jpg".format(self.appid)
                self.website = data['website']

                # If any of these don't exit all of them don't exist,
                # which is why I think it's okay to wrap them all in one try/except.
                try:
                    self.currency = data['price_overview']['currency']
                    self.price = self._calc_price(data['price_overview']['initial'])
                    self.discounted_price = self._calc_price(data['price_overview']['final'])
                    self.discount_percent = data['price_overview']['discount_percent']
                except KeyError:
                    self.currency = None
                    self.price = 0
                    self.discounted_price = 0
                    self.discount_percent = 0

                try:
                    self.packages = data['packages']
                except KeyError:
                    self.packages = None

                self.platforms = data['platforms']

                try:
                    self.categories = data['categories']
                except KeyError:
                    self.categories = None

        else:
            print "Error! Can't read the game info for {}".format(appid)
dataset/ETHPy150Open naiyt/steamapiwrapper/steamapiwrapper/SteamGames.py/Game.__init__