instruction stringclasses 100
values | code stringlengths 78 193k | response stringlengths 259 170k | file stringlengths 59 203 |
|---|---|---|---|
Create docstrings for reusable components | # Copyright 2019-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-instance-attributes,too-few-public-methods
from __future__ import annotations
import typing
from ..converter_object import ConverterObjectContainer
if typing.TYPE_CHECKING:
from openage.convert.entity_object.c... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-instance-attributes,too-few-public-methods
+"""
+Object for comparing and passing around data from a dataset.
+"""
from __future__ import annotations
import typing
@@ -37,6 +40,10 @@
class GenieObjectContainer(ConverterObjectContainer):
+ """
+ Conta... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_object_container.py |
Write documentation strings for class attributes | # Copyright 2019-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..converter_object import ConverterObject
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieObjectContainer
from... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2019-2022 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for sounds from AoC.
+"""
from __future__ import annotations
import typing
@@ -12,6 +15,9 @@
class GenieSound(ConverterObject):
+ """
+ Sound definition from a... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_sound.py |
Can you add docstrings to this Python file? | # Copyright 2014-2023 the openage authors. See copying.md for legal info.
from datetime import date
import re
from subprocess import Popen, PIPE
from .util import findfiles, readfile, writefile, has_ext, SHEBANG
OPENAGE_AUTHORS = (
"Copyright (?P<crstart>\\d{4})-(?P<crend>\\d{4}) the openage authors\\."
)
OPEN... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2014-2023 the openage authors. See copying.md for legal info.
+"""
+Checks the legal headers of all files.
+"""
from datetime import date
import re
@@ -55,6 +58,7 @@
def get_git_change_year(filename):
+ """ Returns git-log's opinion on when the file was last changed. """... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/buildsystem/codecompliance/legal.py |
Generate docstrings with parameter types | # Copyright 2019-2024 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..converter_object import ConverterObject, ConverterObjectGroup
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieOb... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2019-2024 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for terrain from AoC.
+"""
from __future__ import annotations
import typing
@@ -12,6 +15,9 @@
class GenieTerrainObject(ConverterObject):
+ """
+ Terrain defini... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_terrain.py |
Improve documentation using docstrings | # Copyright 2015-2019 the openage authors. See copying.md for legal info.
import re
from .util import findfiles, readfile, has_ext, issue_str_line, BADUTF8FILES
TRAIL_WHITESPACE_RE = re.compile((
# trailing whitespace
r"( |\t)+\n"
))
IMMEDIATE_TODO_RE = re.compile(
"as" + "df",
re.IGNORECASE # pyl... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2015-2019 the openage authors. See copying.md for legal info.
+"""
+Checks some general whitespace rules and the encoding for text files.
+"""
import re
@@ -17,6 +20,9 @@
def find_issues(dirnames, exts):
+ """
+ Checks all files ending in exts in dirnames.
+ """
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/buildsystem/codecompliance/textfiles.py |
Document this code for team use | # Copyright 2015-2023 the openage authors. See copying.md for legal info.
from pylint import lint
from .pystyle import filter_file_list
from .util import findfiles
def find_pyx_modules(dirnames):
for pyx_file in findfiles(dirnames, [".pyx"]):
yield pyx_file.replace('/', '.')[:-len(".pyx")]
def find_i... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2015-2023 the openage authors. See copying.md for legal info.
+"""
+Checks the Python modules with pylint.
+"""
from pylint import lint
@@ -8,11 +11,13 @@
def find_pyx_modules(dirnames):
+ """ Yields the names of all .pyx modules. """
for pyx_file in findfiles(dirn... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/buildsystem/codecompliance/pylint.py |
Add docstrings following best practices | # Copyright 2019-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..converter_object import ConverterObject
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieObjectContainer
from... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2019-2022 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for graphics from AoC.
+"""
from __future__ import annotations
import typing
@@ -12,6 +15,9 @@
class GenieGraphic(ConverterObject):
+ """
+ Graphic definition ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_graphic.py |
Add docstrings to improve code quality | # Copyright 2014-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
import os
from pathlib import Path
from .util.fslike.directory import Directory
from .util.fslike.union import Union
from .util.fslike.wrapper import WriteBlocker
from . import config
from . i... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2014-2023 the openage authors. See copying.md for legal info.
+"""
+Code for locating the game assets.
+"""
from __future__ import annotations
@@ -19,6 +22,16 @@
def get_asset_path(custom_asset_dir: str = None) -> UnionPath:
+ """
+ Returns a Path object for the game... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/assets.py |
Add missing documentation to my Python functions | # Copyright 2024-2025 the openage authors. See copying.md for legal info.
import re
import gdb # type: ignore
import gdb.printing # type: ignore
# TODO: Printers should inherit from gdb.ValuePrinter when gdb 14.1 is available in all distros.
class PrinterControl(gdb.printing.PrettyPrinter):
def __init__(sel... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2024-2025 the openage authors. See copying.md for legal info.
+"""
+Pretty printers for GDB.
+"""
import re
import gdb # type: ignore
@@ -9,6 +12,13 @@
class PrinterControl(gdb.printing.PrettyPrinter):
+ """
+ Exposes a pretty printer for a specific type.
+
+ Prin... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/etc/gdb_pretty/printers.py |
Improve documentation using docstrings | # Copyright 2014-2022 the openage authors. See copying.md for legal info.
# TODO pylint: disable=C,too-many-function-args
from __future__ import annotations
import typing
from collections import defaultdict
from ...value_object.read.genie_structure import GenieStructure
if typing.TYPE_CHECKING:
from openage.co... | --- +++ @@ -20,18 +20,27 @@ self.strings = defaultdict(lambda: {})
def fill_from(self, stringtable: dict[str, dict[str, str]]) -> None:
+ """
+ stringtable is a dict {langcode: {id: string}}
+ """
for lang, langstrings in stringtable.items():
self.strings[lang].... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/stringresource.py |
Create documentation for each function signature | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..aoc.genie_unit import GenieUnitLineGroup, GenieBuildingLineGroup, \
GenieAmbientGroup, GenieVariantGroup, GenieUnitTaskGroup, \
GenieVillagerGroup, GenieGarrisonMode
if typing.TYP... | --- +++ @@ -1,5 +1,10 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for game entities from RoR.
+
+Based on the classes from the AoC converter.
+"""
from __future__ import annotations
import typing
@@ -13,6 +18,13 @@
class RoRUnitLi... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/ror/genie_unit.py |
Write docstrings describing functionality | # Copyright 2019-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from .....nyan.nyan_structs import NyanObject
from .....util.ordered_set import OrderedSet
from ..data_definition import DataDefinition
if typing.TYPE_CHECKING:
from openage.nyan.import_tree... | --- +++ @@ -1,5 +1,9 @@ # Copyright 2019-2023 the openage authors. See copying.md for legal info.
+"""
+Nyan file struct that stores a bunch of objects and
+manages imports.
+"""
from __future__ import annotations
import typing
@@ -15,6 +19,10 @@
class NyanFile(DataDefinition):
+ """
+ Groups nyan objec... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/nyan_file.py |
Add docstrings that explain logic | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments
from __future__ import annotations
import typing
import toml
from ..data_definition import DataDefinition
FILE_VERSION = "1.0"
if typing.TYPE_CHECKING:
from openage.convert.value_object.read.media_t... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-arguments
+"""
+Create a media cache file for a game version.
+"""
from __future__ import annotations
import typing
@@ -17,6 +20,9 @@
class MediaCacheFile(DataDefinition):
+ """
+ Used for creating a media cache file.
+ """
def __init__(sel... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/media_cache.py |
Add docstrings to incomplete code | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-instance-attributes,too-many-arguments
import toml
from ..data_definition import DataDefinition
FILE_VERSION = "2"
class ModpackInfo(DataDefinition):
def __init__(self, targetdir: str, filename: str):
... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-instance-attributes,too-many-arguments
+"""
+Modpack definition file.
+"""
import toml
from ..data_definition import DataDefinition
@@ -11,6 +14,10 @@
class ModpackInfo(DataDefinition):
+ """
+ Represents the header file of the modpack. Contains info... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/modpack_info.py |
Create documentation for each function signature | # Copyright 2019-2023 the openage authors. See copying.md for legal info.
# pylint: disable=too-many-instance-attributes,too-many-branches,too-few-public-methods
from __future__ import annotations
import typing
from openage.convert.value_object.read.dynamic_loader import DynamicLoader
from ....nyan.nyan_structs i... | --- +++ @@ -2,6 +2,11 @@
# pylint: disable=too-many-instance-attributes,too-many-branches,too-few-public-methods
+"""
+Objects that represent data structures in the original game.
+
+These are simple containers that can be processed by the converter.
+"""
from __future__ import annotations
@@ -18,6 +23,9 @@
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/converter_object.py |
Please document this code using docstrings | # Copyright 2015-2024 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from bisect import bisect
from calendar import timegm
from collections import OrderedDict
from typing import Generator, NoReturn, Union
from ..log import dbg
from ..util.filelike.readonly import... | --- +++ @@ -1,5 +1,11 @@ # Copyright 2015-2024 the openage authors. See copying.md for legal info.
+"""
+Provides CABFile, an extractor for the MSCAB format.
+
+Struct definitions are according to the documentation at
+https://msdn.microsoft.com/en-us/library/bb417343.aspx.
+"""
from __future__ import annotations
i... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/cabextract/cab.py |
Add missing documentation to my Python functions | # Copyright 2014-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
class DataDefinition:
def __init__(self, targetdir: str, filename: str):
self.targetdir = targetdir
self.filename = filename
def dump(self) -> typing.NoReturn:
... | --- +++ @@ -1,30 +1,60 @@ # Copyright 2014-2022 the openage authors. See copying.md for legal info.
+"""
+Output format specification for data to write.
+"""
from __future__ import annotations
import typing
class DataDefinition:
+ """
+ Contains a data definition that can then be
+ formatted to an a... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/data_definition.py |
Add docstrings with type hints explained | # Copyright 2017-2020 the openage authors. See copying.md for legal info.
import argparse
import importlib
import importlib.abc
import importlib.util
import os
import shutil
import sys
def copy_module(name, destination):
loader = importlib.util.find_spec(name).loader
if not isinstance(loader, importlib.abc.... | --- +++ @@ -1,5 +1,9 @@ # Copyright 2017-2020 the openage authors. See copying.md for legal info.
+"""
+Copies the specified modules to the required directory.
+Used for packaging the python dependencies.
+"""
import argparse
import importlib
@@ -11,6 +15,7 @@
def copy_module(name, destination):
+ """Copy ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/buildsystem/scripts/copy_modules.py |
Add docstrings explaining edge cases | # Copyright 2015-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-branches
from __future__ import annotations
from datetime import datetime
import typing
from ..log import info, warn
from ..util.fslike.directory import CaseIgnoringDirectory
from ..util.fslike.wrapper import (Dire... | --- +++ @@ -1,6 +1,9 @@ # Copyright 2015-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-branches
+"""
+Entry point for all of the asset conversion.
+"""
from __future__ import annotations
from datetime import datetime
@@ -33,6 +36,17 @@ args: Namespace,
srcdir: Dire... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/main.py |
Improve documentation using docstrings | # Copyright 2015-2023 the openage authors. See copying.md for legal info.
import argparse
import os
from pathlib import Path
import re
import sys
from pygments.token import Token
from pygments.lexers import get_lexer_for_filename
CWD = os.getcwd()
class ParserError(Exception):
def __init__(self, filename, l... | --- +++ @@ -1,5 +1,10 @@ # Copyright 2015-2023 the openage authors. See copying.md for legal info.
+"""
+Auto-generates PXD files from annotated C++ headers.
+
+Invoked via cmake during the regular build process.
+"""
import argparse
import os
@@ -15,12 +20,23 @@
class ParserError(Exception):
+ """
+ Re... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/buildsystem/pxdgen.py |
Document functions with detailed explanations | # Copyright 2019-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..converter_object import ConverterObject
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieObjectContainer
fr... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2019-2022 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for connections from AoC.
+"""
from __future__ import annotations
import typing
@@ -14,6 +17,9 @@
class GenieAgeConnection(ConverterObject):
+ """
+ A relation... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_connection.py |
Add concise docstrings to each method | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
import toml
from ..data_definition import DataDefinition
class ManifestFile(DataDefinition):
def __init__(self, targetdir: str, filename: str):
super().__init__(targetdir, filename)
self.hash_values: list[tuple[str, str... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+Create a manifest file for a modpack
+"""
import toml
@@ -7,6 +10,9 @@
class ManifestFile(DataDefinition):
+ """
+ Used for creating a manifest file for a modpack.
+ """
def __init__(self, ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/modpack_manifest.py |
Provide docstrings following PEP 257 | # Copyright 2019-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..converter_object import ConverterObject
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieObjectContainer
fro... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2019-2022 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for effects from AoC.
+"""
from __future__ import annotations
import typing
@@ -13,6 +16,9 @@
class GenieEffectObject(ConverterObject):
+ """
+ Single effect c... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/aoc/genie_effect.py |
Write clean docstrings for readability | # Copyright 2021-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..data_definition import DataDefinition
FORMAT_VERSION = '1'
class BlendtableMetadata(DataDefinition):
def __init__(self, targetdir: str, filename: str):
super().__init__(tar... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2021-2023 the openage authors. See copying.md for legal info.
+"""
+Blendtable definition file.
+"""
from __future__ import annotations
import typing
@@ -9,6 +12,10 @@
class BlendtableMetadata(DataDefinition):
+ """
+ Collects blentable metadata and can format it
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/bltable_metadata.py |
Add docstrings that explain purpose and usage | # Copyright 2014-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
import os
import sys
from .codegen import CodegenMode, codegen
if typing.TYPE_CHECKING:
from argparse import ArgumentParser
def init_subparser(cli: ArgumentParser):
cli.set_defaults(... | --- +++ @@ -1,5 +1,51 @@ # Copyright 2014-2022 the openage authors. See copying.md for legal info.
+"""
+Codegen interface to the build system.
+
+See buildsystem/codegen.cmake.
+
+Generates c++ code within the source tree.
+Designed to be used by [buildsystem/codegen.cmake].
+
+All file and directory names should be... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/codegen/main.py |
Add missing documentation to my Python functions | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.converter_object import ConverterObjectContainer
from openage.convert.entity_object.conversion.converter_object i... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+References a sound in the game that has to be converted.
+"""
from __future__ import annotations
@@ -12,6 +15,9 @@
class CombinedSound:
+ """
+ Collection of sound information for openage files.
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/combined_sound.py |
Write docstrings for backend logic | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-locals,too-many-branches,too-many-statements,no-else-return
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberSpecialValue
from ....entity_object.conversion.aoc... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=line-too-long,too-many-locals,too-many-branches,too-many-statements,no-else-return
+"""
+Derives complex auxiliary objects from unit lines, techs
+or other objects.
+"""
from __future__ import annotations
import typing
@@ -20,9 +24,18 @@
class AoCAuxiliarySubproce... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/auxiliary_subprocessor.py |
Add docstrings to improve code quality | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments
from __future__ import annotations
import typing
from ..data_definition import DataDefinition
FORMAT_VERSION = '1'
class BlendmaskMetadata(DataDefinition):
def __init__(self, targetdir: str, filena... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-arguments
+"""
+Blendmask definition file.
+"""
from __future__ import annotations
import typing
@@ -11,6 +14,10 @@
class BlendmaskMetadata(DataDefinition):
+ """
+ Collects blendmask metadata and can format it
+ as a .blmask custom format
+ ""... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/blmask_metadata.py |
Create simple docstrings for beginners | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.converter_object import ConverterObjectContainer
from openage.convert.entity_object.conversion.converter_object i... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+References a graphic in the game that has to be converted.
+"""
from __future__ import annotations
@@ -13,6 +16,11 @@
class CombinedTerrain:
+ """
+ Collection of terrain information for openage file... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/combined_terrain.py |
Add standardized docstrings across the file | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.converter_object import ConverterObjectContainer
from openage.convert.entity_object.conversion.converter_object i... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+References a graphic in the game that has to be converted.
+"""
from __future__ import annotations
@@ -13,6 +16,11 @@
class CombinedSprite:
+ """
+ Collection of sprite information for openage files.... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/combined_sprite.py |
Add missing documentation to my Python functions | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
from ..aoc.genie_sound import GenieSound
class RoRSound(GenieSound):
def get_sounds(self, civ_id: int = -1) -> list[int]:
sound_ids = []
sound_items = self["sound_items"].value
... | --- +++ @@ -1,5 +1,10 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for sounds from RoR.
+
+Based on the classes from the AoC converter.
+"""
from __future__ import annotations
@@ -7,8 +12,16 @@
class RoRSound(GenieSound):
+ """... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/ror/genie_sound.py |
Help me write clear docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..aoc.genie_tech import StatUpgrade, AgeUpgrade, UnitLineUpgrade, \
BuildingLineUpgrade, UnitUnlock, BuildingUnlock
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conve... | --- +++ @@ -1,5 +1,10 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Contains structures and API-like objects for techs from RoR.
+
+Based on the classes from the AoC converter.
+"""
from __future__ import annotations
import typing
@@ -11,6 +16,9 @@
class RoRStatUpgrade(Sta... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/ror/genie_tech.py |
Write proper docstrings for these functions | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches,too-few-public-methods,too-many-statements
from __future__ import annotations
import typing
from .....nyan.import_tree import ImportTree
from ....entity_object.conversion.modpack import Mod... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-many-locals,too-many-branches,too-few-public-methods,too-many-statements
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -18,15 +22,24 @@
class AoCModpackSubprocessor:
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/modpack_subprocessor.py |
Add professional docstrings to my codebase | # Copyright 2019-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments
from __future__ import annotations
import typing
from enum import Enum
from ..data_definition import DataDefinition
FORMAT_VERSION = '2'
class LayerMode(Enum):
OFF = 'off' # layer is not animat... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-arguments
+"""
+Sprite definition file.
+"""
from __future__ import annotations
import typing
@@ -13,12 +16,19 @@
class LayerMode(Enum):
+ """
+ Possible values for the mode of a layer.
+ """
OFF = 'off' # layer is not animated
ONCE ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/sprite_metadata.py |
Create docstrings for each class method | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..aoc.genie_tech import UnitUnlock, UnitLineUpgrade
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion.aoc.genie_object_container\
import GenieObjectContaine... | --- +++ @@ -1,5 +1,9 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+SWGB tech objects. These extend the normal Genie techs to reflect
+that SWGB techs can have unique variants for every civilization.
+"""
from __future__ import annotations
import typing
@@ -11,6 +15,9 @@
cl... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/swgbcc/genie_tech.py |
Write docstrings describing each step | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
from ..export.data_definition import DataDefinition
from ..export.formats.modpack_info import ModpackInfo
from ..export.formats.modpack_manifest import ManifestFile
from ..export.media_export_request import M... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Defines a modpack that can be exported.
+"""
from __future__ import annotations
@@ -11,6 +14,9 @@
class Modpack:
+ """
+ A collection of data and media files.
+ """
def __init__(self, name:... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/modpack.py |
Document this code for team use | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ..aoc.genie_unit import GenieUnitLineGroup, GenieUnitTransformGroup, \
GenieMonkGroup, GenieStackBuildingGroup
if typing.TYPE_CHECKING:
from openage.convert.entity_object.conversion... | --- +++ @@ -1,5 +1,9 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Converter objects for SWGB. Reimplements the ConverterObjectGroup
+instances from AoC.
+"""
from __future__ import annotations
import typing
@@ -12,6 +16,16 @@
class SWGBUnitLineGroup(GenieUnitLineGroup):
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/conversion/swgbcc/genie_unit.py |
Generate documentation strings for clarity | # Copyright 2021-2021 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments
from enum import Enum
from ..data_definition import DataDefinition
FORMAT_VERSION = '1'
class LayerMode(Enum):
OFF = 'off' # layer is not animated
ONCE = 'once' # animation plays once
... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-arguments
+"""
+Texture definition file.
+"""
from enum import Enum
@@ -11,12 +14,19 @@
class LayerMode(Enum):
+ """
+ Possible values for the mode of a layer.
+ """
OFF = 'off' # layer is not animated
ONCE = 'once' # animation pl... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/texture_metadata.py |
Write docstrings for this repository | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments,too-many-locals
from __future__ import annotations
import typing
from ....util.observer import Observer
from .formats.sprite_metadata import SpriteMetadata
from .formats.texture_metadata import TextureMeta... | --- +++ @@ -1,6 +1,9 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments,too-many-locals
+"""
+Export requests for media metadata.
+"""
from __future__ import annotations
import typing
@@ -19,6 +22,10 @@
class MetadataExport(Observer):
+ """
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/metadata_export.py |
Write documentation strings for class attributes | # Copyright 2021-2024 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from .....log import info
from ....entity_object.conversion.aoc.genie_graphic import GenieGraphic
from ....entity_object.conversion.aoc.genie_object_container import GenieObjectContainer
from ..... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2021-2024 the openage authors. See copying.md for legal info.
+"""
+Convert data from DE1 to openage formats.
+"""
from __future__ import annotations
import typing
@@ -26,6 +29,9 @@
class DE1Processor:
+ """
+ Main processor for converting data from DE1.
+ """
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de1/processor.py |
Add documentation for all methods | # Copyright 2019-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-branches,too-many-statements
# pylint: disable=too-many-locals,too-many-public-methods
from __future__ import annotations
import typing
from .....log import info
from ....entity_object.conversion.aoc.... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-lines,too-many-branches,too-many-statements
# pylint: disable=too-many-locals,too-many-public-methods
+"""
+Convert data from AoC to openage formats.
+"""
from __future__ import annotations
import typing
@@ -53,6 +56,9 @@
class AoCProcessor:
+ """
+ M... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/processor.py |
Include argument descriptions in docstrings | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conversion.aoc.genie_unit import GenieBuildingLi... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
+"""
+Creates patches and modifiers for civs.
+"""
from __future__ import annotations
import typing
@@ -19,9 +22,16 @@
class AoCCivSubprocessor:
+ """
+ Creates raw API objects for civs in AoC.
+ """
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/civ_subprocessor.py |
Document this module using docstrings | # Copyright 2014-2024 the openage authors. See copying.md for legal info.
# TODO pylint: disable=C,R
from __future__ import annotations
import typing
from PIL import Image
import numpy
from ....log import spam
from ...value_object.read.media.blendomatic import BlendingMode
from ...value_object.read.media.hardcode... | --- +++ @@ -1,5 +1,6 @@ # Copyright 2014-2024 the openage authors. See copying.md for legal info.
+""" Routines for texture generation etc """
# TODO pylint: disable=C,R
@@ -24,6 +25,9 @@
class TextureImage:
+ """
+ represents a image created from a (r,g,b,a) matrix.
+ """
def __init__(
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/texture.py |
Create docstrings for each class method | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,arguments-differ
from __future__ import annotations
import typing
from ....util.observer import Observable
if typing.TYPE_CHECKING:
from openage.convert.value_object.read.media_types import MediaType
cl... | --- +++ @@ -1,6 +1,10 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,arguments-differ
+"""
+Specifies a request for a media resource that should be
+converted and exported into a modpack.
+"""
from __future__ import annotations
import typing
@@ -11... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/media_export_request.py |
Generate helpful docstrings for debugging | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
from ..data_definition import DataDefinition
FORMAT_VERSION = '1'
class PaletteMetadata(DataDefinition):
def __init__(self, targetdir: str, filename: str):
super().__init__(targetdir, filename)
self.colours: list[tuple]... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2021-2022 the openage authors. See copying.md for legal info.
+"""
+Palette definition file.
+"""
from ..data_definition import DataDefinition
@@ -7,6 +10,10 @@
class PaletteMetadata(DataDefinition):
+ """
+ Collects palette metadata and can format it
+ as a .opal... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/palette_metadata.py |
Document this script properly | # Copyright 2019-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-arguments
from __future__ import annotations
import typing
from enum import Enum
from ..data_definition import DataDefinition
FORMAT_VERSION = '2'
class LayerMode(Enum):
OFF = 'off' # layer is not anima... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-arguments
+"""
+Terrain definition file.
+"""
from __future__ import annotations
import typing
@@ -14,11 +17,18 @@
class LayerMode(Enum):
+ """
+ Possible values for the mode of a layer.
+ """
OFF = 'off' # layer is not animated
LOOP... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/entity_object/export/formats/terrain_metadata.py |
Add return value explanations in docstrings | # Copyright 2021-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements
from __future__ import annotations
import typing
from ....entity_object.export.formats.sprite_metadata import LayerMode as SpriteLayerMode
from ....entity_object.export.formats.terrain_met... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-many-locals,too-many-statements
+"""
+Convert media information to metadata definitions and export
+requests. Subroutine of the main HD processor.
+"""
from __future__ import annotations
import typing
@@ -19,14 +23,23 @@
class HDMediaSubprocessor:
+ """
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/hd/media_subprocessor.py |
Add docstrings to improve code quality | # Copyright 2019-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-few-public-methods,too-many-statements
from __future__ import annotations
import typing
from openage.convert.value_object.read.media_types import MediaType
from ....entity_object.export.formats.sprite_met... | --- +++ @@ -1,6 +1,10 @@ # Copyright 2019-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-few-public-methods,too-many-statements
+"""
+Convert media information to metadata definitions and export
+requests. Subroutine of the main AoC processor.
+"""
from __future__ im... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/media_subprocessor.py |
Add docstrings to improve code quality | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods,invalid-name
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
from __future__ import annotations
import typing
if... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
+"""
+Creates upgrade patches for resource modification effects in DE2.
+"""
from __future__ import annotations
import typing
@@ -16,6 +19,9 @@
class DE2UpgradeResourceSubprocessor:
+ """
+ Creates... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/upgrade_resource_subprocessor.py |
Write Python docstrings for this snippet | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-locals,too-many-statements
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberSpecialValue
from ....entity_object.conve... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates nyan objects for things that are hardcoded into the Genie Engine,
+but configurable in openage. E.g. HP.
+"""
from __future__ import annotations
import typing
@@ -19,9 +23,15 @@
class AoCPregenSubprocessor:
+ """
+ Creates r... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/pregen_processor.py |
Help me write clear docstrings | # Copyright 2021-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from ....entity_object.conversion.modpack import Modpack
from ..aoc.modpack_subprocessor import AoCModpackSubprocessor
if typing.TYPE_CHECKING:
fro... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -14,15 +18,24 @@
class HDModpackSubprocessor:
+ """
+ Creates the modpacks containing the nyan fil... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/hd/modpack_subprocessor.py |
Generate NumPy-style docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,invalid-name
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from ....entity_object.conversion.aoc.genie_unit import GenieUnitLineGroup, \
Ge... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates effects and resistances for the Apply*Effect and Resistance
+abilities.
+"""
from __future__ import annotations
import typing
@@ -19,6 +23,9 @@
class AoCEffectSubprocessor:
+ """
+ Creates raw API objects for attacks/resista... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/effect_subprocessor.py |
Add docstrings explaining edge cases | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches,too-many-nested-blocks,too-many-statements
from __future__ import annotations
import typing
from ....entity_object.conversion.aoc.genie_unit import GenieGameEntityGroup, \
GenieBuildingL... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-many-locals,too-many-branches,too-many-nested-blocks,too-many-statements
+"""
+Derives and adds abilities to lines or civ groups. Subroutine of the
+nyan subprocessor.
+"""
from __future__ import annotations
import typing
@@ -17,9 +21,20 @@
class AoCModifierSu... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/modifier_subprocessor.py |
Add missing documentation to my Python functions | # Copyright 2021-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from .....log import info
from ....entity_object.conversion.aoc.genie_object_container import GenieObjectContainer
from ....service.debug_info import d... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-few-public-methods
+"""
+Convert data from AoE2:HD to openage formats.
+"""
from __future__ import annotations
import typing
@@ -26,6 +29,9 @@
class HDProcessor:
+ """
+ Main processor for converting data from HD Edition.
+ """
@classmethod
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/hd/processor.py |
Document all endpoints with docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,invalid-name
# pylint: disable=too-many-public-methods,too-many-branches,too-many-arguments
#
# TODO:
# pylint: disable=unused-argument,line-too-long
from __future__ import a... | --- +++ @@ -6,6 +6,9 @@ # TODO:
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for abilities.
+"""
from __future__ import annotations
import typing
@@ -32,6 +35,9 @@
class AoCUpgradeAbilitySubprocessor:
+ """
+ Creates raw API objects for ability upgrade effects in AoC.
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/upgrade_ability_subprocessor.py |
Generate consistent documentation across files | # Copyright 2019-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from ....entity_object.conversion.aoc.genie_tech import UnitLine... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Convert API-like objects to nyan objects. Subroutine of the
+main AoC processor.
+"""
from __future__ import annotations
import typing
@@ -33,9 +37,15 @@
class AoCNyanSubprocessor:
+ """
+ Transform an AoC dataset to nyan objects.
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/nyan_subprocessor.py |
Help me add docstrings to my project | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-lines,too-many-branches,too-many-statements
from __future__ import annotations
import typing
from openage.convert.value_object.read.value_members import ArrayMember, StorageType
import openage.convert.... | --- +++ @@ -1,6 +1,9 @@ # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-lines,too-many-branches,too-many-statements
+"""
+Convert data from DE2 to openage formats.
+"""
from __future__ import annotations
import typing
@@ -32,6 +35,9 @@
class... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/processor.py |
Add docstrings to improve code quality | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from openage.log import warn
from .....nyan.nyan_structs import MemberOperator... | --- +++ @@ -5,6 +5,9 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates patches for technologies.
+"""
from __future__ import annotations
import typing
@@ -28,6 +31,9 @@
class AoCTechSubprocessor:
+ """
+ Creates raw API objects and patches for techs and civ setups in AoC.
+ """
upgrade... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/tech_subprocessor.py |
Create docstrings for all classes and functions | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
from __future__ import annotations
import typing
f... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for attribute modification effects in AoC.
+"""
from __future__ import annotations
import typing
@@ -22,6 +25,9 @@
class AoCUpgradeAttributeSubprocessor:
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py |
Please document this code using docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals
from __future__ import annotations
import typing
from ....entity_object.export.formats.sprite_metadata import LayerMode
from ....entity_object.export.media_export_request import MediaExportRequest
from ....ent... | --- +++ @@ -1,6 +1,10 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals
+"""
+Convert media information to metadata definitions and export
+requests. Subroutine of the main DE1 processor.
+"""
from __future__ import annotations
import typing
@@ -17,14... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de1/media_subprocessor.py |
Fill in missing docstrings in my code | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conversion.converter_object import RawAPIObject
... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
+"""
+Creates patches and modifiers for civs.
+"""
from __future__ import annotations
import typing
@@ -17,9 +20,16 @@
class DE2CivSubprocessor:
+ """
+ Creates raw API objects for civs in DE2.
+ """
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/civ_subprocessor.py |
Generate missing documentation strings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods,invalid-name
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
from __future__ import annotations
impo... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for resource modification effects in AoC.
+"""
from __future__ import annotations
import typing
@@ -20,6 +23,9 @@
class AoCUpgradeResourceSubprocessor:
+ ""... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py |
Document functions with detailed explanations | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods,too-many-locals
from __future__ import annotations
import typing
from ....entity_object.conversion.converter_object import RawAPIObject
from ....service.conversion import internal_name_lookups
from ..... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods,too-many-locals
+"""
+Derives and adds abilities to lines. Subroutine of the
+nyan subprocessor.
+"""
from __future__ import annotations
import typing
@@ -15,9 +19,20 @@
class DE2AbilitySubprocessor:
+ """
+ Creates raw API objects for... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/ability_subprocessor.py |
Add documentation for all methods | # Copyright 2023-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from ....entity_object.conversion.modpack import Modpack
from ..aoc.modpack_subprocessor import AoCModpackSubprocessor
if typing.TYPE_CHECKING:
fro... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -14,15 +18,24 @@
class DE1ModpackSubprocessor:
+ """
+ Creates the modpacks containing the nyan fi... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de1/modpack_subprocessor.py |
Add docstrings for internal functions | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conve... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Upgrades effects and resistances for the Apply*Effect and Resistance
+abilities.
+"""
from __future__ import annotations
import typing
@@ -24,6 +28,9 @@
class AoCUpgradeEffectSubprocessor:
+ """
+ Creates raw API objects for attack/... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/aoc/upgrade_effect_subprocessor.py |
Add docstrings following best practices | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from ....entity_object.conversion.modpack import Modpack
from ..aoc.modpack_subprocessor import AoCModpackSubprocessor
if typing.TYPE_CHECKING:
fro... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -14,15 +18,24 @@
class DE2ModpackSubprocessor:
+ """
+ Creates the modpacks containing the nyan fi... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/modpack_subprocessor.py |
Add docstrings for better understanding | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods,too-many-statements,too-many-locals
from __future__ import annotations
import typing
from ....entity_object.conversion.converter_object import RawAPIObject
from ....service.conversion import internal_n... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-few-public-methods,too-many-statements,too-many-locals
+"""
+Creates patches and modifiers for civs.
+"""
from __future__ import annotations
import typing
@@ -14,9 +17,15 @@
class RoRCivSubprocessor:
+ """
+ Creates raw API objects for civs in RoR.
+ "... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/civ_subprocessor.py |
Auto-generate documentation strings for this file | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
from __future__ import annotations
import typing
if typing.TYPE_CHECKING:
from openage.convert.entity_object.con... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
+"""
+Creates upgrade patches for attribute modification effects in DE2.
+"""
from __future__ import annotations
import typing
@@ -17,6 +20,9 @@
class DE2UpgradeAttributeSubprocessor:
+ """
+ Creat... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/upgrade_attribute_subprocessor.py |
Write docstrings for utility functions | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals
from __future__ import annotations
import typing
from ....entity_object.export.formats.sprite_metadata import LayerMode
from ....entity_object.export.media_export_request import MediaExportRequest
from ....ent... | --- +++ @@ -1,6 +1,10 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals
+"""
+Convert media information to metadata definitions and export
+requests. Subroutine of the main DE2 processor.
+"""
from __future__ import annotations
import typing
@@ -16,14... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/media_subprocessor.py |
Add docstrings for better understanding | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberSpecialValue
from ....entity_object.conversion.converter... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates nyan objects for things that are hardcoded into the Genie Engine,
+but configurable in openage. E.g. HP.
+"""
from __future__ import annotations
import typing
@@ -21,9 +25,15 @@
class SWGBCCPregenSubprocessor:
+ """
+ Create... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/pregen_subprocessor.py |
Add docstrings to existing functions | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-branches,too-many-statements,too-many-locals
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from math import degrees
from ....entity_object.conversion.aoc.genie_unit impo... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Derives and adds abilities to lines. Reimplements only
+abilities that are different from AoC.
+"""
from __future__ import annotations
import typing
@@ -23,6 +27,9 @@
class RoRAbilitySubprocessor:
+ """
+ Creates raw API objects for... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/ability_subprocessor.py |
Write proper docstrings for these functions | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from ....entity_object.conversion.aoc.genie_tech import UnitLineU... | --- +++ @@ -4,6 +4,10 @@ #
# TODO:
# pylint: disable=line-too-long
+"""
+Convert API-like objects to nyan objects. Subroutine of the
+main DE2 processor.
+"""
from __future__ import annotations
import typing
@@ -33,9 +37,15 @@
class DE2NyanSubprocessor:
+ """
+ Transform a DE2 dataset to nyan objects.
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/nyan_subprocessor.py |
Help me write clear docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-locals,too-many-branches,too-many-statements
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberSpecialValue
from ....ent... | --- +++ @@ -3,6 +3,10 @@ # pylint: disable=line-too-long,too-many-locals,too-many-branches,too-many-statements
# pylint: disable=too-few-public-methods
+"""
+Derives complex auxiliary objects from unit lines, techs
+or other objects.
+"""
from __future__ import annotations
import typing
@@ -20,9 +24,20 @@
cl... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/auxiliary_subprocessor.py |
Add docstrings following best practices | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from ....entity_object.conversion.modpack import Modpack
from ..aoc.modpack_subprocessor import AoCModpackSubprocessor
if typing.TYPE_CHECKING:
fr... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -15,15 +19,24 @@
class RoRModpackSubprocessor:
+ """
+ Creates the modpacks containing the nyan fi... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/modpack_subprocessor.py |
Add docstrings to clarify complex logic | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conversion.aoc.genie_tech import CivTeamBonus, CivBonus
from ..aoc.... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-locals,too-many-branches
+"""
+Creates patches for technologies.
+"""
from __future__ import annotations
import typing
@@ -21,6 +24,9 @@
class DE2TechSubprocessor:
+ """
+ Creates raw API objects and patches for techs and civ setups in DE2.
+ """
... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/de2/tech_subprocessor.py |
Add docstrings following best practices | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-few-public-methods
from __future__ import annotations
import typing
from openage.convert.processor.conversion.aoc.media_subprocessor import AoCMediaSubprocessor
if typing.TYPE_CHECKING:
from openage.c... | --- +++ @@ -1,6 +1,10 @@ # Copyright 2021-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-few-public-methods
+"""
+Convert media information to metadata definitions and export
+requests. Subroutine of the main RoR processor.
+"""
from __future__ import annotations
im... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/media_subprocessor.py |
Add docstrings to meet PEP guidelines | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals
from __future__ import annotations
import typing
from ....entity_object.conversion.converter_object import ConverterObjectGroup, \
RawAPIObject
from ....value_object.conversion.forward_ref import ForwardR... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-many-locals
+"""
+Creates nyan objects for things that are hardcoded into the Genie Engine,
+but configurable in openage. E.g. HP.
+"""
from __future__ import annotations
import typing
@@ -16,9 +20,15 @@
class RoRPregenSubprocessor:
+ """
+ Creates raw A... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/pregen_subprocessor.py |
Fully document this Python code with docstrings | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-lines,too-many-branches,too-many-statements,too-many-locals
from __future__ import annotations
import typing
from .....log import info
from ....entity_object.conversion.aoc.genie_object_container import... | --- +++ @@ -1,6 +1,9 @@ # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=line-too-long,too-many-lines,too-many-branches,too-many-statements,too-many-locals
+"""
+Convert data from RoR to openage formats.
+"""
from __future__ import annotations
import typing
@@ -35,6 +3... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/processor.py |
Generate docstrings for each module | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements
# pylint: disable=too-few-public-methods,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_str... | --- +++ @@ -6,6 +6,9 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates upgrade patches for abilities.
+"""
from __future__ import annotations
import typing
@@ -24,6 +27,9 @@
class RoRUpgradeAbilitySubprocessor:
+ """
+ Creates raw API objects for ability upgrade effects in RoR.
+ """
@... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/upgrade_ability_subprocessor.py |
Fill in missing docstrings in my code | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from ....entity_object.conversion.aoc.genie_unit import GenieVillagerGroup
from ....entity_object.conversion.combi... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Convert API-like objects to nyan objects. Subroutine of the
+main RoR processor. Reuses functionality from the AoC subprocessor.
+"""
from ....entity_object.conversion.aoc.genie_unit import GenieVillagerGroup
from ....entity_object.conversion.c... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/nyan_subprocessor.py |
Add docstrings to make code maintainable | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
# TODO pylint: disable=C,R
from __future__ import annotations
import typing
from openage.convert.entity_object.conversion.aoc.genie_tech import AgeUpgrade, \
UnitLineUpgrade, BuildingLineUpgrade, UnitUnlock, BuildingUnlock
from openage.co... | --- +++ @@ -1,6 +1,9 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
# TODO pylint: disable=C,R
+"""
+Creates debug output from data in a conversion run.
+"""
from __future__ import annotations
import typing
@@ -31,6 +34,16 @@
def debug_cli_args(debugdir: Directory, loglevel: int... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/service/debug_info.py |
Document my Python code with docstrings | # Copyright 2021-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
import toml
if typing.TYPE_CHECKING:
from openage.util.fslike.path import Path
def load_media_cache(filepath: Path) -> dict[str, dict[str, tuple]]:
output_dict = {}
with filepath.... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2021-2022 the openage authors. See copying.md for legal info.
+"""
+Load data of media cache files.
+"""
from __future__ import annotations
import typing
@@ -10,6 +13,9 @@
def load_media_cache(filepath: Path) -> dict[str, dict[str, tuple]]:
+ """
+ Parses a media cach... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/service/export/load_media_cache.py |
Generate descriptive docstrings automatically | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from functools import cache
import openage.convert.value_object.conversion.aoc.internal_nyan_names as aoc_internal
import openage.convert.value_object.conversion.de1.internal_nyan_names as de1_i... | --- +++ @@ -1,5 +1,9 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Provides functions that retrieve name lookup dicts for internal nyan object
+names or filenames.
+"""
from __future__ import annotations
import typing
@@ -20,6 +24,12 @@
@cache
def get_armor_class_lookups(ga... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/service/conversion/internal_name_lookups.py |
Generate docstrings with examples | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-public-methods,too-many-lines,too-many-locals
# pylint: disable=too-many-branches,too-many-statements,too-many-arguments
# pylint: disable=invalid-name
#
# TODO:
# pylint: disable=unused-argument,line-too-long
from _... | --- +++ @@ -7,6 +7,13 @@ # TODO:
# pylint: disable=unused-argument,line-too-long
+"""
+Derives and adds abilities to lines. Subroutine of the
+nyan subprocessor.
+
+For SWGB we use the functions of the AoCAbilitySubprocessor, but additionally
+create a diff for every civ line.
+"""
from __future__ import annotation... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/ability_subprocessor.py |
Document this module using docstrings | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-few-public-methods
from __future__ import annotations
import typing
from ....entity_object.conversion.modpack import Modpack
from ..aoc.modpack_subprocessor import AoCModpackSubprocessor
if typing.TYPE_CHECKING:
fro... | --- +++ @@ -2,6 +2,10 @@ #
# pylint: disable=too-few-public-methods
+"""
+Organize export data (nyan objects, media, scripts, etc.)
+into modpacks.
+"""
from __future__ import annotations
import typing
@@ -14,15 +18,24 @@
class SWGBCCModpackSubprocessor:
+ """
+ Creates the modpacks containing the nyan... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/modpack_subprocessor.py |
Fully document this Python code with docstrings | # Copyright 2016-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ....value_object.read.media.hardcoded.interface import ASSETS
from .cutter import ingame_hud_background_index
if typing.TYPE_CHECKING:
from openage.util.fslike.path import Path
def h... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2016-2022 the openage authors. See copying.md for legal info.
+"""
+Renaming interface assets and splitting into directories.
+"""
from __future__ import annotations
import typing
@@ -12,6 +15,10 @@
def hud_rename(filepath: Path) -> Path:
+ """
+ Returns a human-usabl... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/service/export/interface/rename.py |
Add structured docstrings to improve clarity | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
from __future__ import annotations
import typing
fr... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for attribute modification effects in RoR.
+"""
from __future__ import annotations
import typing
@@ -20,6 +23,9 @@
class RoRUpgradeAttributeSubprocessor:
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/upgrade_attribute_subprocessor.py |
Generate consistent documentation across files | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
from __future__ import annotations
import typing
from ....entity_object.conversion.converter_object import RawAPIObject
from ....service.conversion import internal_name_l... | --- +++ @@ -2,6 +2,9 @@ #
# pylint: disable=too-many-locals,too-many-statements,too-many-branches
+"""
+Creates patches and modifiers for civs.
+"""
from __future__ import annotations
import typing
@@ -17,9 +20,16 @@
class SWGBCCCivSubprocessor:
+ """
+ Creates raw API objects for civs in SWGB.
+ ""... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/civ_subprocessor.py |
Document all endpoints with docstrings | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conversion.aoc.genie_unit ... | --- +++ @@ -5,6 +5,9 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates patches for technologies.
+"""
from __future__ import annotations
import typing
@@ -26,6 +29,9 @@
class RoRTechSubprocessor:
+ """
+ Creates raw API objects and patches for techs and civ setups in RoR.
+ """
upgrade... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/tech_subprocessor.py |
Create docstrings for all classes and functions | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches,too-many-statements
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberSpecialValue
from ....entity_object.co... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Derives complex auxiliary objects from unit lines, techs
+or other objects.
+"""
from __future__ import annotations
import typing
@@ -23,9 +27,18 @@
class SWGBCCAuxiliarySubprocessor:
+ """
+ Creates complexer auxiliary raw API obje... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/auxiliary_subprocessor.py |
Document classes and their methods | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-branches,too-many-statements,too-many-locals
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from openage.convert.entity_object.conversion.aoc.genie_tech imp... | --- +++ @@ -4,6 +4,9 @@ #
# TODO:
# pylint: disable=line-too-long
+"""
+Convert data from SWGB:CC to openage formats.
+"""
from __future__ import annotations
import typing
@@ -41,6 +44,9 @@
class SWGBCCProcessor:
+ """
+ Main processor for converting data from SWGB.
+ """
@classmethod
def... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/processor.py |
Generate documentation strings for clarity | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
from __future__ import annotations
import typing
fr... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for attribute modification effects in SWGB.
+"""
from __future__ import annotations
import typing
@@ -20,6 +23,9 @@
class SWGBCCUpgradeAttributeSubprocessor:
+... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/upgrade_attribute_subprocessor.py |
Write Python docstrings for this snippet | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
from __future__ import annotations
import typing
from .....nyan.n... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument
+"""
+Creates upgrade patches for resource modification effects in RoR.
+"""
from __future__ import annotations
import typing
@@ -20,6 +23,9 @@
class RoRUpgradeResourceSubprocessor:
+ """
+ Creates... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/ror/upgrade_resource_subprocessor.py |
Generate helpful docstrings for debugging | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
from ...value_object.read.media_types import MediaType
if typing.TYPE_CHECKING:
from argparse import Namespace
def get_existing_graphics(args: Namespace) -> set[str]:
filenames = set(... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2020-2023 the openage authors. See copying.md for legal info.
+"""
+Module for registering media files.
+"""
from __future__ import annotations
import typing
@@ -11,8 +14,11 @@
def get_existing_graphics(args: Namespace) -> set[str]:
+ """
+ List the graphics files tha... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/service/read/register_media.py |
Generate docstrings with parameter types | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-lines,too-many-statements,too-many-public-methods
#
# TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
from __future__ import annotations
import typing
fr... | --- +++ @@ -5,6 +5,9 @@ # TODO: Remove when all methods are implemented
# pylint: disable=unused-argument,line-too-long
+"""
+Creates upgrade patches for resource modification effects in SWGB.
+"""
from __future__ import annotations
import typing
@@ -20,6 +23,9 @@
class SWGBCCUpgradeResourceSubprocessor:
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/upgrade_resource_subprocessor.py |
Improve documentation using docstrings | # Copyright 2020-2024 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-lines,too-many-locals,too-many-statements,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from ....entity_object.conversion.aoc.genie_tech import UnitLine... | --- +++ @@ -5,6 +5,10 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Convert API-like objects to nyan objects. Subroutine of the
+main SWGB processor. Reuses functionality from the AoC subprocessor.
+"""
from __future__ import annotations
import typing
@@ -30,9 +34,15 @@
class SWGBCCNyanSubprocessor:
+ ... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/nyan_subprocessor.py |
Add docstrings that explain inputs and outputs | # Copyright 2015-2024 the openage authors. See copying.md for legal info.
from __future__ import annotations
import sys
from pathlib import Path
from openage.convert.processor.export.media_exporter import MediaExporter
from openage.convert.value_object.init.game_version import GameEdition, GameVersion
from ...log ... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2015-2024 the openage authors. See copying.md for legal info.
+"""
+Convert a single slp/wav file from some drs archive to a png/opus file.
+"""
from __future__ import annotations
import sys
@@ -24,6 +27,7 @@
def init_subparser(cli):
+ """ Initializes the parser for conv... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/tool/singlefile.py |
Create docstrings for reusable components | # Copyright 2020-2023 the openage authors. See copying.md for legal info.
#
# pylint: disable=too-many-locals,too-many-branches
#
# TODO:
# pylint: disable=line-too-long
from __future__ import annotations
import typing
from .....nyan.nyan_structs import MemberOperator
from ....entity_object.conversion.aoc.genie_tech ... | --- +++ @@ -5,6 +5,9 @@ # TODO:
# pylint: disable=line-too-long
+"""
+Creates patches for technologies.
+"""
from __future__ import annotations
import typing
@@ -23,6 +26,9 @@
class SWGBCCTechSubprocessor:
+ """
+ Creates raw API objects and patches for techs and civ setups in SWGB.
+ """
upg... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/conversion/swgbcc/tech_subprocessor.py |
Add professional docstrings to my codebase | # Copyright 2020-2022 the openage authors. See copying.md for legal info.
from __future__ import annotations
import typing
import os
from openage.util.hash import hash_file
if typing.TYPE_CHECKING:
from openage.util.fslike.directory import Directory
from openage.util.fslike.path import Path
from openag... | --- +++ @@ -1,4 +1,8 @@ # Copyright 2020-2022 the openage authors. See copying.md for legal info.
+"""
+Provides functions for traversing a directory and
+generating hash values for all the items inside.
+"""
from __future__ import annotations
import typing
@@ -15,6 +19,12 @@
def bfs_directory(root: Path) -> ty... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/processor/export/generate_manifest_hashes.py |
Add docstrings for production code | # Copyright 2023-2024 the openage authors. See copying.md for legal info.
from openage.convert.entity_object.conversion.modpack import Modpack
from openage.convert.entity_object.export.formats.nyan_file import NyanFile
from openage.convert.processor.export.data_exporter import DataExporter
from openage.convert.proces... | --- +++ @@ -1,5 +1,8 @@ # Copyright 2023-2024 the openage authors. See copying.md for legal info.
+"""
+Export tool for dumping the nyan API of the engine from the converter.
+"""
from openage.convert.entity_object.conversion.modpack import Modpack
from openage.convert.entity_object.export.formats.nyan_file impor... | https://raw.githubusercontent.com/SFTtech/openage/HEAD/openage/convert/tool/api_export.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.