Commit graph

2674 commits

Author SHA1 Message Date
Edward Chernenko
5462d36561 wmllint: don't add description to [attack] tags within [filter_wml]
This fixes situation when wmllint tried to add description=_"fireball"
to the following WML code:

[filter]
    [filter_wml]
        [not]
            [attack]
                name=fireball
            [/attack]
        [/not]
    [/filter_wml]
[/filter]

Tags within [filter_wml] don't need to have all mandatory arguments
(like "description"), because:
1) they are temporary constructs and this description is never used,
2) such WML code expects that results will be filtered ONLY by name.
Adding description will remove results that have the same attack name
but different description.
2019-11-04 12:14:58 +01:00
Iris Morelle
84a38f773c wam: Add UI strings for core, other, and unknown add-on types
[ci skip]
2019-10-24 18:11:38 -03:00
Steve Cotton
c30c30acfc wmlxgettext: support double quotes in raw strings (fixes #4484)
This adds support for _<<map="{maps/01_First_Map.map}">>.
2019-10-19 20:37:39 +02:00
loonycyborg
d2ee0f4b73 Move appdata script to a more appropriate place 2019-10-15 16:14:32 +03:00
loonycyborg
3ed601bb91 Added tool to automatically add <release> tags to appdata 2019-10-14 21:00:38 +03:00
Elvish_Hunter
7c4e0373ac Removed dependency from obsolete psyco library 2019-10-13 21:54:38 +02:00
Elvish_Hunter
a830561dd0 Ported wmlparser to Python 3 2019-09-28 11:50:30 +02:00
Elvish_Hunter
5654b4c929 Removed broken wmlvalidator Python script 2019-09-28 10:59:45 +02:00
Severin Glöckner
f3022f69e4 wmllint: WoV is no add-on anymore
[ci skip]
2019-09-23 21:36:15 +02:00
Severin Glöckner
d87461dff9 wmllint: teach about new argument of disallow_end_turn
[ci skip]
2019-09-23 20:03:24 +02:00
Elvish_Hunter
20d1cf9a18 Fixed two bugs in wmlscope's square braces expansion
The first bug happened when there were two or more square braces in a file name: only one expansion was performed, instead of all of them being applied at once.
The second bug happened when a square brace range had leading zeros: these were just removed, resulting in false positives.
2019-09-21 14:59:04 +02:00
Elvish_Hunter
1fe32ff69d Ported wmlflip to Python 3 2019-09-20 22:01:31 +02:00
Elvish_Hunter
b896517834 Removed unused journeylifter Python tool 2019-09-19 18:05:23 +02:00
Elvish_Hunter
2863db36cc Removed the unused scoutDefault Python tool 2019-09-17 21:43:04 +02:00
Elvish_Hunter
9982afb21f Ported expand-terrain-macros to Python 3 2019-09-16 21:59:07 +02:00
Celtic Minstrel
15f431785a Add [special_note] tag in [unit_type] as a neater way of specifying special notes for the unit's description 2019-09-12 08:51:05 -04:00
Nobun
0cf8da9357 typefix 2019-09-11 14:32:16 +02:00
Nobun
e1c7c84957 wmlxgettext: fix #4275: not handle objectives.lua's turn counter 2019-09-11 14:32:16 +02:00
Martin Hrubý (hrubymar10)
6f468a3757
Migrate links to https if available
Closes #3343
2019-09-08 07:53:28 +02:00
Elvish_Hunter
853ae430ce wmllint: the correct package name for spellchecking is python3-enchant 2019-09-06 11:01:33 +02:00
Celtic Minstrel
8ce01da249 wmllint: Treat .mask files as maps 2019-09-02 12:48:01 -04:00
Celtic Minstrel
9be9dd931d wmllint: Fix some warnings detected by pylint 2019-09-02 12:47:58 -04:00
Gunter Labes
211f14176c
campaignd: Assign port 15015 to 1.15.x (#4228)
campaignd: Assign port 15015 to 1.15.x
2019-08-14 21:26:15 +02:00
Steve Cotton
d6cac0c4e7 wmllint: Handle nested events and other things with filters in the death check (closes #4085)
The main reason for moving this to a separate function was to make the
per-event variables local to that function.

(cherry picked from commit 7e69da7f68)
2019-06-13 19:26:50 +02:00
Steve Cotton
269b89f2e3 wmllint: Make a separate function for checking for units speaking in their die events
This just moves the existing code, and adds a todo for handling in a later commit.

(cherry picked from commit a3cf683348)
2019-06-13 19:26:50 +02:00
Severin Glöckner
055e793da6 wmllint: fix error in orcish leader rules
introduced in aa71482
[ci_skip]
2019-06-13 18:27:34 +02:00
Zaal Tonia
9c6dcb6a63 Use damage type and range icons
Fixes issue #3949
2019-05-14 18:13:03 +02:00
Severin Glöckner
aa714827be wmlinit rules for renaming orcish leader images
[ci skip]
2019-05-01 21:46:30 +02:00
Iris Morelle
674beb3502 website: New Year copyright update
[ci skip]
2019-03-12 23:21:20 -03:00
Allefant
0d7f227bd2 make wesnoth_addon_manager -l escape newlines 2019-03-07 13:26:12 -05:00
Allefant
f629196121 mark unit tests which require the preprocessor
(the parser is used without preprocessor for binary WML from the addon
server so the other tests still need to succeed without preprocessing)
2019-03-06 15:03:01 -05:00
Allefant
f117a41646 fix for #3965 2019-03-06 11:47:47 -05:00
Gunter Labes
ef57c0d76b
Revert "Fix parser crash in defined multi line str test" (#3959) 2019-03-01 17:09:19 +01:00
Lovens Weche
2b708d0bbe
Merge pull request #3948 from LovCAPONE/def_multi_line_str_parser_test_fix
Fix parser crash in defined multi line str test
2019-02-28 10:24:21 -05:00
Lovens Weche
3a564f7b21 Fix parser handles textdomain directives incorrectly (#3954)
The problem is that when parsing #textdomain directives, the parser
expects the directive to be at the start of the line. So if the directive
is preceded by spaces or tabs then it is treated as an attribute.

The solution is to strip all spaces and tabs on the left side of the
parsed line string when checking for #textdomain directive.

Closes #3951
2019-02-28 10:40:45 +01:00
Lovens Weche
4ab25cf039 Fix parser crash in defined multi line str test
The problem is that if we have a "#define" directive followed with an
empty line ending with a newline character then the parser presumes the
value is the newline character instead of the actual value (which is
located on a subsequent line).

The solution is that when parsing an empty line, if "self.in_string" is
False and "self.temp_key_nodes" is not None then we ignore the line
instead of parsing it with the "parse_outside_strings" function.

Closes #3947
2019-02-25 17:51:14 -05:00
elias-pschernig
a7e65de2de fix wmlunits crash (#3931)
* fix wmlunits crash
2019-02-25 10:29:42 +01:00
Lovens Weche
8322efa978 Fix parser opens tmp file 2 times then crashes
When parsing binary data in the wmlparser3 script, a temporary file is
created and opened. The problem is that the temporary file is never
closed and in subsequent functions it is reopened.

The solution is first, create a list of temporary file paths to delete at
program’s exit. In the atexit’s registered cleaning function, all the
files in this list are deleted.

Then in the function that creates the temporary file, we simply close
the file after the binary data has been written in it.

Closes #3927
2019-02-19 18:40:51 -05:00
Lovens Weche
515a3d6626
Merge pull request #3910 from LovCAPONE/bug_3862_fix_proper
Fix wmlparser3 creation unnecessary attributes.
2019-02-12 15:06:24 -05:00
Lovens Weche
c5c93b6611 Fix wmlparser3 creation unnecessary attributes
In the wml parser, when a node creation spans multiple lines, the code
doesn’t take in account that one of those line can contain a
 #textdomain directive.

In the method “parse_outside_strings” (line 501), the code that
processes the #textdomain directive is inside an if block that is true
only if the node creation doesn’t span across multiple lines
(self.temp_key_nodes is null).

The solution implemented is that in the method “parse_outside_strings”
(line 501), the code that check if a line starts with #textdomain is
moved from inside the block that is true only if the node creation
doesn’t span across multiple lines and put in the method scope after
the first if block that checks if the line is empty.
2019-02-11 11:39:42 -05:00
Lovens Weche
b3b4f97cf1 Fix wmlparser3 considers "_" part of attribute value
The wml parser, when parsing the outside of a string that is
translatable, only assumed “spaces” characters could precede it. If
there are “tabs” characters the code parses the “_” character as an
attribute value.

The solution is to add a stripping code for “tabs” characters.

Code style updated based on recommendations from ProditorMagnus.
2019-02-11 11:32:04 -05:00
Edward Chernenko
d5d23fb523 wmllint: fix "local variable 'unit_id' referenced before assignment"
In global_sanity_check(), variables "unit_id" and "base_unit" can be
used before assignment. This happens, for example, in this WML file:
https://github.com/Dugy/Legend_of_the_Invincibles/blob/master/utils/amla.cfg#L65
... where there is a [/unit_type] tag without the matching [unit_type].

(these variables are normally initialized when [unit_type] is found)
2019-01-22 11:56:37 +11:00
ProditorMagnus
ec93694389 Reformat code (other than test WML fragments) 2019-01-18 19:57:58 +11:00
ProditorMagnus
3380c186be Add __str__ and __repr__ to String/Attribute/Tag/Root Nodes, fixes #3863 2019-01-18 19:57:58 +11:00
Lovens Weche
75ca522a5b Fix addon manager crash if not finding the add-on (#3874)
* Fix addon manager crash if not finding the add-on

In the addon manager, there was no validation code for paths in the file
system for uploading addons. This fix adds validation at the parsing
level, so that the original code is left unchanged.

* Fixes for addon manager crash commit

Fixes include:

1. Spaces kept instead of tabs.
2. printf-style String Formatting is used since it seems to be compatible
with nearly all versions of Python.
3. A trailing line break was added to the formatted string.
2019-01-18 10:43:51 +11:00
josteph
8cbc3a4477 Fix markup in README.
Fixes #3864
2019-01-12 16:21:58 +00:00
josteph
e642223017 wmlxgettext: Fix crash if no *.cfg file is found
fixes #3719
[ci skip]
2018-11-14 20:14:44 +01:00
josteph
711434d571 wmlparser3: Fix [+foo] without preceding [foo] in toplevel 2018-11-12 02:53:52 +00:00
josteph
c6b2be5ca6 wmlparser3: Parse [+foo][/foo] as append to [foo]. 2018-11-08 22:57:39 +00:00
Michał Janiszewski
9d333bc95a Compare to None using identity is operator
This is a trivial change that replaces `==` operator with `is` operator, following PEP 8 guideline:

> Comparisons to singletons like None should always be done with is or is not, never the equality operators.

https://legacy.python.org/dev/peps/pep-0008/#programming-recommendations
2018-10-31 12:21:01 +11:00