mudpy.git
7 years agoRename internal:directions to .mudpy.movement.*
Jeremy Stanley [Wed, 24 Aug 2016 01:17:08 +0000 (01:17 +0000)]
Rename internal:directions to .mudpy.movement.*

Convert the old style internal:directions element to a series of new
style .mudpy.movement.* elements and adjust the move_direction()
function accordingly. Also extend the Universe class to provide a
set-based index of direction names found in the data.

7 years agoRename internal:logging: to .mudpy.log
Jeremy Stanley [Sun, 24 Jul 2016 01:14:10 +0000 (01:14 +0000)]
Rename internal:logging: to .mudpy.log

Convert the old style internal:logging element to a new style
.mudpy.log element and adjust the log() function accordingly.

7 years agoUpdate README for recent development
Jeremy Stanley [Sun, 24 Jul 2016 00:45:36 +0000 (00:45 +0000)]
Update README for recent development

Edits to the README file reflect the switch to Py3K, YAML and
addition of non-stdlib dependencies.

7 years agoRename internal:limits element to .mudpy.limit
Jeremy Stanley [Sun, 17 Jul 2016 02:45:00 +0000 (02:45 +0000)]
Rename internal:limits element to .mudpy.limit

Convert the old style internal:limits element to a new style
.mudpy.limit element and rename the default_admins,
default_backup_count and max_avatars facets to admins, backups and
avatars respectively.

7 years agoStrip extra separators in show element command
Jeremy Stanley [Tue, 28 Jun 2016 07:46:08 +0000 (07:46 +0000)]
Strip extra separators in show element command

Eat leading and trailing "." separators in the show element command,
so that it will consistently search the element set for the
corresponding simplified element names.

7 years agoFix 8-bit Telnet with Py3K
Jeremy Stanley [Tue, 28 Jun 2016 06:50:50 +0000 (06:50 +0000)]
Fix 8-bit Telnet with Py3K

Replace the lambda filter for non-ASCII characters with a list
comprehension, correcting and simplifying the range comparison and
recombination of the filtered string.

7 years agoRename internal:language: to .mudpy.linguistic
Jeremy Stanley [Mon, 9 May 2016 05:09:14 +0000 (05:09 +0000)]
Rename internal:language: to .mudpy.linguistic

Convert the old style internal:language element to a new style
.mudpy.linguistic element and adjust the command_say() function
accordingly.

8 years agoImplement new style element support
Jeremy Stanley [Thu, 21 Apr 2016 14:35:13 +0000 (14:35 +0000)]
Implement new style element support

Add support for new style elements implemented as a flat associative
array of facets prefixed with their element names, and switching to
"." as a prefix separator. This is initially backward compatible
using a toggle and some sniffing of key names to distinguish old and
new style elements. Once the transition from old to new style has
been completed, the compatibility code can be cleaned up.

8 years agoTest the show element command
Jeremy Stanley [Sat, 16 Apr 2016 03:10:32 +0000 (03:10 +0000)]
Test the show element command

Add a functional test for the show element command, to prevent
future regressions in it.

8 years agoSimplify multiline matching in functional tests
Jeremy Stanley [Sat, 16 Apr 2016 02:06:12 +0000 (02:06 +0000)]
Simplify multiline matching in functional tests

To ease matching across more complex outputs in functional test
conversations, use compiled expressions with the DOTALL flag so that
the "." wildcard will also match newline characters in the stream.

8 years agoFix show element command for Py3K
Jeremy Stanley [Sat, 16 Apr 2016 01:02:48 +0000 (01:02 +0000)]
Fix show element command for Py3K

Under Python 3, the dict.keys() method returns a generator rather
than a list and so cannot support the list.sort() method. Instead
use the sorted() function for this purpose in the show element
command. Also switch from concatenation to formatting to embed
facets in the output since they may contain nontext values.

8 years agoMake escape_macros no-op on nontext values
Jeremy Stanley [Thu, 17 Mar 2016 10:03:45 +0000 (10:03 +0000)]
Make escape_macros no-op on nontext values

