-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new API for Flatpak to CalculateSizeWithTask
This API is used from UI code just after new package selection is resolved. This will allow us to react on package selection in Flatpak immediately. Also move CalculateFlatpaksSizeTask to initialization because this task is not used for installation.
- Loading branch information
1 parent
8748222
commit 3d25810
Showing
5 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
pyanaconda/modules/payloads/payload/flatpak/initialization.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright (C) 2025 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
|
||
from pyanaconda.modules.common.task import Task | ||
from pyanaconda.modules.payloads.payload.flatpak.flatpak_manager import FlatpakManager | ||
|
||
|
||
class CalculateFlatpaksSizeTask(Task): | ||
"""Task to determine space needed for Flatpaks""" | ||
|
||
def __init__(self, flatpak_manager: FlatpakManager): | ||
"""Create a new task.""" | ||
super().__init__() | ||
self._flatpak_manager = flatpak_manager | ||
|
||
@property | ||
def name(self): | ||
"""Name of the task.""" | ||
return "Calculate needed space for Flatpaks" | ||
|
||
def run(self): | ||
self._flatpak_manager.calculate_size() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters