<s> """<STR_LIT>""" <EOL> from grr . lib import registry <EOL> from grr . lib . rdfvalues import cronjobs as _ <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class ParserDefinitionError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class CommandFailedError ( Error ) : <EOL> """<STR_LIT>""" <EOL> class ParseError ( Error ) : <EOL> """<STR_LIT>""" <EOL> class Parser ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = registry . MetaclassRegistry <EOL> supported_artifacts = [ ] <EOL> knowledgebase_dependencies = [ ] <EOL> output_types = [ ] <EOL> process_together = False <EOL> @ classmethod <EOL> def GetClassesByArtifact ( cls , artifact_name ) : <EOL> """<STR_LIT>""" <EOL> return [ cls . classes [ c ] for c in cls . classes if artifact_name in <EOL> cls . classes [ c ] . supported_artifacts ] <EOL> @ classmethod <EOL> def GetDescription ( cls ) : <EOL> if cls . __doc__ : <EOL> return cls . __doc__ . split ( "<STR_LIT:\n>" ) [ <NUM_LIT:0> ] <EOL> else : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def Validate ( cls ) : <EOL> pass <EOL> class CommandParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> __abstract = True <EOL> def Parse ( self , cmd , args , stdout , stderr , return_val , time_taken , <EOL> knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> def CheckReturn ( self , cmd , return_val ) : <EOL> """<STR_LIT>""" <EOL> if return_val != <NUM_LIT:0> : <EOL> raise CommandFailedError ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( cmd , return_val ) ) <EOL> class FileParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> __abstract = True <EOL> def Parse ( self , stat , file_object , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> def ParseMultiple ( self , stats , file_objects , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class WMIQueryParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , query , result_dict , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class RegistryValueParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , stat , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class RegistryParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def ParseMultiple ( self , stats , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , stat , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class GenericResponseParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , response , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class GrepParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , response , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> class ArtifactFilesParser ( Parser ) : <EOL> """<STR_LIT>""" <EOL> def Parse ( self , persistence , knowledge_base , download_pathtype ) : <EOL> """<STR_LIT>""" <EOL> class RekallPluginParser ( Parser ) : <EOL> """<STR_LIT>""" </s>
