Skip to content

Commit

Permalink
man page fixes
Browse files Browse the repository at this point in the history
python3 compatibility for dumpmsgs



git-svn-id: file:///bss/svn/public/grokevt@119 15c2d14c-5af0-0310-93da-fd3504e6cab1
  • Loading branch information
tim committed Jun 20, 2011
1 parent 9b48e2c commit 229451e
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 71 deletions.
12 changes: 6 additions & 6 deletions trunk/bin/grokevt-dumpmsgs
Expand Up @@ -20,7 +20,7 @@

import sys
import os
import anydbm
import dbm

import grokevt

Expand All @@ -42,16 +42,16 @@ for dbfile in sys.argv[1:]:
sys.stderr.write("ERROR: DB file could not be read.")
sys.exit(1)

db = anydbm.open(dbfile, 'r')
db = dbm.open(dbfile.split('.db', 1)[0], 'r')

if grokevt.template_encoding == grokevt.output_encoding:
for key in db.keys():
print '%s,%s' % (key, grokevt.quoteString(db[key], '\\,"'))
print('%s,%s' % (key.decode('ascii'), grokevt.quoteBinary(db[key], b'%,"')))
else:
for key in db.keys():
msg = db[key].decode(grokevt.template_encoding)
msg = grokevt.quoteString(msg.encode(grokevt.output_encoding,'replace'),
'\\,"')
print '%s,%s' % (key, msg)
msg = grokevt.quoteBinary(msg.encode(grokevt.output_encoding,'replace'),
b'%,"')
print('%s,%s' % (key.decode('ascii'), msg))

db.close()
2 changes: 1 addition & 1 deletion trunk/bin/grokevt-parselog
Expand Up @@ -83,7 +83,7 @@ def usage():
+" %s -?|--help\n" % command\
+" %s -l <DATABASE_DIR>\n" % command\
+" %s -m <DATABASE_DIR> <LOG_TYPE>\n" % command\
+" %s [-v] [-H] [-h] [-U] [-u] <DATABASE_DIR> <LOG_TYPE>\n\n"\
+" %s [-v] [-H] [-h] <DATABASE_DIR> <LOG_TYPE>\n\n"\
% command\
+"This program parses a windows event log and prints a\n"\
+"CSV version of the log to stdout. Please see the man\n"\
Expand Down
3 changes: 2 additions & 1 deletion trunk/doc/Makefile
Expand Up @@ -22,7 +22,8 @@ install:

#XXX: Used during release only
$(foreach p,$(MAN_PAGES),man/man$(p)):
docbook2x-man --to-stdout $(notdir $@).docbook > $@
docbook2x-man --to-stdout $(notdir $@).docbook \
| sed 's/.SH DESCRIPTION/\n.SH DESCRIPTION/' | sed 's/^\\fR.PP$$/\\fR\n.PP/' > $@

$(foreach p,$(MAN_PAGES),man/man$(p).gz): $(foreach p,$(MAN_PAGES),man/man$(p))
gzip -c -9 $(subst .gz,,$@) > $@ && rm $(subst .gz,,$@)
Expand Down
5 changes: 1 addition & 4 deletions trunk/doc/grokevt-addlog.1.docbook
Expand Up @@ -113,9 +113,6 @@
<para>
Written by Timothy D. Morgan.
</para>
<para>
Copyright (C) 2006-2007 Timothy D. Morgan
</para>
</refsect1>

<refsect1 id='license'>
Expand All @@ -128,7 +125,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License version 2 for more details.
GNU General Public License version 3 for more details.
</para>
</refsect1>

Expand Down
5 changes: 1 addition & 4 deletions trunk/doc/grokevt-builddb.1.docbook
Expand Up @@ -136,9 +136,6 @@
<para>
Written by Timothy D. Morgan.
</para>
<para>
Copyright (C) 2005-2007 Timothy D. Morgan
</para>
</refsect1>

<refsect1 id='license'>
Expand All @@ -151,7 +148,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License version 2 for more details.
GNU General Public License version 3 for more details.
</para>
</refsect1>

Expand Down
5 changes: 1 addition & 4 deletions trunk/doc/grokevt-dumpmsgs.1.docbook
Expand Up @@ -67,7 +67,7 @@

