<s> from . import global_vars <EOL> class PolygonFile : <EOL> def __init__ ( self ) : <EOL> self . name = None <EOL> self . type = None <EOL> self . date = None <EOL> self . size = None <EOL> self . remove_link = None <EOL> self . download_link = None <EOL> self . edit_link = None <EOL> def __repr__ ( self ) : <EOL> return str ( self . __dict__ ) <EOL> def by_dict ( self , data ) : <EOL> for key in data . keys ( ) : <EOL> if key != '<STR_LIT>' : <EOL> setattr ( self , key , data [ key ] ) <EOL> def normalize ( self , session ) : <EOL> """<STR_LIT>""" <EOL> assert self . remove_link <EOL> assert self . download_link <EOL> assert self . edit_link <EOL> self . remove_link = session . make_link ( self . remove_link , ssid = True ) <EOL> self . download_link = session . make_link ( self . download_link , ssid = True ) <EOL> self . edit_link = session . make_link ( self . edit_link , ssid = True ) <EOL> def get_content ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . type == '<STR_LIT>' : <EOL> file_text = global_vars . problem . load_script ( ) <EOL> else : <EOL> file_text = global_vars . problem . send_request ( '<STR_LIT:GET>' , self . download_link ) . content <EOL> return file_text <EOL> def get_default_local_dir ( self ) : <EOL> if self . type == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> if self . type == '<STR_LIT:source>' : <EOL> return '<STR_LIT:src>' <EOL> if self . type == '<STR_LIT>' : <EOL> return '<STR_LIT:src>' <EOL> if self . type == '<STR_LIT>' : <EOL> return '<STR_LIT:src>' <EOL> if self . type == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> raise NotImplementedError ( "<STR_LIT>" % self . type ) </s>