Update the escape_macros() function to deal with YAML style
Element.get() that may return datatypes other than str. This allows
for indiscriminately passing facets through the function without
recasting them.

8 years agoCheck that functional tests log no errors
Jeremy Stanley [Mon, 7 Mar 2016 13:16:38 +0000 (13:16 +0000)]
Check that functional tests log no errors

After all other functional tests, check the output of show log 7 to
make sure that no earlier tests caused errors at or above that
loglevel.

8 years agoTest that the show log command works
Jeremy Stanley [Mon, 7 Mar 2016 12:26:43 +0000 (12:26 +0000)]
Test that the show log command works

Exercise the show log command in functional testing, and confirm
that it returns at least some log data.

8 years agoFix show log command for Py3K
Jeremy Stanley [Mon, 7 Mar 2016 11:43:13 +0000 (11:43 +0000)]
Fix show log command for Py3K

The behavior of lambda filters has changed in Python 3 such that you
can no longer treat them directly as lists. Trivially reimplement
them as list comprehensions. Also correct a missing minimum loglevel
fallback default.

8 years agoFix recursive BrokenPipeException on disconnect
Jeremy Stanley [Tue, 23 Feb 2016 22:32:27 +0000 (22:32 +0000)]
Fix recursive BrokenPipeException on disconnect

When an admin user has a broken pipe, attempting to log
BrokenPipeException errors to their socket raises another until the
max recursion depth is hit. Set the current user's state to
disconnecting before logging the error instead of after, so as to
avoid this loop.

8 years agoSwitch basic data loader unit from element to node
Jeremy Stanley [Sun, 21 Feb 2016 21:45:07 +0000 (21:45 +0000)]
Switch basic data loader unit from element to node

In preparation for a migration to a new flat data model where
elements are inferred from facet names, stop referring to the
top-level keys in data files as elements and instead call them
nodes. During the transitional period, a node could be an old-style
element or a new-style element's facet.

8 years agoExplicitly invoke Python 3.x in shebang lines
Jeremy Stanley [Sun, 24 Jan 2016 19:59:45 +0000 (19:59 +0000)]
Explicitly invoke Python 3.x in shebang lines

Since the codebase relies on Py3K-only syntax in places, explicitly
invoke the python3 interpreter rather than expecting the
environment's primary interpreter to support Python 3.x code.

8 years agoTest admin account restrictions
Jeremy Stanley [Mon, 28 Dec 2015 13:13:09 +0000 (13:13 +0000)]
Test admin account restrictions

Add an admin session in the functional tests, and confirm that an
admin can see a restricted function in the help output while a
non-admin cannot see it. Further confirm that an admin command
behaves as an unknown command when a non-admin attempts to call it.

8 years agoMore thorough match on chat mode test
Jeremy Stanley [Tue, 1 Dec 2015 01:45:58 +0000 (01:45 +0000)]
More thorough match on chat mode test

Use a multi-line match on the chat mode functional test, to confirm
both the command feedback and prompt change are present.

8 years agoTest actor movement
Jeremy Stanley [Thu, 19 Nov 2015 04:21:40 +0000 (04:21 +0000)]
Test actor movement

Exercise the move command in all configured directions in the
functional tests.

8 years agoMention test session capture log file names
Jeremy Stanley [Sun, 11 Oct 2015 04:29:32 +0000 (04:29 +0000)]
Mention test session capture log file names

When writing functional test session capture logs, mention the file
names for ease of reference.

8 years agoAdd timing data to test output
Jeremy Stanley [Wed, 7 Oct 2015 20:45:05 +0000 (20:45 +0000)]
Add timing data to test output

Print individual and aggregate functional test durations.

8 years agoTest chat mode
Jeremy Stanley [Sat, 19 Sep 2015 05:09:22 +0000 (05:09 +0000)]
Test chat mode

Add a functional test for chat mode.

8 years agoAdd troubleshooting note to test failure output
Jeremy Stanley [Mon, 7 Sep 2015 03:13:31 +0000 (03:13 +0000)]
Add troubleshooting note to test failure output

