#NEWLINE# def DependenciesForEnvironment( self , environment = None ) : #NEWLINE# #INDENT# "Returns the list of dependencies for an environment.\n\n    Given an environment:\n       build the list of dependencies required for that environment. This\n         includes elements marked as all (platform='*') and ones specifically\n         mentioning that environment.\n       build the list of optional packages which might be useful to your app.\n         That is, everything marked generic, but not in the first list.\n       build the list of everything excluded from the first two sets\n\n    Args:\n      environment: (str) An environment (as per platforms.PLATFORMS). If None,\n          the optional packages list will include everything that is not\n          mandatory (i.e. marked with platform='*').\n    Returns:\n      list(dict), list(dict), list(dict): required_packages, optional_packages,\n          packages we do not want.\n    " #NEWLINE# required = [ ] #NEWLINE# optional = [ ] #NEWLINE# excluded = [ ] #NEWLINE# for r in self . get ( 'requires' , [ ] ) : #NEWLINE# #INDENT# environments = r [ 'environments' ] #NEWLINE# if ( ( '*' in environments ) or ( environment in environments ) ) : #NEWLINE# #INDENT# required . append ( r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( 'generic' in environments ) or ( not environment ) ) : #NEWLINE# #INDENT# optional . append ( r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# excluded . append ( r ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( required , r , excluded )