Skip to content

Commit

Permalink
fix: windows multiprocessing not working (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xientraa authored Mar 5, 2023
1 parent f72c112 commit a8bb2d1
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
from multiprocessing import Pool
import clipboard, time, json, os


def processTarget(url: TSRUrl):
downloader = TSRDownload(url)
if downloader.download():
Logger.info(f"Completed download for: {url.url}")

return url


def callback(url: TSRUrl):
runningDownloads.remove(url.url)
if len(runningDownloads) == 0:
Logger.info("All downloads have been completed")


if __name__ == "__main__":
CONFIG: CONFIG_DICT = json.load(
open(os.path.dirname(os.path.abspath(__file__)) + "/config.json", "r")
Expand All @@ -14,18 +29,6 @@
runningDownloads: list[str] = []
downloadQueue: list[str] = []

def processTarget(url: TSRUrl):
downloader = TSRDownload(url)
if downloader.download():
Logger.info(f"Completed download for: {url.url}")

return url

def callback(url: TSRUrl):
runningDownloads.remove(url.url)
if len(runningDownloads) == 0:
Logger.info("All downloads have been completed")

while True:
pastedText = clipboard.paste()
if lastPastedText == pastedText:
Expand Down

0 comments on commit a8bb2d1

Please sign in to comment.