Commits

Marcin Kasperski committed 7cf7638

Properly parsing kibitzes of players rated < 1000

  • Participants
  • Parent commits 03d7741

Comments (0)

Files changed (2)

File src/mekk/fics/parsing/info_parser.py

      ^
      (?P<who>[^\s()]+)                    # Goober
      (?:\(\S+\))*                         # (C), (SR)(TD) itp
-     \((?P<rank>[^\s()]+)\)               # (2322), (----)
+     \(\s?(?P<rank>[^\s()]+)\)               # (2322), (----), ( 958)
      \[(?P<game_no>\d+)\]                  # [181]
      \s(?P<method>kibitzes|whispers):\s   #  kibitzes:
      (?P<what>.*)                         # blah blah

File tests/test_parser.py

         self.failUnlessEqual(d.player, PlayerName('MiloBot'))
         self.failUnlessEqual(d.rating_value, 958)
         self.failUnlessEqual(d.text, 'Hello from Crafty v22.7 !')
-        self.failUnlessEqual(d.method, 'kibitzes')
+        self.failUnlessEqual(d.method, 'whispers')
         (w,d) = info_parser.parse_fics_line("MiloBot(C)( 958)[235] kibitzes: mated in 1 moves.")
         self.failUnlessEqual(w, 'game_kibitz')
         self.failUnlessEqual(d.game_no, 235)