Skip to content

Commit

Permalink
Rename generator module to apprun_v2_setup
Browse files Browse the repository at this point in the history
better ilustrate the intention of the code inside
  • Loading branch information
azubieta committed Jun 21, 2022
1 parent ecd08b4 commit 3873385
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions appimagebuilder/commands/setup_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
from appimagebuilder.modules.setup.generator import RuntimeGenerator
from appimagebuilder.modules.setup.apprun2 import AppRunV2Setup
from appimagebuilder.commands.command import Command


Expand All @@ -23,5 +23,5 @@ def id(self):
return "runtime-setup"

def __call__(self, *args, **kwargs):
runtime = RuntimeGenerator(self.context, self._finder)
runtime.generate()
runtime = AppRunV2Setup(self.context, self._finder)
runtime.setup()
2 changes: 1 addition & 1 deletion appimagebuilder/modules/generate/recipe_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _generate_package_manager_sections(self, bundle_info, runtime_dependencies):

results = {}
for section_generator in self._package_manager_sections_generators:
recipe_section, unresolved_files = section_generator.generate(
recipe_section, unresolved_files = section_generator.setup(
runtime_dependencies, bundle_info
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
from ...context import Context


class RuntimeGeneratorError(RuntimeError):
class AppRunV2SetupError(RuntimeError):
pass


class RuntimeGenerator:
class AppRunV2Setup:
def __init__(self, context: Context, finder: Finder):
self.context = context
recipe = context.recipe
Expand Down Expand Up @@ -61,12 +61,12 @@ def __init__(self, context: Context, finder: Finder):
if self.apprun_version != "continuous" and version.parse(
self.apprun_version
) < version.parse("v2.0.0"):
raise RuntimeGeneratorError(
raise AppRunV2SetupError(
"Unsupported AppRun version (%s), please use v2.0.0 or newer"
% self.apprun_version
)

def generate(self):
def setup(self):
runtime_env = self._configure_runtime_environment()

scanner = ExecutablesScanner(self.appdir_path, self.finder)
Expand Down

0 comments on commit 3873385

Please sign in to comment.