[Commits] [wesnoth/wesnoth] 90919e: wmllint, wmlindent, wmltools: fixed dir being used...

GitHub noreply at github.com
Wed Aug 5 18:42:55 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 90919e12c6f0582003e6e070fd8b17e8ddcfc5ab
      https://github.com/wesnoth/wesnoth/commit/90919e12c6f0582003e6e070fd8b17e8ddcfc5ab
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wesnoth/wmltools.py
    M data/tools/wmlindent
    M data/tools/wmllint

  Log Message:
  -----------
  wmllint, wmlindent, wmltools: fixed dir being used as variable name

In Python, dir is an in-built function


  Commit: 778e9296d8c235f4530b03f3f9b25f93d6651b11
      https://github.com/wesnoth/wesnoth/commit/778e9296d8c235f4530b03f3f9b25f93d6651b11
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wmlscope

  Log Message:
  -----------
  wmlscope: fixed files being incorrectly opened as UTF8 instead of binary


  Commit: ad3631419c5931a3e1f4e9658b19d92627fa00fc
      https://github.com/wesnoth/wesnoth/commit/ad3631419c5931a3e1f4e9658b19d92627fa00fc
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wesnoth/wmliterator.py
    M data/tools/wesnoth/wmltools.py

  Log Message:
  -----------
  wmltools and wmliterator: removed __cmp__ method

The __cmp__ method isn't supported any more by Python 3.
Instead, one should define the six usual comparison methods, or define only two of them and let the @total_ordering decorator handle the rest


  Commit: 6d67feff9f6ac509fa14f5e60710359289138e03
      https://github.com/wesnoth/wesnoth/commit/6d67feff9f6ac509fa14f5e60710359289138e03
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wesnoth/wmltools.py
    M data/tools/wmlscope

  Log Message:
  -----------
  wmlscope and wmltools: removed calls to cmp() function

Just like the __cmp__ method, the cmp() function isn't available on Python 3


  Commit: c1a783b0389a507bdbe8e7643a53a66f03a2e308
      https://github.com/wesnoth/wesnoth/commit/c1a783b0389a507bdbe8e7643a53a66f03a2e308
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wesnoth/wmliterator.py
    M data/tools/wesnoth/wmltools.py
    M data/tools/wmlindent
    M data/tools/wmllint
    M data/tools/wmlscope

  Log Message:
  -----------
  all main wml tools: use filter(), map() and zip() from Python 3

The main difference is that these functions return generators instead of lists. This actually breaks wmlscope's collision detection, which will be fixed in my next commit.


  Commit: 8c098c32644022c1e876d2c81a7c583b57d8b9fc
      https://github.com/wesnoth/wesnoth/commit/8c098c32644022c1e876d2c81a7c583b57d8b9fc
  Author: Elvish_Hunter <elvish.hunter2010 at gmail.com>
  Date:   2015-08-05 (Wed, 05 Aug 2015)

  Changed paths:
    M data/tools/wmlscope

  Log Message:
  -----------
  wmlscope: refactored collision detection

This fixes the breakage caused by the Python 3 zip() function, which like all generators may be iterated only once; also, it finally returns a meaningful output, instead of the obscure list of filenames which was formerly returned


Compare: https://github.com/wesnoth/wesnoth/compare/39ffd1e37d6d...8c098c326440


More information about the Commits mailing list