<s> import os . path , sys <EOL> from distutils . core import setup <EOL> from distutils . command . install import INSTALL_SCHEMES <EOL> from distutils . command . install_data import install_data <EOL> for scheme in INSTALL_SCHEMES . values ( ) : <EOL> scheme [ '<STR_LIT:data>' ] = scheme [ '<STR_LIT>' ] <EOL> packages , data_files = [ ] , [ ] <EOL> root_dir = os . path . dirname ( __file__ ) <EOL> len_root_dir = len ( root_dir ) <EOL> devon_dir = os . path . join ( root_dir , '<STR_LIT>' ) <EOL> for dirpath , dirnames , filenames in os . walk ( devon_dir ) : <EOL> for i , dirname in enumerate ( dirnames ) : <EOL> if dirname . startswith ( '<STR_LIT:.>' ) : del dirnames [ i ] <EOL> if '<STR_LIT>' in filenames : <EOL> package = dirpath [ len_root_dir : ] . lstrip ( '<STR_LIT:/>' ) . replace ( '<STR_LIT:/>' , '<STR_LIT:.>' ) <EOL> packages . append ( package ) <EOL> else : <EOL> data_files . append ( [ dirpath , [ os . path . join ( dirpath , f ) for f in filenames ] ] ) <EOL> class darwin_install_data ( install_data ) : <EOL> def finalize_options ( self ) : <EOL> self . set_undefined_options ( '<STR_LIT>' , ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> install_data . finalize_options ( self ) <EOL> if sys . platform == "<STR_LIT>" : <EOL> cmdclasses = { '<STR_LIT>' : darwin_install_data } <EOL> else : <EOL> cmdclasses = { '<STR_LIT>' : install_data } <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = "<STR_LIT>" , <EOL> description = "<STR_LIT>" , <EOL> url = "<STR_LIT>" , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> cmdclass = cmdclasses , <EOL> packages = packages , <EOL> data_files = data_files <EOL> ) </s>
