#NEWLINE# def add_installed( files , unreqed ) : #NEWLINE# #INDENT# unique = [ dict ( y ) for y in set ( ( tuple ( x . items ( ) ) for x in unreqed ) ) ] #NEWLINE# for package_d in unique : #NEWLINE# #INDENT# for ( package , version ) in package_d . items ( ) : #NEWLINE# #INDENT# click . echo ( '{} is installed but not in any requirements file' . format ( package ) ) #NEWLINE# pstr = '[0] Ignore\n' #NEWLINE# for ( index , rf ) in enumerate ( files ) : #NEWLINE# #INDENT# pstr += '[{}] Add to {}\n' . format ( ( index + 1 ) , rf [ 'name' ] ) #NEWLINE# #UNINDENT# value = click . prompt ( pstr , type = int ) #NEWLINE# try : #NEWLINE# #INDENT# req_file = files [ ( value - 1 ) ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# click . echo ( 'Not a valid selection soz.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# req_file [ 'packages' ] [ package ] = version #NEWLINE# req_file [ 'updated' ] . append ( package )