-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Vlad Krupinskii <[email protected]> Signed-off-by: Simó Albert i Beltran <[email protected]>
- Loading branch information
Showing
17 changed files
with
354 additions
and
161 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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,31 @@ | ||
# Copyright 2024 Vlad Krupinskii <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
from gi.repository import Adw, Gio, GObject, Gtk | ||
|
||
|
||
class SingletonMeta(type(GObject.GObject)): | ||
_instances = {} | ||
|
||
def __call__(cls, task_data, *args, **kwargs): | ||
if task_data.uid not in cls._instances: | ||
cls._instances[task_data.uid] = super(SingletonMeta, cls).__call__( | ||
task_data, *args, **kwargs | ||
) | ||
return cls._instances[task_data.uid] | ||
|
||
|
||
class TaskDataListView(GObject.GObject, metaclass=SingletonMeta): | ||
def __init__(self, source): | ||
super().__init__() | ||
self._source = source | ||
|
||
def __getattr__(self, name): | ||
return getattr(self._source, name) | ||
|
||
def __setattr__(self, name, value): | ||
if name == "_source": | ||
self.__dict__[name] = value | ||
else: | ||
setattr(self._source, name, value) |
Oops, something went wrong.