twee: Convert tabs to spaces

This was already done on "*.py", but the "twee" script doesn't have
a file extension.
twee: Print usage syntax when called without arguments

Previously, it would complain about no source files being specified
and would only print the usage syntax when argument parsing failed.

Also removed superfluous newline from "no source files" message.
twee: Removed adding "lib" dir to system path

There is no directory named "lib" in the Twine source tree.
twee: Force UTF8 output if stdout is redirected

The typical way of using "twee" is to redirect its output to an HTML
file. However, such a redirect will use ASCII encoding unless
overridden by the PYTHONIOENCODING environment variable. Therefore it
would break if the output contains Unicode characters.

To avoid that, check whether we are outputting to a tty or to a file
and in the latter case, explictly encode as UTF8 (with BOM).
Fixed displaying of long titles in PassageFrame
Merge pull request #126 from greyelf/i013_passage_title_fix

PassageFrame title field hides starting characters
Merge pull request #125 from mthuurne/twee_cleanup

Twee cleanup
Removed dependency from Twee on wxWidgets

Twee is a command line tool, so it shouldn't depend on a GUI toolkit.
However, the "tweelexer" module contained both GUI functionality and
essential non-GUI definitions. Solved this by splitting off the regex
definitions into the new module "tweeregex" and make Twee import that
instead.
Merge pull request #127 from mthuurne/twee_no_wx

TweeRegex module
twee: Removed HTML merge feature

The feature is not useful for story authors.
Read this forum thread for some background:
  http://twinery.org/forum/index.php/topic,1463.0.html
StorySettings dialog scrollbars

* Added support for scrollbars in the StorySettings dialog, in case
custom story formats wish to add a lot of settings that necessitate a
longer window.
* Removed the "IE hack" from monospacedByLineHelper, after confirming
that it is not needed in IE 8.
Merge branch 'master' of https://github.com/webbedspace/twine
twee: Fix preservation of passage order

This feature was introduced in 4a038af9, but I broke it in bba0e147
when I did the tabs to spaces conversion on the wrong version of the
"twee" script (the part in tiddlywiki.py survived).
Fixed StoryIncludes on OS X

buildIncludes() wasn't taking the story's path into account for relative filenames.
Merge pull request #129 from mthuurne/twee_remove_merge

twee: Removed HTML merge feature
Merge pull request #130 from mthuurne/fix_passage_order

Fix preservation of passage order in Twee
twee: Removed HTML merge feature

The feature is not useful for story authors.
Read this forum thread for some background:
  http://twinery.org/forum/index.php/topic,1463.0.html
twee: Fix preservation of passage order

This feature was introduced in 4a038af9, but I broke it in bba0e147
when I did the tabs to spaces conversion on the wrong version of the
"twee" script (the part in tiddlywiki.py survived).
Monitor clipboard on a timer

This fixes a crash on exit when using wxPython with the GTK backend.
The Clipboard.IsSupported() method seems to cause the event loop to be
re-entered, but if the frame destroy event is handled by that inner
event loop call, a segfault happens. Since the native part of a timer
is removed when the Python proxy reaches 0 references, this problem
does not occur when the clipboard is accessed from a timer.

Note that when the clipboard cannot be opened, the new code will keep
the paste menu entry in unchanged, while the old code would disable
it. I expect the clipboard failing to open to be a temporary condition
in most cases, so then the new behavior makes more sense.
Improved paste implementation in StoryPanel

The old code would forget to close the clipboard if contained data in
an unsupported format. Also it ignored the return value of GetData().

Also renamed the "format" variable since format() is a built-in
function: while it is rarely used, it does receive syntax highlighting
in my editor like any other built-in name, which is distracting.