Page MenuHomeWildfire Games

tools/entity/checkref perl to python
AbandonedPublic

Authored by cyrille on Jun 30 2020, 9:50 PM.

Details

Reviewers
Stan
Summary

Conversion of the perl script to python (3.6+).

Entity.pm cannot be removed until all other scripts that depends on it are converted too.

Test Plan

Verify that the script acts the same as the perl script, with different options.

One should create inconsistent data to check this as the scripts checks for these.

Event Timeline

cyrille created this revision.Jun 30 2020, 9:50 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2556/display/redirect

Stan added a comment.Jul 5 2020, 11:10 PM

When running the script on SVN I get

Traceback (most recent call last):
  File "checkrefs.py", line 573, in <module>
    CheckRefs().main()
  File "checkrefs.py", line 144, in main
    self.add_gui_xml()
  File "checkrefs.py", line 450, in add_gui_xml
    raise ValueError(f"Unexpected GUI XML root element '{name}':\n{bio.read().decode('ascii')}")
ValueError: Unexpected GUI XML root element 'page':
<page>
</page>
source/tools/entity/checkrefs.py
59

Apparently we also support mul_round can you add it? (it's mul + rounding)

cyrille updated this revision to Diff 12579.Jul 7 2020, 6:56 PM

All perl scripts are converted now. some adjustments on XML parsing too.

Vulcan added a comment.Jul 7 2020, 7:05 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2596/display/redirect

Stan added inline comments.Jul 8 2020, 9:12 AM
source/tools/entity/checkrefs.py
170

Missing

if entity.find('Identity') is not None and entity.find('Identity').find('Phenotype') is not None:
352

Still get:

Traceback (most recent call last):
  File "checkrefs.py", line 476, in <module>
    CheckRefs().main()
  File "checkrefs.py", line 59, in main
    self.add_gui_xml()
  File "checkrefs.py", line 353, in add_gui_xml
    raise ValueError(f"Unexpected GUI XML root element '{name}':\n{bio.read().decode('ascii')}")
ValueError: Unexpected GUI XML root element 'page':
<page>
</page>

It could also print the filename :)

source/tools/entity/scriptlib/__init__.py
55

Apparently we also support mul_round can you add it? (it's mul + rounding)

elif op == 'mul_round ':
    base_tag.text = str(round(op1 * op2))
Stan requested changes to this revision.Jul 8 2020, 9:13 AM
This revision now requires changes to proceed.Jul 8 2020, 9:13 AM
Stan added a comment.EditedAug 3 2020, 12:19 PM

Any news? Btw you got disconnected from the IRC channel (NetSplit)

Stan added inline comments.Nov 20 2020, 9:22 AM
source/tools/entity/checkrefs.py
311

Refs D3123 in case the check assumes the file is at the root.

bb abandoned this revision.Tue, Dec 22, 11:32 PM
bb added a subscriber: bb.

Superseeded by D3213