Parser for skillpopup_stat_filters.txt

Overview

Path PyPoE/poe/file/stat_filters.py
Version 1.0.0a0
Revision $Id: 8c0f2a25e79bc2ed8def2092c3857fd2b946684a $
Author Omega_K2

Description

Parser for Metadata/StatDescriptions/skillpopup_stat_filters.txt

Agreement

See PyPoE/LICENSE

Documentation

Public API

class PyPoE.poe.file.stat_filters.StatFilterFile[source]

Bases: PyPoE.poe.file.shared.AbstractFileReadOnly

Parser for Metadata/skillpopup_stat_filters.txt

Variables:
  • groups (dict[str, list[str]]) – Dictionary containing stat groups with the id as key, and the list of stats as value
  • skills (dict[str, SkillEntry]) – Dictionary mapping the active skill id (as key) to a the respective SkillEntry instance as value.
__init__

Initialize self. See help(type(self)) for accurate signature.

get_read_buffer(file_path_or_raw, function, *args, **kwargs)

Will attempt to open the given file_path_or_raw in read mode and pass the buffer to the specified function. The function must accept at least one keyword argument called ‘buffer’.

Parameters:
  • file_path_or_raw (BytesIO | bytes | str) – file path, bytes or buffer to read from
  • args – Additional positional arguments to pass to the specified function
  • kwargs – Additional keyword arguments to pass to the specified function
Returns:

Result of the function

Return type:

object

Raises:

TypeError – if file_path_or_raw has an invalid type

read(file_path_or_raw, *args, **kwargs)

Reads the file contents into the specified path or buffer. This will also reset any existing contents of the file.

If a buffer or bytes was given, the data will be read from the buffer or bytes object.

If a file path was given, the resulting data will be read from the specified file.

Parameters:
  • file_path_or_raw (BytesIO | bytes | str) – file path, bytes or buffer to read from
  • args – Additional positional arguments
  • kwargs – Additional keyword arguments
Returns:

result of the read operation, if any

Return type:

object

Raises:

TypeError – if file_path_or_raw has an invalid type

class PyPoE.poe.file.stat_filters.SkillEntry(skill_id, translation_file_path, stats)[source]

Bases: PyPoE.shared.mixins.ReprMixin

Variables:
  • skill_id (str) – Id from ActiveSkills.dat
  • translation_file_path (str) – Path to the translation file that should be used for this skill id. Path is relative to content.ggpk
  • stats (list[str]) – Order in which to display stats