Modernized some code to comply with newer (python 2.4+) C-API
interfaces. Some wesnoth functions now return bool values, as
documented, rather than ints. A new version of bruteforce has been
added which shows unsafe AI. This AI runs 2x-14x faster than the stock
bruteforce because of memoize pattern and psyco. The AI is only
available if unsafe AI execution is enabled (disable option).
If the key is not found, the default value is returned. set_variable
exception handling has been fixed to return an exception in the
current call frame.
Many wesnoth module functions now release the python GIL when it is
both safe to do so and the function call takes long enough where it
also makes sense. A new global boolean variable, 'restricted' is now
set before the user AI script is invoked. This variable indicates if
it is running inside of a restricted python environment or not. A new
class of unrestricted scripts are now listed. Previously only scripts
which have '#!WPY' at the top are allowed. If only allow safe python
scripts is disabled, scripts which start with #!UNSAFE_WPY are also
shown to users. This allows AI authors to specifically target either a
restricted or unrestricted environment. New "system" class attributes
are exposed in the restricted environment. These include; '__call__',
'__copy__', '__deepcopy__', '__doc__', '__name__', '__repr__' and
'__str__', in addition to the old __init__ method.
Has been added to safe.py. KeyboardInterrupt has been removed available
exceptions. Exceptions can now be raised by user code. The list of
allowed, builtin attributes has been expanded to include: __call__,
__doc__, __name__, __repr__, and __str__ as these are all commonly
used in non-trivial code. From imports are now allowed, but only
from the whitelisted imports. A new string restriction has been added,
_STR_NOT_END, which expands the existing validation idioms. User
code can now have variables which start with "__"; which means they
can now have pseudo private attributes.
* Rewrote the drawing code to be able to force a redraw and to invalidate the
background. This fixes the ttoggle_panel redraw problems.
* Removed the no_redraw label hack
* Updated the WIKI comment blocks to fix some typos and add some forgotten info.
Some changes to core WML code is still required to make it properly
follow the new encoding/decoding escape sequences. Some results of
pylint have been applied. Includes minor portability enhancements.
Some code changed to be more OO+pythonic (e.g. threading). Some code
stubs are in place for future enhancements. Most reliable works
except for uploads.