When a functional test failure is encountered, recommend the
corresponding log to check for the actual output when an expected
match is not found.

8 years agoBreak outer loop of functional tests on failure
Jeremy Stanley [Sun, 6 Sep 2015 18:18:58 +0000 (18:18 +0000)]
Break outer loop of functional tests on failure

When a test failure is encountered in the inner loop of functional
tests, also break out of the outer loop so that subsequent tests are
not run.

8 years agoBe more explicit with periods in test matches
Jeremy Stanley [Tue, 1 Sep 2015 03:54:17 +0000 (03:54 +0000)]
Be more explicit with periods in test matches

Correct some missed escapes for periods (.) in functional test match
strings.

8 years agoModularize functional testing
Jeremy Stanley [Sun, 23 Aug 2015 16:20:40 +0000 (16:20 +0000)]
Modularize functional testing

Break functional test dialogue groups into separate modules and add
a description to each for ease of debugging.

8 years agoTest sentence capitalization
Jeremy Stanley [Sat, 22 Aug 2015 19:36:16 +0000 (19:36 +0000)]
Test sentence capitalization

Add a functional test to make sure uncapitalized actor speech gets
displayed with proper sentence capitalization.

8 years agoTest typo replacements
Jeremy Stanley [Sun, 9 Aug 2015 19:07:32 +0000 (19:07 +0000)]
Test typo replacements

In the functional test dialogue, add tests for typo replacements.

8 years agoTest implicit punctuation
Jeremy Stanley [Fri, 7 Aug 2015 05:51:03 +0000 (05:51 +0000)]
Test implicit punctuation

In the functional test dialogue, confirm that the configured default
punctuation is appended when implicit punctuation is expected.

8 years agoRead pending bytes before proceeding with test
Jeremy Stanley [Wed, 15 Jul 2015 20:54:53 +0000 (20:54 +0000)]
Read pending bytes before proceeding with test

After a match in found in each step of the functional test, read in
the remaining buffer before replying. This makes the captures
slightly more readable, especially if the match in early in a block
of output.

8 years agoFix punctuation match order and add tests
Jeremy Stanley [Tue, 2 Jun 2015 06:08:02 +0000 (06:08 +0000)]
Fix punctuation match order and add tests

Add explicit punctuation functional tests with a conversation
between the two test sessions, and fix a nondeterministic bug this
exposed. Punctuation is now matched in a sorted order rather than
arbitrary hash table lookup order, and the sort is reversed so that
the longest match always wins.

8 years agoTest interaction between multiple connections
Jeremy Stanley [Sun, 17 May 2015 13:24:34 +0000 (13:24 +0000)]
Test interaction between multiple connections

Extend functional testing to utilize a second connection, and test
that the second actor entering and exiting the World causes the
first actor to see the correct messages for each of these events.

8 years agoLay groundwork for more thorough functional tests
Jeremy Stanley [Sat, 9 May 2015 11:45:03 +0000 (11:45 +0000)]
Lay groundwork for more thorough functional tests

Make bin/test support an arbitrary number of connections, be more
verbose about what it's doing, and archive complete captures of each
session involved.

9 years agoSwitch to yaml.safe_load for better security
Jeremy Stanley [Sat, 18 Apr 2015 06:54:07 +0000 (06:54 +0000)]
Switch to yaml.safe_load for better security

Use the yaml.safe_load to avoid unwanted privilege escalation due to
deserializing unsafe objects. Also switch to yaml.safe.dump for
symmetry, so that we don't write out files we'll later refuse to
parse.

9 years agoBe more strict about file permission masks
Jeremy Stanley [Mon, 23 Mar 2015 07:05:55 +0000 (07:05 +0000)]
Be more strict about file permission masks

Set a reasonably strict umask  of 0022 when creating most files and
directories. Also set the umask to 0077 for private files to avoid a
brief race where someone could open them for reading after creation
but prior to the prophylactic chmod to 0600.

9 years agoAccumulate logs if necessary while loading data
Jeremy Stanley [Mon, 23 Mar 2015 06:46:05 +0000 (06:46 +0000)]
Accumulate logs if necessary while loading data

