Skip to content

Commit

Permalink
unified pool
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePromidius committed Feb 28, 2024
1 parent 53c8433 commit 9334bf3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
13 changes: 12 additions & 1 deletion MangaManager/Extensions/WebpConverter/WebpConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@
import pathlib
import tkinter
import tkinter.ttk as ttk
from concurrent.futures import ProcessPoolExecutor
from tkinter import filedialog

from Extensions.IExtensionApp import IExtensionApp
from Extensions.WebpConverter.processing import convert
from MangaManager.Common.utils import ShowPathTreeAsDict
from MangaManager.MetadataManager.GUI.widgets import ScrolledFrameWidget, ProgressBarWidget
from MangaManager.ProcessingPool import ProcessingPool
from MangaManager.Settings.Settings import Settings

logger = logging.getLogger()
class ProcessingPool(object):
_instance = None

def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = object.__new__(cls)
cls._instance.pool = ProcessPoolExecutor()
return cls._instance

def submit(self, func, *args, **kwargs):
return self.pool.submit(func, *args, **kwargs)


class WebpConverter(IExtensionApp):
Expand Down
14 changes: 0 additions & 14 deletions MangaManager/MangaManager/ProcessingPool.py

This file was deleted.

2 changes: 1 addition & 1 deletion MangaManager/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def is_valid_xml(xml:str) -> bool:
xml_file = etree.fromstring(xml.encode("utf-8"),parser=etree.XMLParser(encoding='utf-8'))
except ValueError:
print("dasd")
xsd_schema = etree.parse('common/models/ComicInfo.xds')
xsd_schema = etree.parse('MangaManager/Common/models/ComicInfo.xds')

# Create a validator object
xml_validator = etree.XMLSchema(xsd_schema)
Expand Down

0 comments on commit 9334bf3

Please sign in to comment.