<s> """<STR_LIT>""" <EOL> import os <EOL> from website . files . models . base import FileNode <EOL> class PathFollowingFileNode ( FileNode ) : <EOL> """<STR_LIT>""" <EOL> FOLDER_ATTR_NAME = '<STR_LIT>' <EOL> @ classmethod <EOL> def get_or_create ( cls , node , path ) : <EOL> """<STR_LIT>""" <EOL> node_settings = node . get_addon ( cls . provider ) <EOL> path = os . path . join ( getattr ( node_settings , cls . FOLDER_ATTR_NAME ) . strip ( '<STR_LIT:/>' ) , path . lstrip ( '<STR_LIT:/>' ) ) <EOL> return super ( PathFollowingFileNode , cls ) . get_or_create ( node , '<STR_LIT:/>' + path ) <EOL> @ property <EOL> def path ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT:/>' + self . stored_object . path . replace ( self . _get_connected_path ( ) , '<STR_LIT>' , <NUM_LIT:1> ) . lstrip ( '<STR_LIT:/>' ) <EOL> def _get_connected_path ( self ) : <EOL> """<STR_LIT>""" <EOL> node_settings = self . node . get_addon ( self . provider ) <EOL> assert node_settings is not None , '<STR_LIT>' . format ( self . provider ) <EOL> return getattr ( node_settings , self . FOLDER_ATTR_NAME ) . strip ( '<STR_LIT:/>' ) </s>