Prior to existence of the global universe, the destination files for
logging may not be known. Accumulate log entries during
DataFile.load() if immediate logging fails, so that they can be
flushed later once logging is possible.

9 years agoRemove stray non-generic references in sample data
Jeremy Stanley [Wed, 18 Mar 2015 09:52:01 +0000 (09:52 +0000)]
Remove stray non-generic references in sample data

The sample data was adapted from an actual test implementation, and
a few references to that original dataset missed cleanup. Take care
of them.

9 years agoSwitch password handler to passlib's PBKDF2
Jeremy Stanley [Wed, 18 Feb 2015 03:35:59 +0000 (03:35 +0000)]
Switch password handler to passlib's PBKDF2

The passlib implementation of PBKDF2 is strong, portable and more
heavily audited. Use that instead of implementing our own custom
handler. Also simplify password use by dropping optional parameters
from the create and verify functions, and don't bother carrying the
old upgrade_legacy_hash public function forward; it can be reworked
to provide in-place hash upgrades later if desired.

9 years agoWrite files directly from yaml.dump
Jeremy Stanley [Sat, 17 Jan 2015 01:16:13 +0000 (01:16 +0000)]
Write files directly from yaml.dump

Simplify data file writing by passing a file descriptor directly to
the yaml.dump method rather than unnecessarily passing a string back
out of it and into a separate writer.

9 years agoRemove UTF-8 encoding header from Python files
Jeremy Stanley [Fri, 9 Jan 2015 21:19:05 +0000 (21:19 +0000)]
Remove UTF-8 encoding header from Python files

The Python 3.x interpreter assumes source files are in UTF-8 by
default, so file encoding headers are no longer necessary. Get rid
of them.

9 years agoFix type mismatches in save file rotation
Jeremy Stanley [Mon, 29 Dec 2014 20:21:49 +0000 (20:21 +0000)]
Fix type mismatches in save file rotation

The numeric suffix on rotated save files needs to be treated as an
int during rotation calculations but as a str during filename
generation. Make it so.

9 years agoCorrect avatar inheritance
Jeremy Stanley [Fri, 26 Dec 2014 10:00:06 +0000 (10:00 +0000)]
Correct avatar inheritance

The inherit facet should be a list, so correct an instance where it
was inadvertently left as a string literal instead.

9 years agoLog missing avatars
Jeremy Stanley [Thu, 6 Nov 2014 01:41:56 +0000 (01:41 +0000)]
Log missing avatars

If an avatar is missing, it's likely that it was created but not yet
saved during a crash. This is usually safe to skip but could imply
data corruption, so log the situation with a high log level.

9 years agoAccumulate logs during setup
Jeremy Stanley [Mon, 13 Oct 2014 03:12:08 +0000 (03:12 +0000)]
Accumulate logs during setup

Prior to existence of the global universe, the destination files for
logging may not be known. Accumulate log entries during
Universe.load() and then flush them once it's safe to do so.

9 years agoAdd a .gitignore file
Jeremy Stanley [Thu, 18 Sep 2014 23:31:35 +0000 (23:31 +0000)]
Add a .gitignore file

Use .gitignore to track ephemeral files created during testing.

9 years agoFinalize INI to YAML conversion
Jeremy Stanley [Sat, 13 Sep 2014 06:48:51 +0000 (06:48 +0000)]
Finalize INI to YAML conversion

Convert the main configuration file to YAML and rip out any remnants
of INI support.

9 years agoRemove the git2gch utility
Jeremy Stanley [Wed, 6 Aug 2014 14:38:51 +0000 (14:38 +0000)]
Remove the git2gch utility

The git2gch utility was previously used to generate GNU-style
ChangeLog files from Git commit history, but there are useful
existing tools for this now and it's out of scope for mudpy.

9 years agoClean up parenthetical spacing in bin/mudpy
Jeremy Stanley [Tue, 5 Aug 2014 00:33:41 +0000 (00:33 +0000)]
Clean up parenthetical spacing in bin/mudpy

