The main HUD process can hang due to unhandled exceptions, which
occurred in two separate situations:
1. Table window is closed and HUD instance killed before auto-importer
knows about it
2. Sometimes the threading can jam
These changes attempt to counter the effect of race-conditions. The
dictionary key (table name) is properly tested at the beginning of
update/create block, *but* there are two short round-trips to database
before the key is used. While these occur, the HUD instance can vanish
and thus get its key removed from the dictionary.
Also, when Tables.Table() is created, it will be populated on-demand,
and have child attributes only when such are found from the system. The
new table code pulls in data from actual windows. Again, there is a
query involved and while it runs, the table may have vanished. This
ended up as an error in this call:
foo = gtk.gdk.window_foreign_new(table.number)
The object 'table' is valid (not None) but it has been populated only
after actual table window was killed. Therefore it may not have .number
attribute, which raised an AttributeError. Now the presence of
table.number attribute is tested before the object can be sent to
create_HUD().
Process: get crash info, add exception info to Exceptions.py, catch generic database exception in fpdb_db.py (around the connect line), throw correct Fpdb exception, then catch it in fpdb.py and do the appropriate thing on the GUI end.
some reformatting in Tables.py, as well as some new debug prints to deal with some potential issues. Add code to deal with potential problems in Win x64, that are biting me at random. Not finished, but the problems stopped happening so can't continue.
Modified files:
* Configuration.py
* HUD_config.xml.example
* HUD_main.py
Instead of tweaking aggregation settings directly in code, make the
values configurable through HUD_config.xml; use the newly created
<hud_ui> element for this. Retain coding convention and key-value
names as they are.
guiautoimport: import traceback
fpdb_simple/GuiPlayerStats: deal with multiple sites with players with matching names
HUD_main: error file is again HUD-error not fpdb-error-log.