Difference between revisions of "User:Oz Linden/Tools"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 71: Line 71:


  bots = ''bot-names-file''
  bots = ''bot-names-file''
== pyhelp2wiki ==
Usage:
      <nowiki>pyhelp2wiki [--title <section-title>] [--level <section-level>]</nowiki>
      <nowiki>pyhelp2wiki [--help]</nowiki>
Options:
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"
<nowiki>optional arguments:</nowiki>
|- style="vertical-align: top;"
|<nowiki>--title&nbsp;SECTION_TITLE</nowiki>
|<nowiki>Adds this title as a section header</nowiki>
|- style="vertical-align: top;"
|<nowiki>--level&nbsp;SECTION_LEVEL</nowiki>
|<nowiki>The number of '=' characters  </nowiki>
|}
<nowiki>Reads the output of a conventional python command --help options (as produced</nowiki>
<nowiki>by the python argparse package) from standard input, and writes a wiki markup </nowiki>
<nowiki>by the python argparse package) from standard input, and writes a wiki markup </nowiki>
<nowiki>version of it to standard output.</nowiki>
<nowiki>version of it to standard output.</nowiki>

Revision as of 19:18, 13 February 2011

These are some tools I've built and make available under the following warranty:

They work

  • as well as I need them to
  • for me
  • right now

that having been said, suggestions and requests for help are welcome.

All of these tools are available from the mercurial repository:

https://bitbucket.org/oz_linden/tools

Chat Logs

Together, the two scripts below can be used to extract text from a chat log as produced by the viewer:

chat-extract --begin '[2011/02/09 13:02]' --end '[2011/02/09 14:08]' ~/SecondLife/Logs/oz_linden/chat \
| sllog2wiki > ~/tmp/post.wiki

For an example of the output of the current version resulting from the above, see my user group archive for 9 Feb

chat-extract
Extracts text from a log file; the viewer must have the timestamp option enabled.
 chat-extract
    --begin begin-timestamp
    --end   end-timestamp
    [ --ignore ignore-pattern-file ]
    [--help]
    chat-log

Searches the specified chat-log file for lines bounded by the begin and end timestamps, and writes them to standard output. The '.txt' suffix may be left off the file name, and the command will automatically also try the same name with a datestamp added if the file is not found without it.

The ignore-pattern-file, if specified, contains patterns (perl regular expressions) which cause any line they match to be omitted from the output.

The ignore option default can be set by putting an assignment in the file

$HOME/.chat-extract.rc 

whose contents look like:

ignore = ignore-pattern-file

sllog2wiki
Converts chat log input to a nice wiki presentation
 sllog2wiki
    [ --bots bot-names-file ]
    [--help]
    [ chat-log ]

Reads chat-log (or standard input if no file is specified) and writes wiki markup to standard output. The name column of the output contains the display name of the agent, linked to the profile for the user.

The bot-names-file, is a list of names (one per line) for which no links to profiles should be generated.

The bots option default can be set by putting an assignment in the file

$HOME/.sllog2wiki.rc 

whose contents look like:

bots = bot-names-file

pyhelp2wiki

Usage:

      pyhelp2wiki [--title <section-title>] [--level <section-level>]
      pyhelp2wiki [--help]


Options:

optional arguments:
--title SECTION_TITLE Adds this title as a section header
--level SECTION_LEVEL The number of '=' characters

Reads the output of a conventional python command --help options (as produced by the python argparse package) from standard input, and writes a wiki markup by the python argparse package) from standard input, and writes a wiki markup version of it to standard output. version of it to standard output.