For better PEP-8 conformance, correct parenthetical spacing in the
bin/mudpy file.

9 years agoMark unused import false positives
Jeremy Stanley [Tue, 29 Jul 2014 19:37:50 +0000 (19:37 +0000)]
Mark unused import false positives

Since the reload framework in the package's init imports modules
which look as if they don't get used, add noqa comments inline to
indicate they should be ignored by static analysis tools.

9 years agoConvert sample data directory index to YAML
Jeremy Stanley [Mon, 23 Jun 2014 22:35:01 +0000 (22:35 +0000)]
Convert sample data directory index to YAML

9 years agoSupport data directory indices in YAML
Jeremy Stanley [Tue, 17 Jun 2014 05:36:27 +0000 (05:36 +0000)]
Support data directory indices in YAML

* lib/mudpy/data.py(DataFile.load_yaml,DataFile.load_mpy): Add routines
to look for a YAML file index as well as the old INI-based format. For
YAML files, don't bother recasting entries to lists or dicts since they
should already be returned as the desired type.

9 years agoConvert sample prop data file to YAML
Jeremy Stanley [Mon, 16 Jun 2014 09:49:27 +0000 (09:49 +0000)]
Convert sample prop data file to YAML

9 years agoFile read-only check supports YAML
Jeremy Stanley [Fri, 13 Jun 2014 00:25:05 +0000 (00:25 +0000)]
File read-only check supports YAML

* lib/mudpy/data.py(DataFile.is_writeable): Add support for determining
read-only status of YAML data files.

9 years agoConvert sample area data file to YAML
Jeremy Stanley [Sat, 7 Jun 2014 21:32:16 +0000 (21:32 +0000)]
Convert sample area data file to YAML

9 years agoDon't unnecessarily recast lists and dicts
Jeremy Stanley [Mon, 2 Jun 2014 06:31:26 +0000 (06:31 +0000)]
Don't unnecessarily recast lists and dicts

* lib/mudpy/misc.py(Element.getlist,Element.getdict): Unlike INI, YAML
directly encodes other datatypes in addition to strings. When using get
functions for lists and dicts, if they're already provided in their
desired form then don't recast them as doing so would instead create
nested datatypes instead.

9 years agoInitialize data file contents on creation
Jeremy Stanley [Sun, 1 Jun 2014 19:11:37 +0000 (19:11 +0000)]
Initialize data file contents on creation

* lib/mudpy/data.py(DataFile.__init__): When instantiating a DataFile,
initialize its data class variable as an empty dict in case it's
traversed before getting populated.

9 years agoConvert menu data file to YAML
Jeremy Stanley [Tue, 27 May 2014 23:01:24 +0000 (23:01 +0000)]
Convert menu data file to YAML

9 years agoCatch exceptions in YAML menus
Jeremy Stanley [Tue, 20 May 2014 08:40:10 +0000 (08:40 +0000)]
Catch exceptions in YAML menus

* lib/mudpy/misc.py(Element.facets,Element.get): Early in login and
account creation, elements can have None in place of a dict for their
data. Under these circumstances, listing their keys throws
AttributeError and deep-linking into specific keys throws TypeError.
Catch these and treat them as empty.

9 years agoConvert command data file to YAML
Jeremy Stanley [Thu, 15 May 2014 23:42:22 +0000 (23:42 +0000)]
Convert command data file to YAML

9 years agoConvert archetype data file to YAML
Jeremy Stanley [Sat, 10 May 2014 16:16:56 +0000 (16:16 +0000)]
Convert archetype data file to YAML

9 years agoBegin the transition from INI to YAML
Jeremy Stanley [Thu, 8 May 2014 13:09:01 +0000 (13:09 +0000)]
Begin the transition from INI to YAML

* lib/mudpy/data.py(DataFile.load): Temporarily turn this method into a
selector which calls different loader methods depending on the file
extension so that old INI and new YAML files can be intermixed during
the transition.
(DataFile.load_yaml): This new loader method handles YAML files.
(DataFile.load_mpy): This is basically the old DataFile.load method.
(DataFile.save,DataFile.is_writeable): Add some TODO reminders for the
YAML transition.

