Hi; I've make a patch to get more information from the event keys in the match viewer, file attached. I have a very basic english and this is my first time with python :-( the code and the text strings should be reviewed. PS: Should I apply as a CHPP developer to send patchs for mattricks? Regards; -- Carles Index: Mattricks/Mattricks/MatchViewerPage.py =================================================================== RCS file: /cvsroot/mattricks/Mattricks/Mattricks/MatchViewerPage.py,v retrieving revision 1.28 diff -u -r1.28 MatchViewerPage.py --- Mattricks/Mattricks/MatchViewerPage.py 9 Jul 2004 18:27:45 -0000 1.28 +++ Mattricks/Mattricks/MatchViewerPage.py 16 Aug 2004 17:53:42 -0000 @@ -281,6 +281,9 @@ AWAY_BUTTON = 801 MATCH_BUTTON = 802 + HOME_TEAM_COLOR = "#000066" + AWAY_TEAM_COLOR = "#660000" + def __init__(self, parent, ID, live): self.parent = parent self.match_id = None @@ -450,8 +453,8 @@ main_sizer.Fit(self.imp_events_panel) # Set up new sizer for the match report. - self.mrp_sizer = wxFlexGridSizer(cols=2, vgap=5, hgap=0) - self.mrp_sizer.AddGrowableCol(1) + self.mrp_sizer = wxFlexGridSizer(cols=3, vgap=5, hgap=0) + self.mrp_sizer.AddGrowableCol(2) self.match_report_panel.SetSizer(self.mrp_sizer, True) self.match_report_panel.SetAutoLayout(True) self.mrp_sizer.Fit(self.match_report_panel) @@ -621,14 +624,170 @@ self.report_texts.append(stext) - event_text = Live.break_up_row(Live.unhtmlify(event_text), 80) - stext2 = wxStaticText(self.match_report_panel, -1, str(event_text)) + resum_text = "" + + if event_key[0] in [20]: + resum_text += _("Team formation") + elif event_key[0] in [21]: + resum_text += _("Team lineup") + elif event_key[0] in [25]: + resum_text += _("Derby") + elif event_key[0] in [30, 31, 32, 33]: + resum_text += _("Spectators and weather") + elif event_key[0] in [40, 47]: + resum_text += _("Ball possesion") + elif event_key[0] in [41]: + resum_text += _("Best player") + elif event_key[0] in [42]: + resum_text += _("Worst player") + elif event_key[0] in [45]: + resum_text += _("Half-time") + elif event_key[0] in [46]: + resum_text += _("Hat trick") + elif event_key[0] in [56, 57,58, 59]: + resum_text += _("Penalty") + elif event_key[0] in [61]: + resum_text += _("Confusion") + elif event_key[0] in [62]: + resum_text += _("Defensive") + elif event_key[0] in [64]: + resum_text += _("Tactical briefing") + elif event_key[0] in [68]: + resum_text += _("Pressing") + elif event_key[0] in [70]: + resum_text += _("Overtime") + elif event_key[0] in [71]: + resum_text += _("Penalties") + elif event_key[0] in [72]: + resum_text += _("Victory in extratime") + elif event_key[0] in [90, 94]: + resum_text += _("Bruised") + elif event_key[0] in [91, 92, 93, 95, 96]: + resum_text += _("Injured") + elif 100 <= event_key[0] <= 299: + if 100 <= event_key[0] <= 199: + resum_text = _("Goal") + else: + resum_text = _("Chance") + if event_key[0] in [100, 110, 120, 130, 150, 160, 170, 180, 190] or \ + event_key[0] in [200, 210, 220, 230, 250, 260, 270, 280, 290]: + resum_text += " (" + _("free kick") + ")" + elif event_key[0] in [140] or \ + event_key[0] in [240]: + resum_text += " (" + _("CA free kick") + ")" + elif event_key[0] in [101, 111, 121, 131, 151, 161, 171, 181, 191] or \ + event_key[0] in [201, 211, 221, 231, 251, 261, 271, 281, 291]: + resum_text += " (" + _("central attack") + ")" + elif event_key[0] in [141] or \ + event_key[0] in [241]: + resum_text += " (" + _("CA central attack") + ")" + elif event_key[0] in [102, 112, 122, 132, 152, 162, 172, 182, 192] or \ + event_key[0] in [202, 212, 222, 232, 252, 262, 272, 282, 292]: + resum_text += " (" + _("left attack") + ")" + elif event_key[0] in [142] or \ + event_key[0] in [242]: + resum_text += " (" + _("CA left attack") + ")" + elif event_key[0] in [103, 113, 123, 133, 153, 163, 173, 183, 193] or \ + event_key[0] in [203, 213, 223, 233, 253, 263, 273, 283, 293]: + resum_text += " (" + _("right attack") + ")" + elif event_key[0] in [143] or \ + event_key[0] in [243]: + resum_text += " (" + _("CA right attack") + ")" + elif event_key[0] in [104, 114, 124, 134, 154, 164, 174, 184, 194] or \ + event_key[0] in [204, 214, 224, 234, 254, 264, 274, 284, 294]: + resum_text += " (" + _("penalty") + ")" + elif event_key[0] in [105] or \ + event_key[0] in [205]: + resum_text += " (" + _("unpred. long pass") + ")" + elif event_key[0] in [107] or \ + event_key[0] in [207]: + resum_text += " (" + _("long shot") + ")" + elif event_key[0] in [108] or \ + event_key[0] in [208]: + resum_text += " (" + _("unpredictable pass") + ")" + elif event_key[0] in [109] or \ + event_key[0] in [209]: + resum_text += " (" + _("unpred. stupid pass") + ")" + elif event_key[0] in [115] or \ + event_key[0] in [215]: + resum_text += " (" + _("quick player") + ")" + elif event_key[0] in [116] or \ + event_key[0] in [216]: + resum_text += " (" + _("quick pass") + ")" + elif event_key[0] in [117] or \ + event_key[0] in [217]: + resum_text += " (" + _("tired defender") + ")" + elif event_key[0] in [118] or \ + event_key[0] in [218]: + resum_text += " (" + _("corner") + ")" + elif event_key[0] in [119] or \ + event_key[0] in [219]: + resum_text += " (" + _("corner to head") + ")" + elif event_key[0] in [135] or \ + event_key[0] in [235]: + resum_text += " (" + _("experienced") + ")" + elif event_key[0] in [136] or \ + event_key[0] in [236]: + resum_text += " (" + _("inexperienced") + ")" + elif event_key[0] in [137] or \ + event_key[0] in [237]: + resum_text += " (" + _("winger to head") + ")" + elif event_key[0] in [138] or \ + event_key[0] in [238]: + resum_text += " (" + _("winger pass to forw.") + ")" + elif event_key[0] in [139] or \ + event_key[0] in [239]: + resum_text += " (" + _("technical vs. head") + ")" + else: + resum_text += " (" + str(event_key[0]) +"," + str(event_key[1]) + ")" + elif event_key[0] in [302]: + resum_text += _("Powerful weather win") + elif event_key[0] in [303]: + resum_text += _("Technical weather win") + elif event_key[0] in [304]: + resum_text += _("Powerful weather lost") + elif event_key[0] in [305]: + resum_text += _("Quick weather lost") + elif event_key[0] in [331]: + resum_text += _("Pressing tactic") + elif event_key[0] in [332]: + resum_text += _("Counter-attack tactic") + elif event_key[0] in [333]: + resum_text += _("Attack in the middle") + elif event_key[0] in [334]: + resum_text += _("Attack on wings") + elif event_key[0] in [501, 502]: + resum_text += _("Walk over") + elif event_key[0] in [510, 511]: + resum_text += _("Booked") + elif event_key[0] in [512, 513, 514]: + resum_text += _("Sent off") + elif event_key[0] in [599]: + resum_text += _("End") + else: + resum_text = event_key + + if subject_tid == home_team[0]: + resum_col = self.HOME_TEAM_COLOR + elif subject_tid == away_team[0]: + resum_col = self.AWAY_TEAM_COLOR + else: + resum_col = "#000000" + + stext2 = wxStaticText(self.match_report_panel, -1, str(resum_text)) + stext2.SetForegroundColour(resum_col) self.report_texts.append(stext2) + event_text = Live.break_up_row(Live.unhtmlify(event_text), 80) + stext3 = wxStaticText(self.match_report_panel, -1, str(event_text)) + self.report_texts.append(stext3) + if config.get("Match viewer", "report direction") == "normal": self.mrp_sizer.Add(stext, 0, wxALIGN_TOP | wxALL, 2) self.mrp_sizer.Add(stext2, 1, wxEXPAND | wxALIGN_TOP | wxALL, 2) + self.mrp_sizer.Add(stext3, 2, wxEXPAND | wxALIGN_TOP | wxALL, 2) else: + self.mrp_sizer.Prepend(stext3, 2, wxEXPAND | wxALIGN_TOP | wxALL, 2) self.mrp_sizer.Prepend(stext2, 1, wxEXPAND | wxALIGN_TOP | wxALL, 2) self.mrp_sizer.Prepend(stext, 0, wxALIGN_TOP | wxALL, 2)
I've make a patch to get more information from the event keys in the match viewer, file attached. Thanks, really nice!
I have a very basic english and this is my first time with python :-( the code and the text strings should be reviewed. Looks good. There are, off course, things that can be written differently, but it works and that's the most important thing! It takes a while to learn all python's nice features.
PS: Should I apply as a CHPP developer to send patchs for mattricks? No, there is no need for that. However, if you would like to continue developing Mattricks (which would be nice) we can set up cvs-access for you, so that you can commit your own patches.
I have checked it in and is planning to make it optional (I try to make most features optional), so expect one more check in, soon. /Oscar
I posted a link to the source in the CHPP conference in a discussion about event keys. Here is the reply: --- Looks pretty much the same. Let me point out the differences: * 106/206 is missing in your version, however I have seen examples of it * 118 is classified as corner (Hattristics: corner+head) and 119 as co+head (Hattristics: head) Let me check that again with the German texts * In your opinion, is 119 regular chance? Does it not involve a head specialist? * 137 is "winger to head". Does that mean, it needs a head specialist in the middle? * 138: does it need to be a winger who has the passing, is there a specialty involved? * 238 is mentioned, have you ever seen it? --- If you would like to comment on it, I can forward your comments to the conference. /Oscar
En/na Oscar Gustafsson ha escrit:
I posted a link to the source in the CHPP conference in a discussion about event keys. Here is the reply:
Thanks, I only reviewed matches and I didn't retain the match ids :(
Looks pretty much the same. Let me point out the differences:
* 106/206 is missing in your version, however I have seen examples of it
Ooops! I've lost this one :-( What SE is 106/206?
* 118 is classified as corner (Hattristics: corner+head) and 119 as co+head (Hattristics: head) Let me check that again with the German texts * In your opinion, is 119 regular chance? Does it not involve a head specialist?
I think that there are 2 corner S.E. one involving a head specialist and scored with the head (118) and other with a non-head specialist (119).
* 137 is "winger to head". Does that mean, it needs a head specialist in the middle? * 138: does it need to be a winger who has the passing, is there a specialty involved?
I think that there is at least two winger S.E. one passing to a winger and/or forward head specialist (and scored with head) (137) and other scored by a forward and may be a winger non-head specialist with sufficient scoring skill. Reviewing the texts and the rules I think that we should change "winger pass to forw." to winger pass to f/w".
* 238 is mentioned, have you ever seen it?
I'm not sure, when I fond a 2xx chance or a 1xx goal I put the other in the code; and the winger S.E. is very rare and it's possible that I onlu found the 138. I reviewed more than a hundred matches to get that S.E. but I'm sure that there are some ones that I didn't found, when a not know S.E. is shown in the viewed the code is shown in the viewer, I hope they will be reported in the conference.
---
If you would like to comment on it, I can forward your comments to the conference.
Thanks. Regards, -- Carles
En/na Oscar Gustafsson ha escrit:
PS: Should I apply as a CHPP developer to send patchs for mattricks?
No, there is no need for that. However, if you would like to continue developing Mattricks (which would be nice) we can set up cvs-access for you, so that you can commit your own patches.
Thanks, but before getting cvs-access I preffer to improve my knowledge about python and wxpython; I don't want to break mattricks ;) sending patches to you (or the mattricks list) is fine for me. Regards; -- Carles
participants (2)
-
Carles Muñoz Gorriz -
Oscar Gustafsson