#NEWLINE# def __init__( self , idx , n = 1 , base = BASE_URL , api = IMAGE_API , country_code = None , market_code = None , high_resolution = PreferHighResolution , resolution = '1920x1200' , collect = [ ] ) : #NEWLINE# #INDENT# self . idx = idx #NEWLINE# self . n = n #NEWLINE# self . base = base #NEWLINE# self . api = api #NEWLINE# self . reset ( ) #NEWLINE# self . url = webutil . urljoin ( self . base , self . api . format ( idx = idx , n = n ) ) #NEWLINE# self . country_code = country_code #NEWLINE# self . market_code = market_code #NEWLINE# self . high_resolution = high_resolution #NEWLINE# self . resolution = n #NEWLINE# self . collect = collect #NEWLINE# if market_code : #NEWLINE# #INDENT# BingWallpaperPage . validate_market ( market_code ) #NEWLINE# self . url = '&' . join ( [ self . url , 'mkt={}' . format ( market_code ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if country_code : #NEWLINE# #INDENT# self . url = '&' . join ( [ self . url , 'cc={}' . format ( country_code ) ] )