* lib/mudpy/misc.py(Element.__init__,Element.facets,Element.get)
(Element.getboolean): Add conditional branching around calls deeper into
mudpy.data which need different behavior depending on the underlying
file formats.

* requirements.txt: Start tracking Python module dependencies in this
new file, and add the pyyaml module as the first entry.

9 years agoCorrect stray use of location
Jeremy Stanley [Sun, 4 May 2014 23:53:06 +0000 (23:53 +0000)]
Correct stray use of location

9 years agoClean up rendering in coder documentation
Jeremy Stanley [Tue, 29 Apr 2014 00:13:52 +0000 (00:13 +0000)]
Clean up rendering in coder documentation

* doc/coder.txt: Correct top-level numbering prefix and several
syntactically incorrect references.

9 years agoUse area instead of location or room
Jeremy Stanley [Wed, 23 Apr 2014 11:16:46 +0000 (11:16 +0000)]
Use area instead of location or room

Since the term "location" was already used for the name of the facet
identifying the area where an element is located, it was vague to also
use that term for a class of elements which serve as those locations.
Instead use the term "area" since it's as descriptive and shorter. Also
avoid the term "room" as a synonym since areas can be outside as well as
indoors. This further implies renaming the location.mpy sample file to
become area.mpy instead.

10 years agoSimplify coder documentation
Jeremy Stanley [Tue, 15 Apr 2014 13:08:54 +0000 (13:08 +0000)]
Simplify coder documentation

* doc/coder.txt: Stop suggesting that tarballs and epydoc documentation
are updated for every commit, since currently they aren't. Gut the style
guide now that the project is fully PEP-8 compliant, and suggest a
couple of code checking utilities to help keep it clean.

10 years agoMake exception logging failures more robust
Jeremy Stanley [Thu, 10 Apr 2014 19:09:01 +0000 (19:09 +0000)]
Make exception logging failures more robust

* lib/mudpy/misc.py(excepthook): When an uncaught exception is raised
and the attempt to log it fails, try to write it to stdout directly and
also mention the new exception details.

10 years agoBe explicit when show result raises an exception
Jeremy Stanley [Sat, 5 Apr 2014 01:58:58 +0000 (01:58 +0000)]
Be explicit when show result raises an exception

* lib/mudpy/misc.py(command_show): If an admin uses the show result
command and it raises an exception, return the details in the result
message.

10 years agoTighten exceptions for new sockets and reads
Jeremy Stanley [Thu, 27 Mar 2014 10:51:17 +0000 (10:51 +0000)]
Tighten exceptions for new sockets and reads

* lib/mudpy/misc.py(User.enqueue_input,check_for_connection): When
reading from a socket or polling for a new connection, be specific about
the exceptions which are benign so that we will still error out when
more detrimental exceptions are raised.

10 years agoFix log spamming on premature socket disconnect
Jeremy Stanley [Wed, 19 Mar 2014 19:05:57 +0000 (19:05 +0000)]
Fix log spamming on premature socket disconnect

* lib/mudpy/misc.py(User.flush): When sending on a user's socket raises
BrokenPipeError, their connection has probably dropped. Go ahead and set
their state to disconnecting so the socket will be cleaned up earily.
This also stops spamming the log on every failed write to a broken
socket before it eventually times out in the TCP/IP stack as well.

10 years agoStop trying to rename the daemon process
Jeremy Stanley [Mon, 10 Mar 2014 13:45:46 +0000 (13:45 +0000)]
Stop trying to rename the daemon process

* lib/mudpy/misc.py(daemonize): Remove the hacky process table entry
rewriting routines. They weren't cross-platform and never really worked
well. Also, these days admins are more used to daemons in interpreted
languages and know how to spot them in a process list with relative
ease.

10 years agoWrap long lines without using backslashes
Jeremy Stanley [Thu, 6 Mar 2014 02:32:27 +0000 (02:32 +0000)]
Wrap long lines without using backslashes

