Hello community, here is the log from the commit of package nml for openSUSE:Leap:15.2 checked in at 2020-03-31 07:23:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/nml (Old) and /work/SRC/openSUSE:Leap:15.2/.nml.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nml" Tue Mar 31 07:23:37 2020 rev:11 rq:789555 version:0.4.5 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/nml/nml.changes 2020-01-15 15:33:44.598873226 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.nml.new.3160/nml.changes 2020-03-31 07:23:45.558434214 +0200 @@ -1,0 +2,39 @@ +Tue Mar 24 17:28:15 UTC 2020 - Christophe Giboudeaux <[email protected]> + +- Add upstream patch to fix the python 3.8 compatibility: + * 0001-Fix-52-time.clock-has-been-removed-in-python-3.8-53.patch + + +------------------------------------------------------------------- +Mon May 27 14:41:43 UTC 2019 - Jon Brightwell <[email protected]> + +- Removed nml-python341.diff - python bug, fixed python upstream (3.4.2rc1). +- Removed nml-0.4.2-pillow.diff - superceded upstream +- added python-pillow-version.patch - fixes incorrect version number query https://github.com/OpenTTD/nml/pull/29 + +- update to 0.4.5 + - Feature: increase cargo ID range from 32 to 64, to support 64 cargos in OpenTTD 11ab3c4ea2f6a6d29efda8c9ba2af04194621ea7 + - Change: Support more DCxx strings for OpenTTD r27769. + - Add: Properties for vehicle sprite stack. + - Add: CB_FLAG_MORE_SPRITES, PALETTE_IDENTITY + - Add: String command 9A 1E CARGO_NAME. + - Add: CB_RESULT_IND_NO_TEXT_NO_AMOUNT + - Codechange: Store textids without offset in string_ranges + - Fix: String encoding with cases was non-deterministic and resulted in differing md5sums for the NewGRF. + - Fix: Rearrange order of string id assignment to keep compatibility. + - Fix: When some IDs depleted, an internal NML error was raised instead of the intended error message. + - Fix: most_common_refit was reading the wrong bits in var 42; read the write bits and rename it to most_common_cargo_type + as it's more accurate; also add most_common_cargo_subtype which also reads var 42 and was previously missing + - Fix: Switch from :r format code to !r conversion flag to avoid crashes. + +- 0.4.4 (2016-01-07) + - Fix/Revert: Stripping one path level is not enough + +- 0.4.3 (2016-01-07) + - Add: prob_map_gen as alternative name for the mapgen industry probability property + - Fix: Stripping one path level is enough + - Fix: Compatibility with newer versions of pillow. + - Fix: Vehicle 'sort' function caused internal error when an empty list was passed. + - Fix: motion_counter is 24 bits, not 4. + +------------------------------------------------------------------- @@ -4 +43 @@ -- update tp 0.4.2 +- update to 0.4.2 Old: ---- nml-0.4.2-pillow.diff nml-0.4.2.tar.gz nml-python341.diff New: ---- 0001-Fix-52-time.clock-has-been-removed-in-python-3.8-53.patch nml-0.4.5.tar.gz python-pillow-version.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nml.spec ++++++ --- /var/tmp/diff_new_pack.vJg5Op/_old 2020-03-31 07:23:46.222434502 +0200 +++ /var/tmp/diff_new_pack.vJg5Op/_new 2020-03-31 07:23:46.222434502 +0200 @@ -1,7 +1,7 @@ # # spec file for package nml # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,23 +12,23 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: nml -Version: 0.4.2 +Version: 0.4.5 Release: 0 Summary: NewGRF Meta Language -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Development/Tools/Building -Url: http://dev.openttdcoop.org/projects/nml +URL: http://dev.openttdcoop.org/projects/nml Source: http://bundles.openttdcoop.org/nml/releases/%{version}/%{name}-%{version}.tar.gz Source99: nml-rpmlintrc -# PATCH-FIX-OPENSUSE nml-python341.diff [email protected] -- fix build for Leap https://dev.openttdcoop.org/issues/7637 -Patch0: nml-python341.diff -# PATCH-FIX-OPENSUSE nml-0.4.2-pillow.diff -- fix build for new Pillow instead of PIL -Patch1: nml-0.4.2-pillow.diff +#PATCH-FIX-UPSTREAM Pillow changed it's version string https://github.com/OpenTTD/nml/pull/29 +Patch0: python-pillow-version.patch +# PATCH-FIX-UPSTREAM time.clock() is gone in python 3.8 +Patch1: 0001-Fix-52-time.clock-has-been-removed-in-python-3.8-53.patch BuildRequires: gcc BuildRequires: python3-devel # We need the required packages also on building for regression tests: @@ -46,8 +46,7 @@ %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -%patch1 -p1 +%autopatch -p1 %build make ++++++ 0001-Fix-52-time.clock-has-been-removed-in-python-3.8-53.patch ++++++ >From e706f93926983b4c700953c92bdb35cdd5ffa2f0 Mon Sep 17 00:00:00 2001 From: glx22 <[email protected]> Date: Sun, 20 Oct 2019 11:05:25 +0200 Subject: [PATCH] Fix #52: time.clock() has been removed in python 3.8 (#53) --- nml/generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nml/generic.py b/nml/generic.py index ce064b6..8ee602f 100644 --- a/nml/generic.py +++ b/nml/generic.py @@ -295,7 +295,7 @@ def clear_progress(): hide_progress() if (progress_message is not None) and (verbosity_level >= VERBOSITY_TIMING): - print("{} {:.1f} s".format(progress_message, time.clock() - progress_start_time)) + print("{} {:.1f} s".format(progress_message, time.process_time() - progress_start_time)) progress_message = None progress_start_time = None @@ -324,12 +324,12 @@ def print_progress(msg, incremental = False): progress_message = msg if incremental: - t = time.clock() + t = time.process_time() if (progress_update_time is not None) and (t - progress_update_time < 1): return progress_update_time = t else: - progress_start_time = time.clock() + progress_start_time = time.process_time() print_eol(msg) -- 2.25.1 ++++++ nml-0.4.2.tar.gz -> nml-0.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/PKG-INFO new/nml-0.4.5/PKG-INFO --- old/nml-0.4.2/PKG-INFO 2015-09-12 20:47:24.000000000 +0200 +++ new/nml-0.4.5/PKG-INFO 2018-06-30 11:11:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: nml -Version: 0.4.2 +Version: 0.4.5 Summary: A tool to compile nml files to grf or nfo files Home-page: http://dev.openttdcoop.org/projects/nml Author: NML Development Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/docs/changelog.txt new/nml-0.4.5/docs/changelog.txt --- old/nml-0.4.2/docs/changelog.txt 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/docs/changelog.txt 2018-06-30 11:10:30.000000000 +0200 @@ -1,3 +1,35 @@ +0.4.5 (2018-06-30) +------------------------------------------------------------------------ +- Feature: increase cargo ID range from 32 to 64, to support 64 cargos in OpenTTD 11ab3c4ea2f6a6d29efda8c9ba2af04194621ea7 +- Change: Support more DCxx strings for OpenTTD r27769. +- Add: Properties for vehicle sprite stack. +- Add: CB_FLAG_MORE_SPRITES, PALETTE_IDENTITY +- Add: String command 9A 1E CARGO_NAME. +- Add: CB_RESULT_IND_NO_TEXT_NO_AMOUNT +- Codechange: Store textids without offset in string_ranges +- Fix: String encoding with cases was non-deterministic and resulted in differing md5sums for the NewGRF. +- Fix: Rearrange order of string id assignment to keep compatibility. +- Fix: When some IDs depleted, an internal NML error was raised instead of the intended error message. +- Fix: most_common_refit was reading the wrong bits in var 42; read the write bits and rename it to most_common_cargo_type + as it's more accurate; also add most_common_cargo_subtype which also reads var 42 and was previously missing +- Fix: Switch from :r format code to !r conversion flag to avoid crashes. +- Update: Changelog + + +0.4.4 (2016-01-07) +------------------------------------------------------------------------ +- Fix/Revert: Stripping one path level is not enough + + +0.4.3 (2016-01-07) +------------------------------------------------------------------------ +- Add: prob_map_gen as alternative name for the mapgen industry probability property +- Fix: Stripping one path level is enough +- Fix: Compatibility with newer versions of pillow. +- Fix: Vehicle 'sort' function caused internal error when an empty list was passed. +- Fix: motion_counter is 24 bits, not 4. + + 0.4.2 (2015-09-13) ------------------------------------------------------------------------ -Add: New industry type limits of OpenTTD 1.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/docs/nml.spec new/nml-0.4.5/docs/nml.spec --- old/nml-0.4.2/docs/nml.spec 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/docs/nml.spec 2018-06-30 11:10:30.000000000 +0200 @@ -17,14 +17,14 @@ Name: nml -Version: 0.3.1 +Version: 0.4.3 Release: 0 Summary: NewGRF Meta Language License: GPL-2.0+ Group: Development/Tools/Building Url: http://dev.openttdcoop.org/projects/nml Source0: http://bundles.openttdcoop.org/nml/releases/%{version}/%{name}-%{version}.src.tar.gz -BuildRequires: python-devel >= 2.6 +BuildRequires: python-devel >= 3.2 BuildRequires: python-setuptools #We need for regression test the required packages also on building: BuildRequires: python-imaging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/docs/nmlc.1 new/nml-0.4.5/docs/nmlc.1 --- old/nml-0.4.2/docs/nmlc.1 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/docs/nmlc.1 2018-06-30 11:10:30.000000000 +0200 @@ -1,4 +1,4 @@ -.Dd February 17, 2015 +.Dd January 07, 2016 .Dt NMLC 1 .Sh NAME .Nm NMLC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/docs/readme.txt new/nml-0.4.5/docs/readme.txt --- old/nml-0.4.2/docs/readme.txt 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/docs/readme.txt 2018-06-30 11:10:30.000000000 +0200 @@ -1,6 +1,6 @@ NML readme -Last updated: 2015-09-12 -Release version: 0.4.2 +Last updated: 2016-01-07 +Release version: 0.4.3 ------------------------------------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/__version__.py new/nml-0.4.5/nml/__version__.py --- old/nml-0.4.2/nml/__version__.py 2015-09-12 20:47:24.000000000 +0200 +++ new/nml-0.4.5/nml/__version__.py 2018-06-30 11:11:19.000000000 +0200 @@ -1,2 +1,2 @@ # this file is autogenerated by setup.py -version = "0.4.2" +version = "0.4.5" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action0.py new/nml-0.4.5/nml/actions/action0.py --- old/nml-0.4.2/nml/actions/action0.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action0.py 2018-06-30 11:10:30.000000000 +0200 @@ -197,7 +197,7 @@ BlockAllocation( 0, -1, "Global", False), BlockAllocation( 0, 255, "Industry Tile"), BlockAllocation( 0, 127, "Industry"), - BlockAllocation( 0, 31, "Cargo"), + BlockAllocation( 0, 63, "Cargo"), BlockAllocation( 0, -1, "Sound"), BlockAllocation( 0, 127, "Airport"), BlockAllocation( 0, -1, "Signal", False), @@ -969,15 +969,16 @@ def parse_sort_block(feature, vehid_list): prop_num = [0x1A, 0x20, 0x1B, 0x1B] action_list = [] - last = vehid_list[0] - idx = len(vehid_list) - 1 - while idx >= 0: - cur = vehid_list[idx] - prop = Action0Property(prop_num[feature], [last], 3) - action_list.append(Action0(feature, cur.value)) - action_list[-1].prop_list.append(prop) - last = cur - idx -= 1 + if len(vehid_list) >= 2: + last = vehid_list[0] + idx = len(vehid_list) - 1 + while idx >= 0: + cur = vehid_list[idx] + prop = Action0Property(prop_num[feature], [last], 3) + action_list.append(Action0(feature, cur.value)) + action_list[-1].prop_list.append(prop) + last = cur + idx -= 1 return action_list callback_flag_properties = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action0properties.py new/nml-0.4.5/nml/actions/action0properties.py --- old/nml-0.4.2/nml/actions/action0properties.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action0properties.py 2018-06-30 11:10:30.000000000 +0200 @@ -31,7 +31,7 @@ @param file: The outputfile we have to write to. @type file: L{SpriteOutputBase} """ - raise NotImplementedError('write is not implemented in {:r}'.format(type(self))) + raise NotImplementedError('write is not implemented in {!r}'.format(type(self))) def get_size(self): """ @@ -41,7 +41,7 @@ @return: The size of this property in bytes. @rtype: C{int} """ - raise NotImplementedError('get_size is not implemented in {:r}'.format(type(self))) + raise NotImplementedError('get_size is not implemented in {!r}'.format(type(self))) class Action0Property(BaseAction0Property): """ @@ -816,7 +816,8 @@ 'min_cargo_distr' : {'size': 1, 'num': 0x14}, 'random_sound_effects' : {'custom_function': random_sounds}, # = prop 15 'conflicting_ind_types' : {'custom_function': industry_conflicting_types}, # = prop 16 - 'prob_random' : {'size': 1, 'num': 0x17}, + 'prob_random' : {'size': 1, 'num': 0x17}, # Obsolete, ambiguous name, use 'prob_map_gen' instead + 'prob_map_gen' : {'size': 1, 'num': 0x17}, 'prob_in_game' : {'size': 1, 'num': 0x18}, 'map_colour' : {'size': 1, 'num': 0x19}, 'spec_flags' : {'size': 4, 'num': 0x1A}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action14.py new/nml-0.4.5/nml/actions/action14.py --- old/nml-0.4.2/nml/actions/action14.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action14.py 2018-06-30 11:10:30.000000000 +0200 @@ -83,7 +83,7 @@ @return: The size (in bytes) of this node. """ - raise NotImplementedError('get_size must be implemented in Action14Node-subclass {:r}'.format(type(self))) + raise NotImplementedError('get_size must be implemented in Action14Node-subclass {!r}'.format(type(self))) def write(self, file): """ @@ -91,7 +91,7 @@ @param file: The file to write the output to. """ - raise NotImplementedError('write must be implemented in Action14Node-subclass {:r}'.format(type(self))) + raise NotImplementedError('write must be implemented in Action14Node-subclass {!r}'.format(type(self))) def write_type_id(self, file): file.print_string(self.type_string, False, True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action2.py new/nml-0.4.5/nml/actions/action2.py --- old/nml-0.4.2/nml/actions/action2.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action2.py 2018-06-30 11:10:30.000000000 +0200 @@ -271,7 +271,7 @@ This method should not be called, because calling a method on a meta class can be troublesome. Instead, call initialize(..). """ - raise NotImplementedError('__init__ must be implemented in ASTSpriteGroup-subclass {:r}, initialize(..) should be called instead'.format(type(self))) + raise NotImplementedError('__init__ must be implemented in ASTSpriteGroup-subclass {!r}, initialize(..) should be called instead'.format(type(self))) def initialize(self, name = None, feature = None, num_params = 0): """ @@ -384,7 +384,7 @@ @return: A collection containing all links to other nodes. @rtype: C{iterable} of L{SpriteGroupRef} """ - raise NotImplementedError('collect_references must be implemented in ASTSpriteGroup-subclass {:r}'.format(type(self))) + raise NotImplementedError('collect_references must be implemented in ASTSpriteGroup-subclass {!r}'.format(type(self))) def set_action2(self, action2, feature): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action2var_variables.py new/nml-0.4.5/nml/actions/action2var_variables.py --- old/nml-0.4.2/nml/actions/action2var_variables.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action2var_variables.py 2018-06-30 11:10:30.000000000 +0200 @@ -127,7 +127,8 @@ 'position_in_vehid_chain_from_end' : {'var': 0x41, 'start': 8, 'size': 8}, 'num_vehs_in_vehid_chain' : {'var': 0x41, 'start': 16, 'size': 8}, # One-based, already sane 'cargo_classes_in_consist' : {'var': 0x42, 'start': 0, 'size': 8}, - 'most_common_refit' : {'var': 0x42, 'start': 16, 'size': 8}, + 'most_common_cargo_type' : {'var': 0x42, 'start': 8, 'size': 8}, + 'most_common_cargo_subtype' : {'var': 0x42, 'start': 16, 'size': 8}, 'bitmask_consist_info' : {'var': 0x42, 'start': 24, 'size': 8}, 'company_num' : {'var': 0x43, 'start': 0, 'size': 8}, 'company_type' : {'var': 0x43, 'start': 16, 'size': 2}, @@ -140,7 +141,7 @@ 'curv_info_prev_next' : {'var': 0x45, 'start': 16, 'size': 4, 'value_function': value_sign_extend}, 'curv_info' : {'var': 0x45, 'start': 0, 'size': 12, 'value_function': lambda var, info: expression.BinOp(nmlop.AND, var, expression.ConstantNumeric(0x0F0F, var.pos), var.pos).reduce()}, - 'motion_counter' : {'var': 0x46, 'start': 8, 'size': 4}, + 'motion_counter' : {'var': 0x46, 'start': 8, 'size': 24}, 'cargo_type_in_veh' : {'var': 0x47, 'start': 0, 'size': 8}, 'cargo_unit_weight' : {'var': 0x47, 'start': 8, 'size': 8}, 'cargo_classes' : {'var': 0x47, 'start': 16, 'size': 16}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/action4.py new/nml-0.4.5/nml/actions/action4.py --- old/nml-0.4.2/nml/actions/action4.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/action4.py 2018-06-30 11:10:30.000000000 +0200 @@ -73,8 +73,10 @@ 0xC4: {'random_id': False}, # Station class names 0xC5: {'random_id': False}, # Station names 0xC9: {'random_id': False}, # House name - 0xD0: {'random_id': True, 'total': 0x400, 'ids': list(range(0x3FF, -1, -1))}, # Misc. text ids, used for callbacks and such - 0xDC: {'random_id': True, 'total': 0x100, 'ids': list(range(0xFF, -1, -1))}, # Misc. persistent text ids, used to set properties + # Misc. text ids, used for callbacks and such + 0xD0: {'random_id': True, 'total': 0x400, 'ids': list(range(0xD3FF, 0xCFFF, -1))}, + # Misc. persistent text ids, used to set properties. Use Ids DC00..DCFF first to keep compatibility with older versions of OTTD. + 0xDC: {'random_id': True, 'total': 0x800, 'ids': list(range(0xDBFF, 0xD7FF, -1)) + list(range(0xDFFF, 0xDBFF, -1))}, } # Mapping of string identifiers to D0xx/DCxx text ids @@ -107,9 +109,9 @@ for string_range, strings in list(used_strings.items()): for feature_name, id in list(strings.items()): feature, string_name = feature_name - texts.append( (0x7F, (string_range << 8) | id, grfstrings.get_translation(string_name), feature) ) + texts.append( (0x7F, id, grfstrings.get_translation(string_name), feature) ) for lang_id in grfstrings.get_translations(string_name): - texts.append( (lang_id, (string_range << 8) | id, grfstrings.get_translation(string_name, lang_id), feature) ) + texts.append( (lang_id, id, grfstrings.get_translation(string_name, lang_id), feature) ) last_lang = -1 last_id = -1 @@ -171,8 +173,7 @@ # ID must be supplied assert id is not None assert isinstance(id, expression.ConstantNumeric) - id_val = id.value - id_val = id_val | (string_range << 8) + id_val = id.value | (string_range << 8) else: # Not a string range, so we must have an id assert id is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/actions/base_action.py new/nml-0.4.5/nml/actions/base_action.py --- old/nml-0.4.2/nml/actions/base_action.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/actions/base_action.py 2018-06-30 11:10:30.000000000 +0200 @@ -32,7 +32,7 @@ @param file: The outputfile to write the data to. @type file: L{SpriteOutputBase} """ - raise NotImplementedError('write is not implemented in {:r}'.format(type(self))) + raise NotImplementedError('write is not implemented in {!r}'.format(type(self))) def skip_action7(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/ast/base_statement.py new/nml-0.4.5/nml/ast/base_statement.py --- old/nml-0.4.2/nml/ast/base_statement.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/ast/base_statement.py 2018-06-30 11:10:30.000000000 +0200 @@ -88,7 +88,7 @@ @param indentation: Print all lines with at least C{indentation} spaces @type indentation: C{int} """ - raise NotImplementedError('debug_print must be implemented in BaseStatement-subclass {:r}'.format(type(self))) + raise NotImplementedError('debug_print must be implemented in BaseStatement-subclass {!r}'.format(type(self))) def get_action_list(self): """ @@ -97,7 +97,7 @@ @return: A list of action @rtype: C{list} of L{BaseAction} """ - raise NotImplementedError('get_action_list must be implemented in BaseStatement-subclass {:r}'.format(type(self))) + raise NotImplementedError('get_action_list must be implemented in BaseStatement-subclass {!r}'.format(type(self))) def __str__(self): """ @@ -106,7 +106,7 @@ @return: An NML string representing this action @rtype: C{str} """ - raise NotImplementedError('__str__ must be implemented in BaseStatement-subclass {:r}'.format(type(self))) + raise NotImplementedError('__str__ must be implemented in BaseStatement-subclass {!r}'.format(type(self))) class BaseStatementList(BaseStatement): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/ast/cargotable.py new/nml-0.4.5/nml/ast/cargotable.py --- old/nml-0.4.2/nml/ast/cargotable.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/ast/cargotable.py 2018-06-30 11:10:30.000000000 +0200 @@ -21,8 +21,10 @@ def __init__(self, cargo_list, pos): base_statement.BaseStatement.__init__(self, "cargo table", pos, False, False) self.cargo_list = cargo_list + + def register_names(self): generic.OnlyOnce.enforce(self, "cargo table") - for i, cargo in enumerate(cargo_list): + for i, cargo in enumerate(self.cargo_list): if isinstance(cargo, expression.Identifier): self.cargo_list[i] = expression.StringLiteral(cargo.value, cargo.pos) expression.parse_string_to_dword(self.cargo_list[i]) # we don't care about the result, only validate the input diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/ast/grf.py new/nml-0.4.5/nml/ast/grf.py --- old/nml-0.4.2/nml/ast/grf.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/ast/grf.py 2018-06-30 11:10:30.000000000 +0200 @@ -86,7 +86,6 @@ self.version = None self.min_compatible_version = None self.params = [] - generic.OnlyOnce.enforce(self, "GRF-block") for assignment in alist: if isinstance(assignment, ParameterDescription): self.params.append(assignment) @@ -98,6 +97,9 @@ elif assignment.name.value == "min_compatible_version": self.min_compatible_version = assignment.value else: raise generic.ScriptError("Unknown item in GRF-block: " + str(assignment.name), assignment.name.pos) + def register_names(self): + generic.OnlyOnce.enforce(self, "GRF-block") + def pre_process(self): if None in (self.name, self.desc, self.grfid, self.version, self.min_compatible_version): raise generic.ScriptError("A GRF-block requires the 'name', 'desc', 'grfid', 'version' and 'min_compatible_version' properties to be set.", self.pos) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/ast/railtypetable.py new/nml-0.4.5/nml/ast/railtypetable.py --- old/nml-0.4.2/nml/ast/railtypetable.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/ast/railtypetable.py 2018-06-30 11:10:30.000000000 +0200 @@ -22,11 +22,11 @@ def __init__(self, railtype_list, pos): base_statement.BaseStatement.__init__(self, "rail type table", pos, False, False) self.railtype_list = railtype_list + + def register_names(self): generic.OnlyOnce.enforce(self, "rail type table") global_constants.is_default_railtype_table = False global_constants.railtype_table.clear() - - def register_names(self): for i, railtype in enumerate(self.railtype_list): if isinstance(railtype, assignment.Assignment): name = railtype.name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/expression/base_expression.py new/nml-0.4.5/nml/expression/base_expression.py --- old/nml-0.4.2/nml/expression/base_expression.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/expression/base_expression.py 2018-06-30 11:10:30.000000000 +0200 @@ -42,7 +42,7 @@ @param indentation: Indent all printed lines with at least C{indentation} spaces. """ - raise NotImplementedError('debug_print must be implemented in expression-subclass {:r}'.format(type(self))) + raise NotImplementedError('debug_print must be implemented in expression-subclass {!r}'.format(type(self))) def __str__(self): """ @@ -50,7 +50,7 @@ @return: A string representation of this expression. """ - raise NotImplementedError('__str__ must be implemented in expression-subclass {:r}'.format(type(self))) + raise NotImplementedError('__str__ must be implemented in expression-subclass {!r}'.format(type(self))) def reduce(self, id_dicts = [], unknown_id_fatal = True): """ @@ -63,7 +63,7 @@ @return: A deep copy of this expression simplified as much as possible. """ - raise NotImplementedError('reduce must be implemented in expression-subclass {:r}'.format(type(self))) + raise NotImplementedError('reduce must be implemented in expression-subclass {!r}'.format(type(self))) def reduce_constant(self, id_dicts = []): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/free_number_list.py new/nml-0.4.5/nml/free_number_list.py --- old/nml-0.4.2/nml/free_number_list.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/free_number_list.py 2018-06-30 11:10:30.000000000 +0200 @@ -69,7 +69,7 @@ @return: Some free number. """ assert len(self.states) > 0 - if self.free_numbers == 0: + if len(self.free_numbers) == 0: raise generic.ScriptError(self.exception, pos) num = self.free_numbers.pop() self.states[-1].append(num) @@ -91,7 +91,7 @@ @return: Some free number. """ - if self.free_numbers == 0: + if len(self.free_numbers) == 0: raise generic.ScriptError(self.exception, pos) return self.free_numbers.pop() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/generic.py new/nml-0.4.5/nml/generic.py --- old/nml-0.4.2/nml/generic.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/generic.py 2018-06-30 11:10:30.000000000 +0200 @@ -64,7 +64,7 @@ @type b: C{int} @return: Greatest common divisor. - @rtype: C{int] + @rtype: C{int} """ while b != 0: t = b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/global_constants.py new/nml-0.4.5/nml/global_constants.py --- old/nml-0.4.2/nml/global_constants.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/global_constants.py 2018-06-30 11:10:30.000000000 +0200 @@ -114,22 +114,26 @@ 'TRAIN_FLAG_FLIP' : 3, 'TRAIN_FLAG_AUTOREFIT': 4, 'TRAIN_FLAG_NO_BREAKDOWN_SMOKE': 6, + 'TRAIN_FLAG_SPRITE_STACK': 7, #roadveh misc flags 'ROADVEH_FLAG_TRAM' : 0, 'ROADVEH_FLAG_2CC' : 1, 'ROADVEH_FLAG_AUTOREFIT': 4, 'ROADVEH_FLAG_NO_BREAKDOWN_SMOKE': 6, + 'ROADVEH_FLAG_SPRITE_STACK': 7, #ship misc flags 'SHIP_FLAG_2CC' : 1, 'SHIP_FLAG_AUTOREFIT': 4, 'SHIP_FLAG_NO_BREAKDOWN_SMOKE': 6, + 'SHIP_FLAG_SPRITE_STACK': 7, #aircrafts misc flags 'AIRCRAFT_FLAG_2CC' : 1, 'AIRCRAFT_FLAG_AUTOREFIT': 4, 'AIRCRAFT_FLAG_NO_BREAKDOWN_SMOKE': 6, + 'AIRCRAFT_FLAG_SPRITE_STACK': 7, #for those, who can't tell the difference between a train and an aircraft: 'VEHICLE_FLAG_2CC' : 1, @@ -172,6 +176,9 @@ 'CB_RESULT_NO_SOUND' : 0x7EFF, # Never a valid sound id + # Callback results in registers + 'CB_FLAG_MORE_SPRITES' : 0x80000000, + # 1-based, not 0-based 'SOUND_EVENT_START' : 1, 'SOUND_EVENT_TUNNEL' : 2, @@ -352,6 +359,7 @@ 'CB_RESULT_IND_PROBABILITY_FROM_PROPERTY' : 0x0100, 'CB_RESULT_NO_TEXT' : 0x400, + 'CB_RESULT_IND_NO_TEXT_NO_AMOUNT' : 0x401, 'CB_RESULT_LOCATION_ALLOW' : 0x400, 'CB_RESULT_LOCATION_DISALLOW' : 0x401, @@ -717,6 +725,7 @@ 'PALETTE_TILE_RED_PULSATING' : 771, 'PALETTE_SEL_TILE_RED' : 772, 'PALETTE_SEL_TILE_BLUE' : 773, + 'PALETTE_IDENTITY' : 775, 'PALETTE_CC_FIRST' : 775, 'PALETTE_CC_DARK_BLUE' : 775, # = first 'PALETTE_CC_PALE_GREEN' : 776, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/grfstrings.py new/nml-0.4.5/nml/grfstrings.py --- old/nml-0.4.2/nml/grfstrings.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/grfstrings.py 2018-06-30 11:10:30.000000000 +0200 @@ -207,6 +207,7 @@ 'CARGO_LONG': {'unicode': r'\UE09A\1B', 'ascii': r'\9A\1B', 'size': 2 * 2}, 'CARGO_SHORT': {'unicode': r'\UE09A\1C', 'ascii': r'\9A\1C', 'size': 2 * 2}, 'CARGO_TINY': {'unicode': r'\UE09A\1D', 'ascii': r'\9A\1D', 'size': 2 * 2}, +'CARGO_NAME': {'unicode': r'\UE09A\1E', 'ascii': r'\9A\1E', 'size': 2}, # Colors 'BLUE': {'unicode': r'\UE088', 'ascii': r'\88'}, @@ -943,7 +944,7 @@ parsed_string += SET_STRING_GENDER[str_type] + '\\{:02X}'.format(self.genders[self.strings[string_id].gender]) if len(self.strings[string_id].cases) > 0: parsed_string += BEGIN_CASE_CHOICE_LIST[str_type] - for case_name, case_string in list(self.strings[string_id].cases.items()): + for case_name, case_string in sorted(self.strings[string_id].cases.items()): case_id = self.cases[case_name] parsed_string += CHOICE_LIST_ITEM[str_type] + '\\{:02X}'.format(case_id) + case_string.parse_string(str_type, self, lang_id, string.params) parsed_string += CHOICE_LIST_DEFAULT[str_type] @@ -967,7 +968,7 @@ try: value = int(lang_text, 16) except ValueError: - raise generic.ScriptError("Invalid grflangid {:r}".format(lang_text), pos) + raise generic.ScriptError("Invalid grflangid {!r}".format(lang_text), pos) if value < 0 or value >= 0x7F: raise generic.ScriptError("Invalid grflangid", pos) self.langid = value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml/spriteencoder.py new/nml-0.4.5/nml/spriteencoder.py --- old/nml-0.4.2/nml/spriteencoder.py 2015-09-12 20:46:39.000000000 +0200 +++ new/nml-0.4.5/nml/spriteencoder.py 2018-06-30 11:10:30.000000000 +0200 @@ -276,7 +276,7 @@ pos = generic.build_position(sprite_info.poslist) raise generic.ScriptError("Read beyond bounds of image file '{}'".format(filename_32bpp.value), pos) sprite = im.crop((x, y, x + size_x, y + size_y)) - rgb_sprite_data = sprite.tostring() + rgb_sprite_data = sprite.tobytes() if (info_byte & INFO_ALPHA) != 0: # Check for half-transparent pixels (not valid for ground sprites) @@ -296,7 +296,7 @@ raise generic.ScriptError("Read beyond bounds of image file '{}'".format(filename_8bpp.value), pos) mask_sprite = mask_im.crop((mask_x, mask_y, mask_x + size_x, mask_y + size_y)) - mask_sprite_data = self.palconvert(mask_sprite.tostring(), im_mask_pal) + mask_sprite_data = self.palconvert(mask_sprite.tobytes(), im_mask_pal) # Check for white pixels; those that cause "artefacts" when shading pixel_stats['white'] = sum(p == 255 for p in mask_sprite_data) @@ -321,9 +321,9 @@ sprite_data.extend(rgb_data[3*i:3*(i+1)]) sprite_data.append(mask_data[i]) elif (info_byte & INFO_RGB) != 0: - sprite_data.fromstring(rgb_sprite_data) + sprite_data.frombytes(rgb_sprite_data) else: - sprite_data.fromstring(mask_sprite_data) + sprite_data.frombytes(mask_sprite_data) bpp = get_bpp(info_byte) assert len(sprite_data) == size_x * size_y * bpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.4.2/nml.egg-info/PKG-INFO new/nml-0.4.5/nml.egg-info/PKG-INFO --- old/nml-0.4.2/nml.egg-info/PKG-INFO 2015-09-12 20:47:24.000000000 +0200 +++ new/nml-0.4.5/nml.egg-info/PKG-INFO 2018-06-30 11:11:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: nml -Version: 0.4.2 +Version: 0.4.5 Summary: A tool to compile nml files to grf or nfo files Home-page: http://dev.openttdcoop.org/projects/nml Author: NML Development Team ++++++ python-pillow-version.patch ++++++ diff --git a/nml/version_info.py b/nml/version_info.py index d7faec0..32aa3b1 100644 --- a/nml/version_info.py +++ b/nml/version_info.py @@ -71,11 +71,11 @@ def get_lib_versions(): #PIL try: from PIL import Image - versions["PIL"] = Image.VERSION + versions["PIL"] = Image.PILLOW_VERSION except ImportError: try: import Image - versions["PIL"] = Image.VERSION + versions["PIL"] = Image.PILLOW_VERSION except ImportError: versions["PIL"] = "Not found!"
