Opened 2 years ago

Closed 2 years ago

#6376 closed defect (fixed)

templatesanalyzer broken

Reported by: Langbart Owned by:
Priority: If Time Permits Milestone: Alpha 26
Component: Non-game systems Keywords:
Cc: Patch: Phab:D4445

Description (last modified by Langbart)

The following python script no longer works.

  • 0ad/source/tools/templatesanalyzer/unitTables.py

The issue might be related to [25223]

paria@Paria ~/0ad % python3 /Users/paria/0ad/source/tools/templatesanalyzer/unitTables.py 
Traceback (most recent call last):
  File "/Users/paria/0ad/source/tools/templatesanalyzer/unitTables.py", line 331, in <module>
    if hasParentTemplate(template, possParent):
  File "/Users/paria/0ad/source/tools/templatesanalyzer/unitTables.py", line 78, in hasParentTemplate
    Template = ET.parse(Name)
  File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/xml/etree/ElementTree.py", line 569, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'builder|template_unit_support.xml'

Recommendations by elexis:

  • lesson that can be learnt from that, if you want to add a feature, make sure that its tested regularly, either by CI tests or by having the feature so exposed that there are many eyes on it, and maybe adding a reminder to manually test it in the release process document
  • if someone actually did make such a feature that shows the same data in the game, then that could supersede the html tool, having the thing inside the GUI would definitely make it become more maintained as more people would run it, notice and report bugs
  • or the html tool could receive a CI test

Update: 9/Jan/22

Users who have created similar projects that might be worth collaborating on.

Change History (5)

comment:1 by Silier, 2 years ago

Component: UI – In-gameNon-game systems

comment:2 by Langbart, 2 years ago

Description: modified (diff)

Update the description with links to hyiltiz's project.

comment:3 by Langbart, 2 years ago

Patch: Phab:D4445

Linking a large patch to the ticket.

comment:4 by Stan, 2 years ago

Script results are now available on http://docs.wildfiregames.com/templatesanalyzer/

In r26043 Update unitTables.py for A25 and trunk

Add support for mul_round Correct table BUGFIX: correct roster table via the mixin Civ fix avoid long lines for PEP8 compliance for mod development outside .svn repo, create symlink replace all TAB indents to 4 spaces for PEP8 TAB to 4 spaces to be PEP8 compliant refactor complex inline logic to compute and formatting beautify and avoid long lines to be PEP8 compliant beautify and simplify JS table format code Using more accessible color scheme Better color scheme main analysis file Rename the new version back to keep consistancy dependency JS library Unit analysis result Rewrite specilized table logic to only show changed Prefer numeric flag over string flag to refactor Re-format HTML templates into readable source code Civ specific table now renders non-empty Update computeCivTemplate to parse A25 template dir Cleanup debugging flags Update copyright notice to 2022 Explain how the code works for future development Initial README Refactor: put HTML IO code in a single function Refactor: include JavaScript as verbatim str Refactor: separate computation from IO Refactor: compute templates before HTML IO Refactor: compute CivTemplates before HTML IO Refactor: compute separate from IO code Fixed melee and ranged attack damage parsing Fixed Resistance parsing Implement the undefined function complain Rename Armour -> Resistance Simplify NumericStatProcess logic

Patch by: @hyiltiz

Differential Revision: https://code.wildfiregames.com/D4445

comment:5 by Stan, 2 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.