Try to align more closely with Python style guidelines on wrapping long
lines.

10 years agoClean up docstrings
Jeremy Stanley [Sun, 23 Feb 2014 14:36:51 +0000 (14:36 +0000)]
Clean up docstrings

10 years agoFix reload to use a copy of datafile keys
Jeremy Stanley [Mon, 10 Feb 2014 01:57:26 +0000 (01:57 +0000)]
Fix reload to use a copy of datafile keys

* lib/mudpy/misc.py: Python 2.x was more tolerant of this and it now
breaks under 3.4 release candidates, but correcting it to iterate over a
copy is arguably more correct anyway.

10 years agoRemove unused event code
Jeremy Stanley [Tue, 4 Feb 2014 19:15:00 +0000 (19:15 +0000)]
Remove unused event code

* lib/mudpy/misc.py: Event elements weren't fully implemented, so rip
out the dead code in preparation for a different implementation.

10 years agoCorrect copyright date for changelog
Jeremy Stanley [Tue, 28 Jan 2014 16:35:02 +0000 (16:35 +0000)]
Correct copyright date for changelog

10 years agoDrop support for Python 2.x
Jeremy Stanley [Mon, 20 Jan 2014 15:23:11 +0000 (15:23 +0000)]
Drop support for Python 2.x

Remove all derecated conditionals and fallbacks which provided
workarounds for supporting Python 2.x versions.

10 years agoClean up imports
Jeremy Stanley [Sat, 7 Dec 2013 23:19:08 +0000 (23:19 +0000)]
Clean up imports

Group all imports at the tops of files and alphabetize, for ease of
maintainabiity.

10 years agoFix an incorrect TODO comment line
Jeremy Stanley [Fri, 22 Nov 2013 10:27:38 +0000 (10:27 +0000)]
Fix an incorrect TODO comment line

10 years agoRecast to unicode when normalizing on Python 2.x
Jeremy Stanley [Wed, 16 Oct 2013 01:26:22 +0000 (01:26 +0000)]
Recast to unicode when normalizing on Python 2.x

* lib/mudpy/misc.py: Explicitly recast text to unicode type when passing
to unicodedata.normalize on Python 2.x.

10 years agoByte type comparisons on the output queue
Jeremy Stanley [Tue, 17 Sep 2013 08:13:03 +0000 (08:13 +0000)]
Byte type comparisons on the output queue

* lib/mudpy/misc.py: When comparing against data already in the output
queue, use byte type for compatibility with Py3K.

10 years agoImport a correct configparser for the interpreter
Jeremy Stanley [Wed, 7 Aug 2013 06:45:32 +0000 (06:45 +0000)]
Import a correct configparser for the interpreter

* lib/mudpy/data.py: Now import configparser and fall back to
ConfigParser if it's not found, for Py3K compatibility.

10 years agoCorrect byte types and encoding in test script
Jeremy Stanley [Sun, 21 Jul 2013 20:03:58 +0000 (20:03 +0000)]
Correct byte types and encoding in test script

* bin/test: It is sufficient to encode lookahead and written values on
the Telnet socket into UTF-8, and works correctly with Py3K now.

10 years agoUse chr instead of unichr
Jeremy Stanley [Sun, 9 Jun 2013 15:32:36 +0000 (15:32 +0000)]
Use chr instead of unichr

* lib/mudpy/misc.py: Missed in the earlier unicode to str patches, use
the chr function instead of unichr for Py3K compatibility.

10 years agoUse bytes in process table manipulation
Jeremy Stanley [Wed, 15 May 2013 10:35:51 +0000 (10:35 +0000)]
Use bytes in process table manipulation

* lib/mudpy/misc.py: When manipulating the process table, do so using
bytes type for Py3K compatibility.

10 years agoUse byte type for passwords hash encoding
Jeremy Stanley [Tue, 23 Apr 2013 17:39:49 +0000 (17:39 +0000)]
Use byte type for passwords hash encoding

* lib/mudpy/password.py: Raw hash values are manipulated as bytes for
Py3K compatibility.

