#NEWLINE# def Search( self , searchString ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# log . debug ( 'beginning search of the passed string: {0}' . format ( searchString ) ) #NEWLINE# self . search_results = self . win_searcher . Search ( searchString ) #NEWLINE# log . debug ( 'search completed successfully.' ) #NEWLINE# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . info ( 'search for updates failed. {0}' . format ( exc ) ) #NEWLINE# return exc #NEWLINE# #UNINDENT# log . debug ( 'parsing results. {0} updates were found.' . format ( self . search_results . Updates . Count ) ) #NEWLINE# try : #NEWLINE# #INDENT# for update in self . search_results . Updates : #NEWLINE# #INDENT# if update . InstallationBehavior . CanRequestUserInput : #NEWLINE# #INDENT# log . debug ( 'Skipped update {0} - requests user input' . format ( update . title ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( self . skipDownloaded and update . IsDownloaded ) : #NEWLINE# #INDENT# log . debug ( 'Skipped update {0} - already downloaded' . format ( update . title ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# for category in update . Categories : #NEWLINE# #INDENT# if ( ( self . categories is None ) or ( category . Name in self . categories ) ) : #NEWLINE# #INDENT# self . download_collection . Add ( update ) #NEWLINE# log . debug ( 'added update {0}' . format ( update . title ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# log . debug ( 'download_collection made. gathering found categories.' ) #NEWLINE# self . foundCategories = _gather_update_categories ( self . download_collection ) #NEWLINE# log . debug ( 'found categories: {0}' . format ( str ( self . foundCategories ) ) ) #NEWLINE# return True #NEWLINE# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . info ( 'parsing updates failed. {0}' . format ( exc ) ) #NEWLINE# return exc