TuxWordSmith.tws
index
/usr/lib/python2.6/site-packages/TuxWordSmith/tws.py

/**********************************************************
 
    Organization    :AsymptopiaSoftware | Software@theLimit
 
    Website         :www.asymptopia.org
 
    Author          :Charles B. Cosse
 
    Email           :ccosse@gmail.com
 
    Copyright       :(C) 2006-2010 Asymptopia Software
 
    License         :GPLv3
 
***********************************************************/

 
Modules
       
pygame.color
copy
math
os
pygame
xml.sax.saxutils
string
sys
time
types
unicodedata
_xmlplus

 
Classes
       
TuxWordSmithApp
TuxWordSmith.twssolver.TWSSolver
TuxWordSmith

 
class TuxWordSmith(TuxWordSmith.twssolver.TWSSolver)
     Methods defined here:
__init__(self, mode, level, use_default_level, USE_WX)
busy(self)
create_default_spot_surface(self, visible)
display_overlay(self, xfont, msg)
draw_feedback_overlay(self)
draw_tiles(self)
end_of_game_reached(self)
exchange(self)
flip(self)
focus_definition(self)
get_user_initials(self, idx)
go_credit(self)
go_fullscreen(self)
go_help(self)
go_screenshot(self)
go_splash(self)
handle_events(self)
handle_mouse(self)
increment_level(self)
increment_player_idx(self)
load_config(self)
load_resources(self)
make_feedback_table_cell(self, w, h, frame_color, msg)
on_exit(self)
progress_message(self, msg)
queue_thinking_maneuver(self)
refill_bag_of_tiles(self)
reload_configs(self)
run(self)
set_current_resource(self, current_resource)
set_last_defn(self, str_defn)
show_credit(self)
show_defn_overlay(self, spot)
show_dist_overlay(self)
show_help(self)
show_letter_overlay(self, spot)
show_loading(self)
shuffle(self)
skip_turn(self)
sort_on_field(self, l, i)
take_turn(self)
throw_back_submission(self)
timer_update(self)
update(self)
update_global_config_dependents(self)
update_highscores(self)
validate(self, submission)
waiting_player_idx(self)

Methods inherited from TuxWordSmith.twssolver.TWSSolver:
build_ntuple(self)
check_col_neighborhood(self, m, n, word, fp_wcidx_candidate, idx_map)
check_row_neighborhood(self, m, n, word, fp_wcidx_candidate, idx_map)
compute_delta(self, L0, L1)
generate_options(self)
get_article(self, target)
get_article_via_article_lookup_key(self, article_lookup_key)
get_candidates(self, fp_list, min_wc, max_wc, max_delta)
get_installed(self)
get_scrabble_sum(self, fp_list)
get_unidesc_field(self, uchar, field)
load_resource(self)
lower_uchar(self, uchar)
mkfingerprint(self, uniword)
mkfp_num(self, fp_list)
mkfp_sum(self, fp_list)
mkidxfingerprint(self, word, wc_list)
mktstamp(self)
mkwcidxfingerprint(self, word, wc_list)
subtract_fp0_from_fp1(self, fp0, fp1)
subtract_strfp0_from_strfp1(self, fp0, fp1)
upper_uchar(self, uchar)

 
class TuxWordSmithApp
     Methods defined here:
__init__(self)

 
Functions
       
acos(...)
acos(x)
 
Return the arc cosine (measured in radians) of x.
acosh(...)
acosh(x)
 
Return the hyperbolic arc cosine (measured in radians) of x.
asin(...)
asin(x)
 
Return the arc sine (measured in radians) of x.
asinh(...)
asinh(x)
 
Return the hyperbolic arc sine (measured in radians) of x.
atan(...)
atan(x)
 
Return the arc tangent (measured in radians) of x.
atan2(...)
atan2(y, x)
 
Return the arc tangent (measured in radians) of y/x.
Unlike atan(y/x), the signs of both x and y are considered.
atanh(...)
atanh(x)
 
Return the hyperbolic arc tangent (measured in radians) of x.
ceil(...)
ceil(x)
 
Return the ceiling of x as a float.
This is the smallest integral value >= x.
copysign(...)
copysign(x,y)
 
Return x with the sign of y.
cos(...)
cos(x)
 
Return the cosine of x (measured in radians).
cosh(...)
cosh(x)
 
Return the hyperbolic cosine of x.
degrees(...)
degrees(x) -> converts angle x from radians to degrees
exp(...)
exp(x)
 
Return e raised to the power of x.
fabs(...)
fabs(x)
 
Return the absolute value of the float x.
factorial(...)
factorial(x) -> Integral
 
Find x!. Raise a ValueError if x is negative or non-integral.
floor(...)
floor(x)
 
Return the floor of x as a float.
This is the largest integral value <= x.
fmod(...)
fmod(x,y)
 
Return fmod(x, y), according to platform C.  x % y may differ.
frexp(...)
frexp(x)
 
