ovvy/the-red-spider-project — pull request #1 by jgonggrijp (2013-11-03 14:05:49+00:00)
Title: Fixes to randomtext

I thought it was time to dust off some old abandoned commands so I started with `randomtext`. I think it's a very interesting program. Hopefully this pull request will bring it closer to integration with the rest of the project. :)

Please don't be intimidated by the long lists of commits and changed files. Most of that is just a side effect of me pulling in the integration branch to update everything that has changed in the meanwhile. Only the commits of today (November 3rd, at the bottom of the list) and the changes in `randomtext.py` are truly relevant. Also note that the diff for `randomtext.py` looks like I replaced all code, but this is not the case; it looks like that because I changed the line endings. The commits 7620948, 1cd2563, 3346b44 and 0e7e7f0 show what I *actually* did.

Summary of changes:
- Changed the line endings to native, for compatibility with unixy systems.
- Added a shebang line so that the program can behave as a "standalone" command on unixy systems.
- Fixed several bugs:
- Added entries to the cache so that the program won't get stuck when the last two words of the input file are hit.
- Changed the name `_usage` into `usage` (without underscore).
- Removed a redundant check which caused the program to ignore the optional output path.
- Fixed the issue where the program generates twice as many words as requested. This fix also makes the output look a lot more like natural language.
- Added license information and attribution to myself for the bug fixes.
- Pulled in the latest changes from master as an update. This provides improved version of `setup.py` and `rsshell` as well as several commands that have appeared in the meanwhile, such as `rshelp` and `level_up`.
- Registered `randomtext` with `setup.py` so it will be installed as part of the red spider package and `rshelp` will be aware of its usage line.
- Updated the usage line to reflect that the program is normally called in `rsshell` context as just `randomtext` rather than the full-blown `python randomtext.py`.

Please accept these changes as a courtesy. :)