[game-data-packager] 08/16: Lazily initialize PackagingTask.packaging
Simon McVittie
smcv at debian.org
Fri Jan 8 09:14:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository game-data-packager.
commit ce53d5bbc11da5a1b11ec97e70e07d9b1e518a98
Author: Simon McVittie <smcv at debian.org>
Date: Wed Jan 6 21:43:56 2016 +0000
Lazily initialize PackagingTask.packaging
---
game_data_packager/build.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 961a9b4..d0cdfcb 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -345,11 +345,8 @@ class PackagingTask(object):
# A GameData object.
self.game = game
- if packaging is None:
- packaging = get_native_packaging_system()
-
# A packaging system.
- self.packaging = packaging
+ self.__packaging = packaging
# A temporary directory.
self.__workdir = None
@@ -413,6 +410,14 @@ class PackagingTask(object):
logger.warning('error removing "%s":' % path, exc_info=ei))
self._cleanup_dirs = set()
+ @property
+ def packaging(self):
+ """The PackagingSystem in use."""
+ if self.__packaging is None:
+ self.__packaging = get_native_packaging_system()
+
+ return self.__packaging
+
def get_workdir(self):
if self.__workdir is None:
self.__workdir = tempfile.mkdtemp(prefix='gdptmp.')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list