Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several functions in example.py return errors with null value. #3

Closed
kwangsing3 opened this issue Apr 6, 2021 · 1 comment
Closed

Comments

@kwangsing3
Copy link

kwangsing3 commented Apr 6, 2021

Platform: Win10

IDE: Visual Code
POB: Community-Portable-1.4.170.26 (released at 9th Feb,2021)
Python: 3.9.4

Issues:
Example functions trigger fatal errors.

Here's order in example.py :

  • get_builds_dir()--------(√)
  • load_build(rf'{builds_path}\AnalysisBuilder.xml')--------(√)
  • get_build_info()--------(√)
  • update_build()--------(√)
  • pob.fetch('build.spec.curAscendClassName')--------(√)
  • mod = "10% increased Intelligence"--------(√)
  • print('\nTesting single mod effects:', mod)--------(√)
  • pprint(pob.test_mod_effect(mod)) --------(×)
  • Path('test-item1.html').write_text(pob.test_item_as_html(TEST_ITEM_1)) --------(×)

Screen shot:
screenshot

looks like "modlist" is a nil value

Full output:

POB Builds: C:\Users\kwang\Desktop\PathOfBuildingCommunity-Portable-1.4.170.26/Builds/

Loading build:
{'buildName': 'PathOfBuildingCommunity-Portable-1.4.170.26/Builds/\\AnalysisBuilder',
 'char': {'ascendClassName': 'Chieftain',          'className': 'Marauder',       
          'level': 100},
 'file': {'path': 'C:\\Users\\kwang\\Desktop\\PathOfBuildingCommunity-Portable-1.4.170.26/Builds/\\AnalysisBuilder.xml',   
          'subpath': ''},
 'skill': {'group': 'Vaal Ancestral Warchief', 'name': 'Ancestral Warchief'}}     

Updating build:
Lua: Skill group/gem/part: Vaal Ancestral Warchief / Ancestral Warchief / -       
Lua: Pre-update checks...

Fetch data directly from Lua:
  build.spec.curAscendClassName = 'Chieftain'

Testing single mod effects: 10% increased Intelligence
Lua: Testing mod: 10% increased Intelligence
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 
197, in _run_module_as_main
    return _run_code(code, main_globals, 
None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 
87, in _run_code
    exec(code, run_globals)
  File "c:\Users\kwang\.vscode\extensions\ms-python.python-2021.3.680753044\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
    cli.main()
  File "c:\Users\kwang\.vscode\extensions\ms-python.python-2021.3.680753044\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
    run()
  File "c:\Users\kwang\.vscode\extensions\ms-python.python-2021.3.680753044\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 
268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 
97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 
87, in _run_code
    exec(code, run_globals)
  File "c:\Users\kwang\Desktop\pob_wrapper\example.py", line 62, in <module>      
    pob = run()
  File "c:\Users\kwang\Desktop\pob_wrapper\example.py", line 51, in run
    pprint(pob.test_mod_effect(mod))     
  File "c:\Users\kwang\Desktop\pob_wrapper\pob_wrapper\pob.py", line 139, in test_mod_effect
    result = self._send(f'findModEffect("{mod_line}")')
  File "c:\Users\kwang\Desktop\pob_wrapper\pob_wrapper\pob.py", line 161, in _send    raise ExternalError(result)
pob_wrapper.pob.ExternalError

if you need more info, plz let me know :)

@coldino coldino closed this as completed in 9e7102f Apr 6, 2021
@coldino
Copy link
Owner

coldino commented Apr 6, 2021

Thanks for this.

The mod effect testing issue was due to a change made in PoB fork 1.4.170.17 that I forgot to migrate from PoB Item Tester.

The item testing method was completely left out after the last major code reshuffle! Whoops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants