A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/themix-project/themix-gui/commit/d64e3925df90b4d4aa580e3a231cd9f4ecaa525a below:

make it work also in CLI · themix-project/themix-gui@d64e392 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+23

-13

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+23

-13

lines changed Original file line number Diff line number Diff line change

@@ -19,7 +19,7 @@

19 19

get_plugin_module, apply_chain, call_method_from_class, delayed_partial,

20 20

)

21 21

from oomox_gui.i18n import translate

22 -

from oomox_gui.main import OomoxApplicationWindow

22 +

from oomox_gui.main import OomoxApplicationWindow, NoWindowError

23 23

from oomox_gui.theme_model import get_first_theme_option

24 24 25 25

@@ -463,14 +463,19 @@ def _generate_terminal_palette( # noqa

463 463

hex_palette, template_path, inverse_palette, result_callback

464 464

)

465 465

else:

466 -

_app = OomoxApplicationWindow.get_instance()

467 -

_app.disable(translate('Extracting palette from image…'))

468 -

_app.schedule_task(

469 -

cls._generate_terminal_palette_task,

466 +

palette_task_args = [

470 467

template_path, image_path, quality, use_whole_palette, inverse_palette,

471 468

start_time, result_callback,

472 -

)

473 -

_app.enable()

469 +

]

470 +

try:

471 +

_app = OomoxApplicationWindow.get_instance()

472 +

_app.disable(translate('Extracting palette from image…'))

473 +

_app.schedule_task(

474 +

cls._generate_terminal_palette_task, *palette_task_args

475 +

)

476 +

_app.enable()

477 +

except NoWindowError:

478 +

cls._generate_terminal_palette_task(*palette_task_args)

474 479 475 480

@classmethod

476 481

def _generate_terminal_palette_task( # noqa

@@ -575,13 +580,18 @@ def _result_callback(generated_palette):

575 580

result_callback(palette)

576 581 577 582

if not cls._terminal_palette_cache.get(_id):

578 -

_app = OomoxApplicationWindow.get_instance()

579 -

_app.disable(translate('Generating terminal palette…'))

580 -

_app.schedule_task(

581 -

cls._generate_terminal_palette,

583 +

generate_terminal_palette_args = [

582 584

template_path, image_path, quality, use_whole_palette, inverse_palette,

583 585

_result_callback

584 -

)

585 -

_app.enable()

586 +

]

587 +

try:

588 +

_app = OomoxApplicationWindow.get_instance()

589 +

_app.disable(translate('Generating terminal palette…'))

590 +

_app.schedule_task(

591 +

cls._generate_terminal_palette, *generate_terminal_palette_args

592 +

)

593 +

_app.enable()

594 +

except NoWindowError:

595 +

cls._generate_terminal_palette(*generate_terminal_palette_args)

586 596

else:

587 597

_result_callback(cls._terminal_palette_cache[_id])

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4