more work on qlogviewer

* displays battles
 * added dreadnought/clanship in startinglevel
This commit is contained in:
Gabor Körber 2017-05-22 20:42:50 +02:00
parent 39bc7604bf
commit 9e16e1786c
4 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ class PvPBeaconHunt(PvPBattle):
# Dreads
class DreadnoughtBattle(Battle):
pass
_game_type_strings = ['ClanShip']
### PvE Stuff: low prio.
class PvEBattle(Battle):
@ -103,7 +103,7 @@ def battle_factory(logs):
for line in logs.game_log.lines:
if isinstance(line, game.StartingLevel):
if not line.unpack():
print('Encountered broken packet.')
print('Encountered broken packet: ', line.values)
continue
if not line.is_mainmenu():
# this is the beginning of a new battle.

View File

@ -171,7 +171,7 @@ class StartingLevel(GameLog):
__slots__ = GameLog.__slots__
# level, gametype, unknown_gametype
matcher = [
re.compile(r"^======\sstarting\slevel\:\s'(?P<level>[^']+)'\s(?P<gametype>[^\s]+)\sclient\s(?P<some_id>\d+)\s======"),
re.compile(r"^======\sstarting\slevel\:\s'(?P<level>[^']+)'\s(?P<gametype>[^\s]+)\sclient\s======"),
re.compile(r"^======\sstarting\slevel\:\s'(?P<level>[^']+)'\s(?P<gametype>[^\s]+)\s======"),
re.compile(r"^======\sstarting\slevel\:\s'(?P<level>[^']+)'\s+======"),

View File

@ -34,7 +34,7 @@
"""
from .base import Log
import re
from logs.base import Stacktrace
from scon.logs.base import Stacktrace
import logging
RE_SCLOG = r'^(?P<hh>\d{2,2})\:(?P<mm>\d{2,2})\:(?P<ss>\d{2,2})\.(?P<ns>\d{3,3})\s(?P<logtype>\s*[^\|\s]+\s*|\s+)\|\s(?P<log>.*)'
R_SCLOG = re.compile(RE_SCLOG)

View File

@ -56,7 +56,7 @@ class SessionTreeView(Qt.QTreeView):
for battle in battles:
o = Qt.QStandardItem("%s (Level '%s', Gametype '%s')" %( battle.__class__.__name__, battle.level, battle.gametype ) )
o.setEditable(False)
info_object.appendRow(o)
item.appendRow(o)
if len(battles) > 0:
#session.parse_files(['combat.log', 'chat.log'])
info_object.setText('%s games' % (len(battles),))