From 4d82790f8072520eb468cbe7ceea5d688b3784fa Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Sat, 10 Oct 2020 10:47:50 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20CursorBuilder=20with=20tempdir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builder/cursor.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/builder/cursor.py b/builder/cursor.py index fd6334ca..aaacebec 100644 --- a/builder/cursor.py +++ b/builder/cursor.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import tempfile from .bundler import Bundler from .config import ConfigProvider, hotspots, sizes, delay from clickgen import build_x11_cursor_theme, build_cursor_theme, build_win_cursor_theme @@ -18,6 +19,7 @@ class CursorBuilder(): self.__name = name self.__config = config self.__bundler = Bundler(name, config) + self.tmpdir = tempfile.mkdtemp() def build_x11_cursors(self) -> None: """ @@ -29,12 +31,12 @@ class CursorBuilder(): image_dir=self.__config.bitmaps_dir, cursor_sizes=sizes, hotspots=hotspots, - out_path=self.__config.temp_out_dir, + out_path=self.tmpdir, archive=False, delay=delay ) - self.__bundler.x11_bundle() + self.__bundler.x11_bundle(self.tmpdir) def build_win_cursors(self) -> None: """ @@ -46,27 +48,26 @@ class CursorBuilder(): image_dir=self.__config.bitmaps_dir, cursor_sizes=sizes, hotspots=hotspots, - out_path=self.__config.temp_out_dir, + out_path=self.tmpdir, archive=False, delay=delay ) - self.__bundler.win_bundle() + self.__bundler.win_bundle(self.tmpdir) def build_cursors(self) -> None: """ docstring """ - print('🌈 Building %s Theme ...' % self.__name) build_cursor_theme( name=self.__name, image_dir=self.__config.bitmaps_dir, cursor_sizes=sizes, hotspots=hotspots, - out_path=self.__config.temp_out_dir, + out_path=self.tmpdir, archive=False, delay=delay ) - self.__bundler.bundle() + self.__bundler.bundle(self.tmpdir)