11 years agoHandle byte type on sockets
Jeremy Stanley [Tue, 19 Mar 2013 03:10:40 +0000 (03:10 +0000)]
Handle byte type on sockets

* bin/test
* lib/mudpy/misc.py
* lib/mudpy/telnet.py: For Py3K compatibility, socket I/O uses byte type
instead of str.

11 years agoUse new 0o notation for octal constants
Jeremy Stanley [Mon, 25 Feb 2013 01:09:54 +0000 (01:09 +0000)]
Use new 0o notation for octal constants

* lib/mudpy/data.py: For Py3K compatibility, only refer to literal octal
constants using the 0o prefix.

11 years agoThe reload function is in the imp module
Jeremy Stanley [Wed, 30 Jan 2013 00:28:34 +0000 (00:28 +0000)]
The reload function is in the imp module

* bin/mudpy
* lib/mudpy/__init__.py: For Py3K compatibility, only invoke the reload
function from the imp module rather than the global built-in namespace.

11 years agoUse int type instead of long
Jeremy Stanley [Wed, 12 Dec 2012 20:58:27 +0000 (20:58 +0000)]
Use int type instead of long

* lib/mudpy/misc.py: Use int type instead of long, since Py3K will no
longer have a different representation for the latter.

11 years agoCorrect copyright years for change log
Jeremy Stanley [Wed, 7 Nov 2012 06:55:32 +0000 (06:55 +0000)]
Correct copyright years for change log

11 years agoRecast filters when comparing
Jeremy Stanley [Wed, 17 Oct 2012 22:03:31 +0000 (22:03 +0000)]
Recast filters when comparing

* lib/mudpy/misc.py: For Py3K compatibility, filters will need to be
recast to comparable data types when used in comparisons.

11 years agoWork around lack of dict_keys index in catch-all
Jeremy Stanley [Tue, 25 Sep 2012 16:32:32 +0000 (16:32 +0000)]
Work around lack of dict_keys index in catch-all

* lib/mudpy/misc.py: In Python 3000, dict.keys() returns a dict_keys
type which is not indexed, so work around it by converting to a list
anywhere we attempt to sort keys or access a key by ordered index.

11 years agoWork around lack of dict_keys index in data loader
Jeremy Stanley [Wed, 1 Aug 2012 11:28:59 +0000 (11:28 +0000)]
Work around lack of dict_keys index in data loader

* lib/mudpy/data.py: In Python 3000, dict.keys() returns a dict_keys
type which is not indexed, so work around it by converting to a list
anywhere we attempt to access a key by ordered index.

11 years agoUse range instead of xrange
Jeremy Stanley [Fri, 13 Jul 2012 13:20:09 +0000 (13:20 +0000)]
Use range instead of xrange

* lib/mudpy/password.py: Python 3000 is deprecating xrange in favor of
an iterator-based range which will be effectively as efficient, so stop
using xrange in preparation for the transition.

11 years agoUse absolute imports in telnet service module
Jeremy Stanley [Sat, 9 Jun 2012 12:50:00 +0000 (12:50 +0000)]
Use absolute imports in telnet service module

* lib/mudpy/telnet.py: Absolute imports are more readable and easier to
debug, so use them.

11 years agoUse absolute imports in catch-all module
Jeremy Stanley [Wed, 23 May 2012 21:07:52 +0000 (21:07 +0000)]
Use absolute imports in catch-all module

* lib/mudpy/misc.py: Absolute imports are more readable and easier to
debug, so use them.

11 years agoUse absolute imports in data handler module
Jeremy Stanley [Tue, 24 Apr 2012 20:26:31 +0000 (20:26 +0000)]
Use absolute imports in data handler module

* lib/mudpy/data.py: Absolute imports are more readable and easier to
debug, so use them.

12 years agoUse absolute imports in package init module
Jeremy Stanley [Tue, 6 Mar 2012 07:02:59 +0000 (07:02 +0000)]
Use absolute imports in package init module

* lib/mudpy/__init__.py: Absolute imports are more readable and easier
to debug, so use them.