# TODO Adium XML logs should always be contained in directories with the same basename but extension '.chatlog' # For new XML-based Adium logs (have to be run through a XML transform) write( "I/O Error while opening output: " outpath " \n") write( "I/O Error while opening input: " filename " \n") \n")įi = open( filename, 'r') # fi is a file object write( "Input file suffix not one of supported types. # Test to make sure the file suffix is one of the types we can process write( "Output file " outpath " already exists. # In some cases this may be undesirable/annoying so we can disable with flag haltOnDuplicates # Test to see if the output file already exists (prevents duplicate processing) # output file name is based on input we take the input basename, append. write( "Output dir (" outputdir ") specified but not a directory. # which we catch here and fix by setting to zero-length string, i.e. argv # Note that this will throw Inde圎rror if not specified # Second arg, if present, is the output dir write( "Input file (" filename ") appears invalid. # Use the first argument as the input file SkipIfBeforeDate = '' # skip log if date is earlier than %Y-%m-%dT%H:%M:%S%z, e.g. Myhostname = '' # set to false/null to determine programmatically from system FQDNĭefaultToAddr = "Tester John Doe " # use this as the email 'To' header if we can't determine from the log Global haltOnDuplicates # If true, throw error if output file exists alreadyĬonfigFilePath = '' # empty string means working dir, for header/footer files Global silent # If true, suppresses all stdout output Global debug # Debug, if true, produces very verbose output # These are for Message-ID functionality and can be easily disabled parser # NOT STANDARD LIBRARY, MUST INSTALL etree # NOT STANDARD LIBRARY, MUST INSTALL # These are needed for new XML-formatted ".chatlog" but not old ".AdiumHTMLLog" Requires Python 2.5 or later and both the "lxml" and "dateutil" packages, available through pip.įrom email. With `find` and `xargs` in order to run it on a bunch of logfiles.įor old-style (.AdiumHTMLLog) files, working directory must contain a headerĪnd footer file, "header.htmlpart" and "footer.htmlpart", which are prepended andĪppended to the log in order to make it into a complete HTML document.įor modern XML logs, working directory must contain an XSL file used to convertįrom XML to HTML, which should be named "chatlog_transform.xsl". In most cases, you would probably want to call this from a script, e.g. Into a mail program, uploaded to Gmail, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |