- if key == 'P':\r
- # if we were working on a player record already, append\r
- # it and work on a new one (only set team info)\r
- if len(events) > 0:\r
+ if key == 'Q' or key == 'P':\r
+ #log.debug('Found a {0}'.format(key))\r
+ #log.debug('in_Q: {0}'.format(in_Q))\r
+ #log.debug('in_P: {0}'.format(in_P))\r
+ #log.debug('events: {0}'.format(events))\r
+\r
+ # check where we were before and append events accordingly\r
+ if in_Q and len(events) > 0:\r
+ #log.debug('creating a team (Q) entry')\r
+ teams.append(events)\r
+ events = {}\r
+ elif in_P and len(events) > 0:\r
+ #log.debug('creating a player (P) entry')\r