<s> """<STR_LIT>""" <EOL> import os <EOL> from fswrap import File , Folder <EOL> from hyde . _compat import str <EOL> HYDE_DATA = "<STR_LIT>" <EOL> LAYOUTS = "<STR_LIT>" <EOL> class Layout ( object ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def find_layout ( layout_name = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> layout_folder = None <EOL> if HYDE_DATA in os . environ : <EOL> layout_folder = Layout . _get_layout_folder ( <EOL> os . environ [ HYDE_DATA ] , layout_name ) <EOL> if not layout_folder : <EOL> layout_folder = Layout . _get_layout_folder ( <EOL> File ( __file__ ) . parent , layout_name ) <EOL> return layout_folder <EOL> @ staticmethod <EOL> def _get_layout_folder ( root , layout_name = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> layouts_folder = Folder ( str ( root ) ) . child_folder ( LAYOUTS ) <EOL> layout_folder = layouts_folder . child_folder ( layout_name ) <EOL> return layout_folder if layout_folder . exists else None </s>