Return the mantissa and exponent of x, as pair (m, e).
m is a float and e is an int, such that x = m * 2.**e.
If x is 0, m and e are both 0.  Else 0.5 <= abs(m) < 1.0.
fsum(...)
sum(iterable)
 
Return an accurate floating point sum of values in the iterable.
Assumes IEEE-754 floating point arithmetic.
getrandbits(...)
getrandbits(k) -> x.  Generates a long int with k random bits.
hypot(...)
hypot(x,y)
 
Return the Euclidean distance, sqrt(x*x + y*y).
isinf(...)
isinf(x) -> bool
Checks if float x is infinite (positive or negative)
isnan(...)
isnan(x) -> bool
Checks if float x is not a number (NaN)
jumpahead(...)
jumpahead(int) -> None.  Create new state from existing state and integer.
ldexp(...)
ldexp(x, i) -> x * (2**i)
log(...)
log(x[, base]) -> the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.
log10(...)
log10(x) -> the base 10 logarithm of x.
log1p(...)
log1p(x)
 
Return the natural logarithm of 1+x (base e).
      The result is computed in a way which is accurate for x near zero.
modf(...)
modf(x)
 
Return the fractional and integer parts of x.  Both results carry the sign
of x and are floats.
pow(...)
pow(x,y)
 
Return x**y (x to the power of y).
radians(...)
radians(x) -> converts angle x from degrees to radians
random(...)
random() -> x in the interval [0, 1).
sin(...)
sin(x)
 
Return the sine of x (measured in radians).
sinh(...)
sinh(x)
 
Return the hyperbolic sine of x.
sqrt(...)
sqrt(x)
 
Return the square root of x.
tan(...)
tan(x)
 
Return the tangent of x (measured in radians).
tanh(...)
tanh(x)
 
Return the hyperbolic tangent of x.
trunc(...)
trunc(x:Real) -> Integral
 
Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

 
Data
        ACTIVEEVENT = 1
