Commit graph

178 commits

Author SHA1 Message Date
Gunter Labes
05b4db8ce3
Create and remove symlinks instead of moving addons back and forth 2023-11-27 20:55:35 +01:00
Gunter Labes
2ae0f67d34
Include themes dir to support add-ons using mainline theme macros 2023-11-24 21:13:24 +01:00
Ivo Julca
71ff0cfabc wmlunits: Normalize file paths consistently 2023-05-25 10:35:57 +02:00
Ivo Julca
5136c45b3e wmlunits: Correctly get Wesnoth paths in Windows 2023-05-25 10:35:57 +02:00
Slayer95
20d443bfcb
wmlunits: Refactor HTML postprocess step (#7609)
Cleaner and faster.
2023-05-18 00:21:06 +02:00
Slayer95
03ab458ce0
wmlunits: Include nested dependencies in -L for -B to process (#7603) 2023-05-07 23:57:10 +02:00
Slayer95
eded720ee2
Refactor TeamColorizer into a Python library (#7604)
* Refactor TeamColorizer into a Python library

* Use TeamColorizer as library
2023-05-07 23:54:18 +02:00
Slayer95
1ce11239ed
wmlunits: Fixup for fa76e77 (#7595)
Added missing colons to with statements
2023-05-05 23:55:40 +02:00
Slayer95
fa76e775ac
wmlunits: Handle code paths for missing attributes (#7580) 2023-05-05 18:45:12 +02:00
Gunter Labes
2b47e63e8b
wmlunits: ignore a dependency on the addon itself 2022-12-19 16:16:35 +01:00
Elvish_Hunter
f1fb3a73a8 wmlunits: used os.path.join() to build paths instead of string concatenation 2022-06-21 18:29:57 +02:00
Elvish_Hunter
b1c6029917 wmlunits: used shutil.move() instead of calling mv as a subprocess
This also means moving files in a more pythonic way and removing two functions (bash and shell) which aren't used anywhere else.
2022-06-20 23:24:47 +02:00
Elvish_Hunter
1b65d08c37 wmlunits: fixed a deprecation warning 2021-12-06 17:49:53 +01:00
Alexander Lacson
9b7a287595
Alphabetically sort import statements and add comment explaining separation of import yaml
Sorting import statements was made easier and less error-prone using [isort](https://pypi.org/project/isort/)

Make it clear that the `yaml` package is not part of Python's Standard Library and should be installed with a package manager as outlined in [this](https://pep8.org/#imports) section of PEP8.
2021-06-30 18:18:58 +02:00
Gunter Labes
6c9813af8e
Update deprecated path options 2021-06-27 11:11:19 +02:00
Gunter Labes
6e60db597d
Use __WMLUNITS__ define for all parse calls
Enables workarounds for wmlunits in core unit files.
2020-08-16 22:43:14 +02:00
Ignacio R. Morelle
5985754786 wmlunits: Allow detecting wmlunits with the __WMLUNITS__ preprocessor symbol
This is an experimental attempt at enabling add-ons to either
voluntarily decrease unit tree bloat by defining a single campaign for
wmlunits (for multi-campaign add-ons), or disable unit tree generation
altogether by emiting an #error early.
2017-08-15 16:20:46 -03:00
Ignacio R. Morelle
5a675ec25d wmlunits: Psyco is a defunct project and it never supported Python 3 2017-08-15 16:02:55 -03:00
Ignacio R. Morelle
abc0eb5d16 wmlunits: Get menu.js from the execution path, not the Wesnoth data dir
Otherwise we end-up with an obsolete version of menu.js from 1.12 when
reading 1.12 data.
2017-08-14 14:42:17 -03:00
Ignacio R. Morelle
a4172bddc1 wmlunits: Fix issue where the process name becomes "w" instead of "wmlunits"
The basic string type in Python 3 is equivalent to a wchar_t array,
which means that the second byte of every ASCII string is always zero,
causing the string to appear truncated after the first character when
calling C library functions that expect a single or multibyte encoding
(e.g. UTF-8). Just using a byte array does the trick to get a proper
single-byte ASCII string.
2017-08-14 13:59:09 -03:00
Ignacio R. Morelle
5bcaaaf9f7 wmlunits: style.css is not used anymore 2017-08-12 02:24:43 -04:00
Ignacio R. Morelle
9db2ed630c wmlunits: More code clean-up 2017-08-12 02:24:07 -04:00
Ignacio R. Morelle
8bf57d6fe0 wmlunits: Wire in Wesmere header and trailer 2017-08-06 14:10:48 -04:00
Allefant
c17d556016 [units.wesnoth.org] fix eras with all eras in an addon 2017-06-25 21:38:20 -04:00
Elias Pschernig
b0f15a08c4 units.wesnoth.org update to understand new [difficulty] tag 2017-06-09 19:25:30 -04:00
Allefant
9f3ed8df4c [wmlunits] apply zookeeper's suggested eras.cfg fix 2017-03-24 13:13:59 -04:00
Allefant
421f8ff70a [wmlunits] fix inclusion of mainline eras 2017-01-24 23:51:21 -05:00
aquileia
809e61db88 Python scripts: Unify encoding magic comments 2016-05-03 22:12:19 +02:00
Elias Pschernig
1279214968 [wmlparser3] use less recursion when parsing
specifically, avoid recursion for every double double-quite (i.e. the
escaping of " as "")
2016-03-11 17:12:36 -05:00
Elias Pschernig
4c034d7705 Clean up wmlparser3.py a bit, fix json and xml output. 2015-09-20 14:53:49 -04:00
Elias Pschernig
f8fb04093a [units.wesnoth.org] fix some small issues 2015-09-10 18:10:16 -04:00
Elias Pschernig
3ab3db3166 [units.wesnoth.org] Converted the script to Python 3.
Basically ran all .py files through 2to3. I made a copy of wmlparser2.py
called wmlparser3.py for the Python3 version, so as to not inconvenience anyone
who may be using it in their old Python2 scripts.
2015-09-09 22:52:23 -04:00
Elias Pschernig
2cdcae6294 [wmlunits] fix typo 2015-09-08 21:19:42 -04:00
Elias Pschernig
225234b121 [wmlunits: log used memory for pre-pass] 2015-09-08 20:56:14 -04:00
Elias Pschernig
310f8092ad [units.wesnoth.org] update bash script 2015-03-28 16:09:01 +01:00
Elias Pschernig
ee047e7ce9 [units.wesnoth.org] Make WML parsing timeout a commandline argument. 2015-03-22 21:38:39 +01:00
Elias Pschernig
4872b1d91b [units.wesnoth.org] Reduced timeout again to avoid out of memory. 2015-03-22 00:56:38 +01:00
Elias Pschernig
2d19275f6f [units.wesnoth.org] Increase addon parsing timeout to 60 seconds. 2015-03-21 17:24:28 +01:00
Allefant
a425c951c2 [wmlunits] show vision and jamming for a unit
(if available)
2014-02-02 13:35:56 +01:00
Allefant
c182e93441 [wmlunits] fix debug message
(time to move this to Python3...)
2014-01-28 16:18:48 +01:00
Allefant
62ddbd2f81 [wmlunits] add some debug info 2014-01-27 23:10:34 +01:00
Allefant
91800c34c8 [wmlunits] for campaigns, define a difficulty
The first preprocessor symbol listed in a campaigns difficulties=...
attribute is now set when parsing WML looking for unit definitions.
2014-01-27 16:57:16 +01:00
Allefant
a83ae0ab08 [wmlunits] Filter out eras from dependencies 2014-01-21 02:07:23 +01:00
Allefant
754229ff22 [wmlunit] fix help 2014-01-19 21:34:26 +01:00
Allefant
7a653b1c12 [wmlunits] Also take dependencies into account for second pass. 2014-01-19 21:34:26 +01:00
Allefant
db98a2af1c [wmlunits] Don't store translations which are the same. 2014-01-19 21:34:26 +01:00
Allefant
e8b930260f [wmlunits] simplified dependencies 2014-01-18 16:39:36 +01:00
Allefant
0c4cd5a337 [wmlunits] implemented dependencies support 2014-01-17 18:13:45 +01:00
Allefant
e9430a02d1 [wmlunits] increase timeout for parsing user addons 2014-01-17 10:58:38 +01:00
Allefant
dc4670b897 [wmlunits] Don't abort un uncaught exceptions.
Instead keep going to the next addon during pre-parsing of user addons.
2014-01-16 17:45:46 +01:00