Skip to content

Commit

Permalink
refactor: Fix copyright years and missing docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Aug 21, 2020
1 parent 147b473 commit 607117b
Show file tree
Hide file tree
Showing 47 changed files with 105 additions and 58 deletions.
2 changes: 1 addition & 1 deletion openage/convert/deprecated/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ add_py_modules(
struct_definition.py
struct_snippet.py
util.py
)
)
2 changes: 1 addition & 1 deletion openage/convert/entity_object/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ add_py_modules(
)

add_subdirectory(conversion)
add_subdirectory(export)
add_subdirectory(export)
5 changes: 5 additions & 0 deletions openage/convert/entity_object/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Entity objects used by the converter
"""
2 changes: 1 addition & 1 deletion openage/convert/entity_object/conversion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2015 the openage authors. See copying.md for legal info.
# Copyright 2013-2020 the openage authors. See copying.md for legal info.

"""
Objects for storing conversion data.
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/entity_object/conversion/aoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

"""
Conversion data formats for Age of Empires II.
Expand Down
4 changes: 2 additions & 2 deletions openage/convert/entity_object/export/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

"""
Export modpacks to files.
Entity objects for exporting.
"""
5 changes: 5 additions & 0 deletions openage/convert/processor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Processors for the conversion.
"""
5 changes: 5 additions & 0 deletions openage/convert/processor/conversion/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Processors used for conversion.
"""
2 changes: 1 addition & 1 deletion openage/convert/processor/export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ add_py_modules(
modpack_exporter.py
slp_converter_pool.py
texture_merge.py
)
)
5 changes: 5 additions & 0 deletions openage/convert/processor/export/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Processors used for export.
"""
2 changes: 1 addition & 1 deletion openage/convert/processor/export/slp_converter_pool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015-2019 the openage authors. See copying.md for legal info.
# Copyright 2015-2020 the openage authors. See copying.md for legal info.

"""
Multiprocessing-based SLP-to-texture converter service.
Expand Down
3 changes: 2 additions & 1 deletion openage/convert/processor/export/texture_merge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2014-2020 the openage authors. See copying.md for legal info.

#
# pylint: disable=too-many-locals
"""
Merges texture frames into a spritesheet or terrain tiles into
a terrain texture.
Expand Down
4 changes: 1 addition & 3 deletions openage/convert/service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Retrieves data or execute functions from external sources
(which is everything that the converter does not generate by
itself).
Services used by the converter.
"""
2 changes: 1 addition & 1 deletion openage/convert/service/conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_py_modules(
__init__.py
internal_name_lookups.py
)
)
5 changes: 5 additions & 0 deletions openage/convert/service/conversion/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Services used for conversion.
"""
2 changes: 1 addition & 1 deletion openage/convert/service/export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ add_py_modules(

add_subdirectory(interface)
add_subdirectory(opus)
add_subdirectory(png)
add_subdirectory(png)
5 changes: 5 additions & 0 deletions openage/convert/service/export/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Entity objects used for export.
"""
4 changes: 2 additions & 2 deletions openage/convert/service/export/interface/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2016-2016 the openage authors. See copying.md for legal info.
# Copyright 2016-2020 the openage authors. See copying.md for legal info.

"""
Interface assets conversion
Interface assets conversion.
"""
2 changes: 1 addition & 1 deletion openage/convert/service/export/interface/cutter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2017 the openage authors. See copying.md for legal info.
# Copyright 2016-2020 the openage authors. See copying.md for legal info.

""" Cutting some user interface assets into subtextures """

Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/interface/rename.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2017 the openage authors. See copying.md for legal info.
# Copyright 2016-2020 the openage authors. See copying.md for legal info.

""" Renaming interface assets and splitting into directories """

Expand Down
5 changes: 3 additions & 2 deletions openage/convert/service/export/interface/visgrep.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2018 the openage authors. See copying.md for legal info.
# Copyright 2016-2020 the openage authors. See copying.md for legal info.

# If you wanna boost speed even further:
# cython: profile=False
Expand All @@ -11,9 +11,10 @@ import argparse
from collections import namedtuple
import itertools
import logging
import numpy
import sys

import numpy

cimport cython
cimport numpy

Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/opus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2018 the openage authors. See copying.md for legal info.
# Copyright 2018-2020 the openage authors. See copying.md for legal info.

"""
Cython module to encode opus-files using libopus.
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/opus/demo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2018 the openage authors. See copying.md for legal info.
# Copyright 2018-2020 the openage authors. See copying.md for legal info.
"""
Demo for the opusenc module.
"""
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/opus/ogg.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2018 the openage authors. See copying.md for legal info.
# Copyright 2018-2020 the openage authors. See copying.md for legal info.

cdef extern from "ogg/config_types.h":
ctypedef short ogg_int16_t
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/opus/opus.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2018 the openage authors. See copying.md for legal info.
# Copyright 2018-2020 the openage authors. See copying.md for legal info.

cdef extern from "opus/opus.h":
ctypedef struct OpusEncoder:
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/export/opus/opusenc.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2018 the openage authors. See copying.md for legal info.
# Copyright 2018-2020 the openage authors. See copying.md for legal info.

import time
from libc.string cimport memcpy, memset
Expand Down
2 changes: 1 addition & 1 deletion openage/convert/service/init/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ add_py_modules(
conversion_required.py
mount_asset_dirs.py
version_detect.py
)
)
5 changes: 5 additions & 0 deletions openage/convert/service/init/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Services used during converter initialization.
"""
2 changes: 1 addition & 1 deletion openage/convert/service/init/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ASSET_VERSION = len(CHANGES) - 1


def changes(asset_version, spec_version):
def changes(asset_version):
"""
return all changed components since the passed version number.
"""
Expand Down
13 changes: 1 addition & 12 deletions openage/convert/service/init/conversion_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def conversion_required(asset_dir, args):
"""