ANYFORMAT = 268435456
ASYNCBLIT = 4
AUDIO_S16 = 32784
AUDIO_S16LSB = 32784
AUDIO_S16MSB = 36880
AUDIO_S16SYS = 32784
AUDIO_S8 = 32776
AUDIO_U16 = 16
AUDIO_U16LSB = 16
AUDIO_U16MSB = 4112
AUDIO_U16SYS = 16
AUDIO_U8 = 8
BIG_ENDIAN = 4321
BLEND_ADD = 1
BLEND_MAX = 5
BLEND_MIN = 4
BLEND_MULT = 3
BLEND_RGBA_ADD = 6
BLEND_RGBA_MAX = 16
BLEND_RGBA_MIN = 9
BLEND_RGBA_MULT = 8
BLEND_RGBA_SUB = 7
BLEND_RGB_ADD = 1
BLEND_RGB_MAX = 5
BLEND_RGB_MIN = 4
BLEND_RGB_MULT = 3
BLEND_RGB_SUB = 2
BLEND_SUB = 2
BUTTON_X1 = 6
BUTTON_X2 = 7
DEBUG = 0
DOUBLEBUF = 1073741824
FULLSCREEN = -2147483648
GL_ACCELERATED_VISUAL = 15
GL_ACCUM_ALPHA_SIZE = 11
GL_ACCUM_BLUE_SIZE = 10
GL_ACCUM_GREEN_SIZE = 9
GL_ACCUM_RED_SIZE = 8
GL_ALPHA_SIZE = 3
GL_BLUE_SIZE = 2
GL_BUFFER_SIZE = 4
GL_DEPTH_SIZE = 6
GL_DOUBLEBUFFER = 5
GL_GREEN_SIZE = 1
GL_MULTISAMPLEBUFFERS = 13
GL_MULTISAMPLESAMPLES = 14
GL_RED_SIZE = 0
GL_STENCIL_SIZE = 7
GL_STEREO = 12
GL_SWAP_CONTROL = 16
HAT_CENTERED = 0
HAT_DOWN = 4
HAT_LEFT = 8
HAT_LEFTDOWN = 12
HAT_LEFTUP = 9
HAT_RIGHT = 2
HAT_RIGHTDOWN = 6
HAT_RIGHTUP = 3
HAT_UP = 1
HWACCEL = 256
HWPALETTE = 536870912
HWSURFACE = 1
IYUV_OVERLAY = 1448433993
JOYAXISMOTION = 7
JOYBALLMOTION = 8
JOYBUTTONDOWN = 10
JOYBUTTONUP = 11
JOYHATMOTION = 9
KEYDOWN = 2
KEYUP = 3
KMOD_ALT = 768
KMOD_CAPS = 8192
KMOD_CTRL = 192
KMOD_LALT = 256
KMOD_LCTRL = 64
KMOD_LMETA = 1024
KMOD_LSHIFT = 1
KMOD_META = 3072
KMOD_MODE = 16384
KMOD_NONE = 0
KMOD_NUM = 4096
KMOD_RALT = 512
KMOD_RCTRL = 128
KMOD_RMETA = 2048
KMOD_RSHIFT = 2
KMOD_SHIFT = 3
K_0 = 48
K_1 = 49
K_2 = 50
K_3 = 51
K_4 = 52
K_5 = 53
K_6 = 54
K_7 = 55
K_8 = 56
K_9 = 57
K_AMPERSAND = 38
K_ASTERISK = 42
K_AT = 64
K_BACKQUOTE = 96
K_BACKSLASH = 92
K_BACKSPACE = 8
K_BREAK = 318
K_CAPSLOCK = 301
K_CARET = 94
K_CLEAR = 12
K_COLON = 58
K_COMMA = 44
K_DELETE = 127
K_DOLLAR = 36
K_DOWN = 274
K_END = 279
K_EQUALS = 61
K_ESCAPE = 27
K_EURO = 321
K_EXCLAIM = 33
K_F1 = 282
K_F10 = 291
K_F11 = 292
K_F12 = 293
K_F13 = 294
K_F14 = 295
K_F15 = 296
K_F2 = 283
K_F3 = 284
K_F4 = 285
K_F5 = 286
K_F6 = 287
K_F7 = 288
K_F8 = 289
K_F9 = 290
K_FIRST = 0
K_GREATER = 62
K_HASH = 35
K_HELP = 315
K_HOME = 278
K_INSERT = 277
K_KP0 = 256
K_KP1 = 257
K_KP2 = 258
K_KP3 = 259
K_KP4 = 260
K_KP5 = 261
K_KP6 = 262
K_KP7 = 263
K_KP8 = 264
K_KP9 = 265
K_KP_DIVIDE = 267
K_KP_ENTER = 271
K_KP_EQUALS = 272
K_KP_MINUS = 269
K_KP_MULTIPLY = 268
K_KP_PERIOD = 266
K_KP_PLUS = 270
K_LALT = 308
K_LAST = 323
K_LCTRL = 306
K_LEFT = 276
K_LEFTBRACKET = 91
K_LEFTPAREN = 40
K_LESS = 60
K_LMETA = 310
K_LSHIFT = 304
K_LSUPER = 311
K_MENU = 319
K_MINUS = 45
K_MODE = 313
K_NUMLOCK = 300
K_PAGEDOWN = 281
K_PAGEUP = 280
K_PAUSE = 19
K_PERIOD = 46
K_PLUS = 43
K_POWER = 320
K_PRINT = 316
K_QUESTION = 63
K_QUOTE = 39
K_QUOTEDBL = 34
K_RALT = 307
K_RCTRL = 305
K_RETURN = 13
K_RIGHT = 275
K_RIGHTBRACKET = 93
K_RIGHTPAREN = 41
K_RMETA = 309
K_RSHIFT = 303
K_RSUPER = 312
K_SCROLLOCK = 302
K_SEMICOLON = 59
K_SLASH = 47
K_SPACE = 32
K_SYSREQ = 317
K_TAB = 9
K_UNDERSCORE = 95
K_UNKNOWN = 0
K_UP = 273
K_a = 97
K_b = 98
K_c = 99
K_d = 100
K_e = 101
K_f = 102
K_g = 103
K_h = 104
K_i = 105
K_j = 106
K_k = 107
K_l = 108
K_m = 109
K_n = 110
K_o = 111
K_p = 112
K_q = 113
K_r = 114
K_s = 115
K_t = 116
K_u = 117
K_v = 118
K_w = 119
K_x = 120
K_y = 121
K_z = 122
LIL_ENDIAN = 1234
MOUSEBUTTONDOWN = 5
MOUSEBUTTONUP = 6
MOUSEMOTION = 4
NOEVENT = 0
NOFRAME = 32
NUMEVENTS = 32
OPENGL = 2
OPENGLBLIT = 10
PREALLOC = 16777216
QUIT = 12
RESIZABLE = 16
RLEACCEL = 16384
RLEACCELOK = 8192
SCRAP_BMP = 'image/bmp'
SCRAP_CLIPBOARD = 0
SCRAP_PBM = 'image/pbm'
SCRAP_PPM = 'image/ppm'
SCRAP_SELECTION = 1
SCRAP_TEXT = 'text/plain'
SRCALPHA = 65536
SRCCOLORKEY = 4096
SWSURFACE = 0
SYSWMEVENT = 13
TIMER_RESOLUTION = 10
USEREVENT = 24
UYVY_OVERLAY = 1498831189
VIDEOEXPOSE = 17
VIDEORESIZE = 16
YUY2_OVERLAY = 844715353
YV12_OVERLAY = 842094169
YVYU_OVERLAY = 1431918169
e = 2.7182818284590451
feature_namespaces = 'http://xml.org/sax/features/namespaces'
hdx1 = 15
hdx2 = 15
hexnames = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
idx = 3
images = {}
letters = ['"', '&', ';', ':', '?', '<', '>', ' ', '-', '.', '/', '"', '(', ')', "'", '{', '}', 'a', 'b', 'c', ...]
parser = <xml.sax.expatreader.ExpatParser instance at 0x954bd0c>
pi = 3.1415926535897931
ustr = r"u'\u03FF'"