<s> """<STR_LIT>""" <EOL> __docformat__ = '<STR_LIT>' <EOL> import os <EOL> from distutils . sysconfig import get_python_lib <EOL> from commands import getstatusoutput <EOL> class PackageManagerPlugin : <EOL> """<STR_LIT>""" <EOL> name = "<STR_LIT>" <EOL> enabled = False <EOL> enable_opt = None <EOL> def __init__ ( self ) : <EOL> if self . name is None : <EOL> self . name = self . __class__ . __name__ . lower ( ) <EOL> if self . enable_opt is None : <EOL> self . enable_opt = "<STR_LIT>" % self . name <EOL> def add_options ( self , parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_option ( '<STR_LIT>' % self . name , action = '<STR_LIT:store_true>' , <EOL> dest = self . enable_opt , <EOL> help = "<STR_LIT>" + <EOL> "<STR_LIT>" % self . name ) <EOL> def configure ( self , options , conf ) : <EOL> """<STR_LIT>""" <EOL> self . conf = conf <EOL> if hasattr ( options , self . enable_opt ) : <EOL> self . enabled = getattr ( options , self . enable_opt ) <EOL> def add_column ( self , dist ) : <EOL> """<STR_LIT>""" <EOL> return self . package_manager_owns ( dist ) <EOL> def package_manager_owns ( self , dist ) : <EOL> """<STR_LIT>""" <EOL> if dist . location . lower ( ) == get_python_lib ( ) . lower ( ) : <EOL> filename = os . path . join ( dist . location , dist . egg_name ( ) + "<STR_LIT>" ) <EOL> else : <EOL> filename = dist . location <EOL> status , output = getstatusoutput ( "<STR_LIT>" % filename ) <EOL> if status == <NUM_LIT:0> : <EOL> return self . name <EOL> else : <EOL> return "<STR_LIT>" </s>