version_path = asset_dir / 'converted' / changelog.ASSET_VERSION_FILENAME
spec_path = asset_dir / 'converted' / changelog.GAMESPEC_VERSION_FILENAME

# determine the version of assets
try:
with version_path.open() as fileobj:
Expand All @@ -36,16 +34,7 @@ def conversion_required(asset_dir, args):
info("No converted assets have been found")
asset_version = -1

# determine the version of the gamespec format
try:
with spec_path.open() as fileobj:
spec_version = fileobj.read().strip()

except FileNotFoundError:
info("Game specification version file not found.")
spec_version = None

changes = changelog.changes(asset_version, spec_version)
changes = changelog.changes(asset_version,)

if not changes:
dbg("Converted assets are up to date")
Expand Down
3 changes: 2 additions & 1 deletion openage/convert/service/init/mount_asset_dirs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

#
# pylint: disable=too-many-branches
"""
Mount asset dirs of a game version into the conversion folder.
"""
Expand Down
5 changes: 5 additions & 0 deletions openage/convert/service/read/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Services used for reading data.
"""
3 changes: 2 additions & 1 deletion openage/convert/service/read/nyan_api_loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

#
# pylint: disable=line-too-long,too-many-lines,too-many-statements
"""
Loads the API into the converter.
Expand Down
5 changes: 5 additions & 0 deletions openage/convert/tool/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Tools used by the converter.
"""
2 changes: 1 addition & 1 deletion openage/convert/tool/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def save_slp(path, target, palette=None):
from ..service.read.palette import get_palettes

if not palette:
palette = get_palettes(data)
palette = get_palettes(data, game_version)

with path.open("rb") as slpfile:
tex = Texture(SLP(slpfile.read()), palette)
Expand Down
5 changes: 5 additions & 0 deletions openage/convert/tool/subtool/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Subtools for fetching user input.
"""
2 changes: 1 addition & 1 deletion openage/convert/value_object/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ add_py_modules(

add_subdirectory(conversion)
add_subdirectory(init)
add_subdirectory(read)
add_subdirectory(read)
5 changes: 5 additions & 0 deletions openage/convert/value_object/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Value objects used by the converter.
"""
2 changes: 1 addition & 1 deletion openage/convert/value_object/conversion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Stores objects relevat during conversion.
Value objects used during conversion.
"""
8 changes: 2 additions & 6 deletions openage/convert/value_object/init/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Copyright 2013-2020 the openage authors. See copying.md for legal info.
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Infrastructure for
- reading empires.dat
- storing members in python objects
Value objects used for the converter initilization.
"""
2 changes: 1 addition & 1 deletion openage/convert/value_object/read/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ add_py_modules(
value_members.py
)

add_subdirectory(media)
add_subdirectory(media)
5 changes: 5 additions & 0 deletions openage/convert/value_object/read/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020-2020 the openage authors. See copying.md for legal info.

"""
Value objects used for reading data.
"""
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2015 the openage authors. See copying.md for legal info.
# Copyright 2013-2020 the openage authors. See copying.md for legal info.

"""
The various structs that make up empires.dat
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2015 the openage authors. See copying.md for legal info.
# Copyright 2013-2020 the openage authors. See copying.md for legal info.

"""
Various constants.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014-2015 the openage authors. See copying.md for legal info.
# Copyright 2014-2020 the openage authors. See copying.md for legal info.

"""
The 256 colors for use by the in-game terminal.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014-2015 the openage authors. See copying.md for legal info.
# Copyright 2014-2020 the openage authors. See copying.md for legal info.

"""
Tile size for terrain pieces.
Expand Down
6 changes: 3 additions & 3 deletions openage/testing/testlist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015-2018 the openage authors. See copying.md for legal info.
# Copyright 2015-2020 the openage authors. See copying.md for legal info.

""" Lists of all possible tests; enter your tests here. """

Expand Down Expand Up @@ -26,7 +26,7 @@ def tests_py():
yield "openage.assets.test"
yield ("openage.cabextract.test.test", "test CAB archive extraction",
lambda env: env["has_assets"])
yield "openage.convert.changelog.test"
yield "openage.convert.service.init.changelog.test"
yield "openage.cppinterface.exctranslate_tests.cpp_to_py"
yield ("openage.cppinterface.exctranslate_tests.cpp_to_py_bounce",
"translates the exception back and forth a few times")
Expand All @@ -46,7 +46,7 @@ def demos_py():
"translates a C++ exception and its causes to python")
yield ("openage.log.tests.demo",
"demonstrates the translation of Python log messages")
yield ("openage.convert.opus.demo.convert",
yield ("openage.convert.service.export.opus.demo.convert",
"encodes an opus file from a wave file")
yield ("openage.event.demo.curvepong",
"play pong on steroids through future prediction")
Expand Down

0 comments on commit 607117b

Please sign in to comment.