<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> class BaseModel ( object ) : <EOL> def __init__ ( self , client , data ) : <EOL> self . _client = client <EOL> def __str__ ( self ) : <EOL> return str ( { key : self . __dict__ [ key ] for key in self . __dict__ if key != '<STR_LIT>' } ) <EOL> def __repr__ ( self ) : <EOL> return repr ( self . __dict__ ) <EOL> def __iter__ ( self ) : <EOL> return self . __dict__ . __iter__ ( ) <EOL> class Order ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Order , self ) . __init__ ( client , data ) <EOL> self . product = Product ( client , data [ '<STR_LIT>' ] ) <EOL> subscriptions = data . get ( '<STR_LIT>' , [ ] ) <EOL> self . subscriptions = [ Subscription ( client , sub ) for sub in subscriptions ] if len ( subscriptions ) > <NUM_LIT:0> else None <EOL> self . thankname = data . get ( '<STR_LIT>' , None ) <EOL> self . claimed = data . get ( '<STR_LIT>' , None ) <EOL> self . gamekey = data . get ( '<STR_LIT>' , None ) <EOL> self . country = data . get ( '<STR_LIT>' , None ) <EOL> self . giftee = data . get ( '<STR_LIT>' , None ) <EOL> self . leaderboard = data . get ( '<STR_LIT>' , None ) <EOL> self . owner_username = data . get ( '<STR_LIT>' , None ) <EOL> self . platform = data . get ( '<STR_LIT>' , None ) <EOL> self . subproducts = ( [ Subproduct ( client , prod ) for prod in data . get ( '<STR_LIT>' , [ ] ) ] ) or None <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . product . machine_name <EOL> class Product ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Product , self ) . __init__ ( client , data ) <EOL> self . category = data . get ( <NUM_LIT:1> , None ) <EOL> self . human_name = data [ '<STR_LIT>' ] <EOL> self . machine_name = data [ '<STR_LIT>' ] <EOL> self . supports_canonical = data [ '<STR_LIT>' ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . machine_name <EOL> class StoreProduct ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( StoreProduct , self ) . __init__ ( client , data ) <EOL> self . category = data . get ( <NUM_LIT:1> , None ) <EOL> self . human_name = data [ '<STR_LIT>' ] <EOL> self . machine_name = data [ '<STR_LIT>' ] <EOL> self . current_price = Price ( client , data [ '<STR_LIT>' ] ) <EOL> self . full_price = Price ( client , data [ '<STR_LIT>' ] ) <EOL> self . icon = data [ '<STR_LIT>' ] <EOL> self . platforms = data [ '<STR_LIT>' ] <EOL> self . delivery_methods = data [ '<STR_LIT>' ] <EOL> self . description = data [ '<STR_LIT:description>' ] <EOL> self . content_types = data [ '<STR_LIT>' ] <EOL> self . youtube_id = data [ '<STR_LIT>' ] <EOL> self . esrb_rating = data [ '<STR_LIT>' ] <EOL> self . pegi_rating = data [ '<STR_LIT>' ] <EOL> self . developers = data [ '<STR_LIT>' ] <EOL> self . publishers = data [ '<STR_LIT>' ] <EOL> self . allowed_territories = data [ '<STR_LIT>' ] <EOL> self . minimum_age = data [ '<STR_LIT>' ] <EOL> self . system_requirements = data [ '<STR_LIT>' ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . machine_name <EOL> class Subscription ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Subscription , self ) . __init__ ( client , data ) <EOL> self . human_name = data [ '<STR_LIT>' ] <EOL> self . list_name = data [ '<STR_LIT>' ] <EOL> self . subscribed = data [ '<STR_LIT>' ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( self . list_name , self . subscribed ) <EOL> class Subproduct ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Subproduct , self ) . __init__ ( client , data ) <EOL> self . machine_name = data [ '<STR_LIT>' ] <EOL> self . payee = Payee ( client , data [ '<STR_LIT>' ] ) <EOL> self . url = data [ '<STR_LIT:url>' ] <EOL> self . downloads = [ Download ( client , download ) for download in data [ '<STR_LIT>' ] ] <EOL> self . human_name = data [ '<STR_LIT>' ] <EOL> self . custom_download_page_box_html = data [ '<STR_LIT>' ] <EOL> self . icon = data [ '<STR_LIT>' ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . machine_name <EOL> class Payee ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Payee , self ) . __init__ ( client , data ) <EOL> self . human_name = data [ '<STR_LIT>' ] <EOL> self . machine_name = data [ '<STR_LIT>' ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . machine_name <EOL> class Download ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Download , self ) . __init__ ( client , data ) <EOL> self . machine_name = data [ '<STR_LIT>' ] <EOL> self . platform = data [ '<STR_LIT>' ] <EOL> self . download_struct = [ DownloadStruct ( client , struct ) for struct in data [ '<STR_LIT>' ] ] <EOL> self . options_dict = data [ '<STR_LIT>' ] <EOL> self . download_identifier = data [ '<STR_LIT>' ] <EOL> self . download_version_number = data [ '<STR_LIT>' ] <EOL> def sign_download_url ( self , * args , ** kwargs ) : <EOL> return self . _client . sign_download_url ( self . machine_name , * args , ** kwargs ) <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % self . machine_name <EOL> class DownloadStruct ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( DownloadStruct , self ) . __init__ ( client , data ) <EOL> self . sha1 = data . get ( '<STR_LIT>' , None ) <EOL> self . name = data . get ( '<STR_LIT:name>' , None ) <EOL> self . message = data . get ( '<STR_LIT:message>' , None ) <EOL> self . url = Url ( client , data . get ( '<STR_LIT:url>' , { } ) ) <EOL> self . external_link = data . get ( '<STR_LIT>' , None ) <EOL> self . recommend_bittorrent = data . get ( '<STR_LIT>' , None ) <EOL> self . human_size = data . get ( '<STR_LIT>' , None ) <EOL> self . file_size = data . get ( '<STR_LIT>' , None ) <EOL> self . md5 = data . get ( '<STR_LIT>' , None ) <EOL> self . fat32_warning = data . get ( '<STR_LIT>' , None ) <EOL> self . size = data . get ( '<STR_LIT:size>' , None ) <EOL> self . small = data . get ( '<STR_LIT>' , None ) <EOL> class Url ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Url , self ) . __init__ ( client , data ) <EOL> self . web = data . get ( '<STR_LIT>' , None ) <EOL> self . bittorrent = data . get ( '<STR_LIT>' , None ) <EOL> class Price ( BaseModel ) : <EOL> def __init__ ( self , client , data ) : <EOL> super ( Price , self ) . __init__ ( client , data ) <EOL> self . value = data [ <NUM_LIT:0> ] <EOL> self . currency = data [ <NUM_LIT:1> ] <EOL> def __cmp__ ( self , other ) : <EOL> if other . currency == self . currency : <EOL> if self . value < other . value : <EOL> return - <NUM_LIT:1> <EOL> elif self . value > other . value : <EOL> return <NUM_LIT:1> <EOL> else : <EOL> return <NUM_LIT:0> <EOL> else : <EOL> raise NotImplemented ( "<STR_LIT>" ) <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" . format ( value = self . value , currency = self . currency ) </s>
