<s> import argparse <EOL> from distutils import log <EOL> import os <EOL> import site <EOL> from stat import ST_MODE <EOL> import sys <EOL> from setuptools import find_packages <EOL> from setuptools import setup <EOL> from setuptools . command . install import install <EOL> install_requires = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> if sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> and sys . version_info [ <NUM_LIT:1> ] <= <NUM_LIT:6> : <EOL> install_requires . append ( '<STR_LIT>' ) <EOL> this_dir = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> osx_resources_path = os . path . join ( <EOL> this_dir , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> osx_notification_resources = [ os . path . join ( dp , f ) <EOL> for dp , dn , fn in os . walk ( osx_resources_path ) <EOL> for f in fn ] <EOL> src_path = os . path . join ( this_dir , '<STR_LIT>' ) <EOL> osx_notification_resources = [ os . path . relpath ( x , src_path ) <EOL> for x in osx_notification_resources ] <EOL> def _resolve_prefix ( prefix , type ) : <EOL> osx_system_prefix = '<STR_LIT>' <EOL> if type == '<STR_LIT>' : <EOL> if prefix == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> if sys . prefix . startswith ( osx_system_prefix ) : <EOL> return '<STR_LIT>' <EOL> elif type == '<STR_LIT>' : <EOL> if prefix == '<STR_LIT>' : <EOL> return '<STR_LIT:/>' <EOL> if sys . prefix . startswith ( osx_system_prefix ) : <EOL> return '<STR_LIT:/>' <EOL> elif type == '<STR_LIT>' : <EOL> if sys . prefix . startswith ( osx_system_prefix ) : <EOL> return '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> return prefix <EOL> def get_data_files ( prefix ) : <EOL> data_files = [ ] <EOL> bash_comp_dest = os . path . join ( _resolve_prefix ( prefix , '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> data_files . append ( ( bash_comp_dest , <EOL> [ '<STR_LIT>' ] ) ) <EOL> zsh_comp_dest = os . path . join ( _resolve_prefix ( prefix , '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> data_files . append ( ( zsh_comp_dest , <EOL> [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) ) <EOL> return data_files <EOL> class PermissiveInstall ( install ) : <EOL> def run ( self ) : <EOL> install . run ( self ) <EOL> if os . name == '<STR_LIT>' : <EOL> for file in self . get_outputs ( ) : <EOL> mode = ( ( os . stat ( file ) [ ST_MODE ] ) | <NUM_LIT> ) & <NUM_LIT> <EOL> log . info ( "<STR_LIT>" % ( file , mode ) ) <EOL> os . chmod ( file , mode ) <EOL> if ( sys . platform . startswith ( "<STR_LIT>" ) and <EOL> self . install_data == "<STR_LIT>" ) : <EOL> log . info ( """<STR_LIT>""" . format ( os . path . join ( self . install_data , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) ) <EOL> parser = argparse . ArgumentParser ( add_help = False ) <EOL> prefix_group = parser . add_mutually_exclusive_group ( ) <EOL> prefix_group . add_argument ( '<STR_LIT>' , '<STR_LIT>' , action = '<STR_LIT:store_true>' ) <EOL> prefix_group . add_argument ( '<STR_LIT>' , default = None ) <EOL> opts , _ = parser . parse_known_args ( sys . argv ) <EOL> userbase = site . getuserbase ( ) if opts . user else None <EOL> prefix = userbase or opts . prefix or sys . prefix <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> packages = find_packages ( exclude = [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> package_data = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] + osx_notification_resources <EOL> } , <EOL> data_files = get_data_files ( prefix ) , <EOL> install_requires = install_requires , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> maintainer = '<STR_LIT>' , <EOL> maintainer_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> keywords = [ '<STR_LIT>' ] , <EOL> classifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> description = "<STR_LIT>" , <EOL> long_description = "<STR_LIT>" , <EOL> license = '<STR_LIT>' , <EOL> test_suite = '<STR_LIT>' , <EOL> entry_points = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> } , <EOL> cmdclass = { '<STR_LIT>' : PermissiveInstall } , <EOL> ) </s>