The second column contains the message itself. Messages containing
special characters (such as newlines or commas) are encoded in the same
manner that grokevt-parselog(1) encodes them ("\xQQ" where QQ is the
manner that grokevt-parselog(1) encodes them ("%XX" where XX is the
hexadecimal value of the character).
</para>
</refsect1>
Expand All @@ -84,9 +84,6 @@
<para>
Written by Timothy D. Morgan.
</para>
<para>
Copyright (C) 2006-2007 Timothy D. Morgan
</para>
</refsect1>

<refsect1 id='license'>
Expand Down
5 changes: 1 addition & 4 deletions trunk/doc/grokevt-findlogs.1.docbook
Expand Up @@ -139,9 +139,6 @@
<para>
Written by Timothy D. Morgan
</para>
<para>
Copyright (C) 2006-2007 Timothy D. Morgan
</para>
</refsect1>

<refsect1 id='license'>
Expand All @@ -154,7 +151,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License version 2 for more details.
GNU General Public License version 3 for more details.
</para>
</refsect1>

Expand Down
53 changes: 16 additions & 37 deletions trunk/doc/grokevt-parselog.1.docbook
Expand Up @@ -30,7 +30,7 @@
</para>
<para>
<command>
grokevt-parselog [-v] [-H] [-h] [-U] [-u] <replaceable>database-dir</replaceable> <replaceable>log-type</replaceable>
grokevt-parselog [-v] [-H] [-h] <replaceable>database-dir</replaceable> <replaceable>log-type</replaceable>
</command>
</para>
</refsect1>
Expand All @@ -42,7 +42,7 @@
combines that information with messages templates and other
resources stored in a pre-generated database. This is then
printed to stdout in a comma-separated values (CSV) format.
The database must be created by grokevt-builddb(1).
The database must first be created by grokevt-builddb(1).
</para>
</refsect1>

Expand Down Expand Up @@ -188,35 +188,20 @@
</varlistentry>
</variablelist>

<variablelist remap='IP'>
<varlistentry>
<term>
<option>-u</option>
</term>
<listitem>
<para>
Enables the UTF-8 output of some strings. This can be
dangerous on terminals that are not configured to support UTF-8.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<variablelist remap='IP'>
<varlistentry>
<term>
<option>-U</option>
</term>
<listitem>
<para>
Disables the use of UTF-8 for output.
Unicode strings are instead converted to UTF-8 first,
and then any remaining non-ASCII characters are
quoted. (This is the default behavior.)
</para>
</listitem>
</varlistentry>
</variablelist>
<refsect1 id='examples'>
<title>OUTPUT</title>
<para>
While the output format is compatible with programs (such as spreadsheets)
that understand the de-facto CSV standard format, the format is
additionally constrained in that each log entry is written to a
single line. Also, special characters and non-printable characters are
encoded using a URL-like encoding format of "%XX" where XX are the
hexadecimal digits of an encoded character. New line characters and other
special characters along with binary data are encoded this way to allow
for easy use of grep(1) and similar command line tools.
</para>
</refsect1>

<refsect1 id='examples'>
Expand Down Expand Up @@ -267,12 +252,6 @@
Andreas Schuster has contributed greatly to the understanding of
the event log format.
</para>
<para>
Copyright (C) 2005-2007 Timothy D. Morgan
</para>
<para>
Copyright (C) 2004 Jamie French
</para>
</refsect1>

<refsect1 id='license'>
Expand All @@ -285,7 +264,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License version 2 for more details.
GNU General Public License version 3 for more details.
</para>
</refsect1>

Expand Down
6 changes: 0 additions & 6 deletions trunk/doc/grokevt-ripdll.1.docbook
Expand Up @@ -97,12 +97,6 @@
<para>
Message resource parsing added by Timothy D. Morgan.
</para>
<para>
Copyright (C) 2005-2007 Timothy D. Morgan
</para>
<para>
Copyright (C) 2004 A'rpi
</para>
</refsect1>

<refsect1 id='license'>
Expand Down
9 changes: 5 additions & 4 deletions trunk/doc/grokevt.7.docbook
Expand Up @@ -117,12 +117,13 @@
Since the registry often references files in relation to this
variable, we need to know where it is on your system.
Typically, on W2K this should be 'C:\WINNT'. On other windows
systems it is often 'C:\Windows'. This path may be referenced
as a full windows path (with drive letters) or as a *NIX path.
systems it is often 'C:\Windows'. This case-insensitive path must
as a full windows path (including a drive letter).
</para>
<para>
Finally, you need to set the path of the system registry. This
path <emphasis>must</emphasis> be a *NIX path, and not a windows path. It
path <emphasis>must</emphasis> be a *NIX path, and not a windows
path, and it is case-sensitive. It
should be located under your %SystemRoot%. For instance, if you
mount a W2K machine's C: on '/mnt/win/c', this path will
probably be: /mnt/win/c/WINNT/system32/config/system
Expand Down Expand Up @@ -269,7 +270,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License version 2 for more details.
GNU General Public License version 3 for more details.
</para>
</refsect1>

Expand Down

0 comments on commit 229451e

Please sign in to comment.