#NEWLINE# def _get_rpm_names( self , from_deps = True , from_instances = True ) : #NEWLINE# #INDENT# desired_rpms = [ ] #NEWLINE# py_reqs = set ( ) #NEWLINE# if from_instances : #NEWLINE# #INDENT# inst_packages = list ( self . requirements [ 'requires' ] ) #NEWLINE# for inst in self . instances : #NEWLINE# #INDENT# inst_packages . extend ( inst . package_names ( ) ) #NEWLINE# if sh . isdir ( inst . get_option ( 'app_dir' ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# py_req = inst . egg_info [ 'req' ] #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( rpm_name , _ ) = self . _find_template_and_rpm_name ( inst , inst . get_option ( 'build_name' , default_value = inst . name ) ) #NEWLINE# if ( rpm_name is not None ) : #NEWLINE# #INDENT# desired_rpms . append ( ( rpm_name , py_req ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# py_reqs . add ( py_req ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for rpm_name in inst_packages : #NEWLINE# #INDENT# desired_rpms . append ( ( rpm_name , None ) ) #NEWLINE# #UNINDENT# #UNINDENT# if from_deps : #NEWLINE# #INDENT# requires = sh . load_file ( self . gathered_requires_filename ) . splitlines ( ) #NEWLINE# for line in [ line . strip ( ) for line in requires if line . strip ( ) ] : #NEWLINE# #INDENT# py_reqs . add ( pip_helper . extract_requirement ( line ) ) #NEWLINE# #UNINDENT# #UNINDENT# rpm_names = self . py2rpm_helper . names_to_rpm_names ( [ req . key for req in py_reqs ] ) #NEWLINE# desired_rpms . extend ( ( ( rpm_names [ req . key ] , req ) for req in py_reqs ) ) #NEWLINE# def _format_name( rpm_name , py_req ) : #NEWLINE# #INDENT# full_name = str ( rpm_name ) . strip ( ) #NEWLINE# if ( py_req is not None ) : #NEWLINE# #INDENT# full_name += ',' . join ( ( '' . join ( x ) for x in py_req . specs ) ) #NEWLINE# #UNINDENT# return full_name #NEWLINE# #UNINDENT# return sorted ( ( _format_name ( rpm_name , py_req ) for ( rpm_name , py_req ) in desired_rpms ) )