# Path: scctool/settings/client_config.py
# class ClientConfig(object):
#     """Define PyUpdater data."""
# 
#     PUBLIC_KEY = 'AV48jKZoJOOiSR3sXdgDih6FECQOHJi5eDsWcs9psio'
#     APP_NAME = 'StarCraft-Casting-Tool'
#     COMPANY_NAME = 'team pheeniX'
#     HTTP_TIMEOUT = 30
#     MAX_DOWNLOAD_RETRIES = 3
#     UPDATE_URLS = ['https://github.com/teampheenix/SCCT-archive/raw/master/']
# 
# Path: scctool/tasks/tasksthread.py
# class TasksThread(QThread):
#     """Define generic thread for various tasks."""
# 
#     def __init__(self):
#         """Init thread."""
#         QThread.__init__(self)
# 
#         self.__tasks = {}
#         self.__run = {}
#         self.__methods = {}
#         self.__timeout = 1
#         self.__idx = 0
#         self.__wait_first = False
# 
#     def setWaitFirst(self, wait_first):
#         """Set the thread to wait first."""
#         self.__wait_first = bool(wait_first)
# 
#     def setTimeout(self, timeout):
#         """Set the timeout between tasks."""
#         self.__timeout = float(timeout)
# 
#     def addTask(self, task, method):
#         """Add a task."""
#         if(len(self.__tasks) > 5):
#             raise UserWarning("Only {} tasks allowed per thread.".format(6))
#         self.__tasks[task] = False
#         self.__methods[task] = method
# 
#     def hasActiveTask(self):
#         """Check if any task is active."""
#         return any(self.__tasks.values())
# 
#     def isActive(self, task):
#         """Check if a sepcific task is active."""
#         try:
#             return self.__tasks[task]
#         except Exception:
#             return False
# 
#     def activateTask(self, task):
#         """Activate a task."""
#         if not (task in self.__tasks):
#             raise UserWarning(
#                 "Task {} of {} is not valid.".format(
#                     task,
#                     self.__class__.__name__))
# 
#         self.__tasks[task] = True
# 
#         if not self.isRunning():
#             self.start()
# 
#     def terminate(self):
#         """Deactivate all tasks and terminate thread."""
#         for task in self.__tasks:
#             self.__tasks[task] = False
# 
#     def deactivateTask(self, task):
#         """Deactivate a Task."""
#         if not (task in self.__tasks):
#             raise UserWarning(
#                 "Task {} of {} is not valid.".format(
#                     task,
#                     self.__class__.__name__))
#         self.__tasks[task] = False
# 
#     def execTask(self, task):
#         """Execute task."""
#         self.__methods[task]()
# 
#     def execActiveTasks(self):
#         """Exectute all active tasks."""
#         executedTasks = []
#         continue_loop = True
# 
#         while continue_loop and self.hasActiveTask():
#             continue_loop = False
#             for task, active in self.__tasks.items():
#                 if active and task not in executedTasks:
#                     self.execTask(task)
#                     executedTasks.append(task)
#                     continue_loop = True
# 
#     def __wait(self):
#         if(not self.hasActiveTask()):
#             return
# 
#         cycletime = 0.1
#         cycles = int(self.__timeout / cycletime)
#         rest = max(self.__timeout - cycles * cycletime, 0.0)
# 
#         for __ in range(cycles):
#             time.sleep(cycletime)
#             if(not self.hasActiveTask()):
#                 return
#         time.sleep(rest)
# 
#     def run(self):
#         """Run the thread."""
#         module_logger.info(
#             "A {} is starting.".format(self.__class__.__name__))
# 
#         if self.__wait_first:
#             self.__wait()
# 
#         while self.hasActiveTask():
#             self.execActiveTasks()
#             self.__wait()
# 
#         module_logger.info("A {} is done.".format(self.__class__.__name__))


import logging
import os
import re
import time
import humanize
import keyboard
import requests
import scctool.matchdata
import scctool.settings.config
import scctool.settings.translation
import scctool.tasks.updater
from PyQt5.QtCore import (QMimeData, QPoint, QPointF, QSettings, QSize, Qt,
                          pyqtProperty, pyqtSignal)
from PyQt5.QtGui import (QBrush, QColor, QDrag, QIcon, QKeySequence, QPainter,
                         QPen, QRadialGradient)
from PyQt5.QtWidgets import (QAbstractButton, QAction, QApplication, QCheckBox,
                             QColorDialog, QComboBox, QCompleter, QFileDialog,
                             QFormLayout, QFrame, QGroupBox, QHBoxLayout,
                             QHeaderView, QInputDialog, QLabel, QLineEdit,
                             QListWidget, QListWidgetItem, QMenu, QMessageBox,
                             QProgressBar, QProgressDialog, QPushButton,
                             QRadioButton, QShortcut, QSizePolicy, QStyle,
                             QStyleOptionButton, QTableWidget,
                             QTableWidgetItem, QTextBrowser, QTreeWidget,
                             QTreeWidgetItem)
from scctool.settings.client_config import ClientConfig
from scctool.tasks.tasksthread import TasksThread
            from scctool.tasks.updater import extractData
            from pyupdater.client import Client
        for __ in range(10):
            QApplication.processEvents()
        self.run()

    def run(self):
        """Run the generic task."""
        try:
            self.callback(self)
        except Exception:
            module_logger.exception('message')

        self.setValue(100)
        time.sleep(0.1)


class InitialUpdater(QProgressDialog):
    """Define initial progress dialog to download data."""

    def __init__(self, version='0.0.0'):
        """Init progress dialog."""
        QProgressDialog.__init__(self)
        self.setWindowModality(Qt.ApplicationModal)
        self.progress = 0
        self.setWindowTitle("SCC-Tool")
        self.setLabelText(_("Collecting data..."))
        self.setCancelButton(None)
        self.setRange(0, 1010)
        self.setValue(50)
        self.version = version


# Path: scctool/settings/client_config.py
# class ClientConfig(object):
#     """Define PyUpdater data."""
# 
#     PUBLIC_KEY = 'AV48jKZoJOOiSR3sXdgDih6FECQOHJi5eDsWcs9psio'
#     APP_NAME = 'StarCraft-Casting-Tool'
#     COMPANY_NAME = 'team pheeniX'
#     HTTP_TIMEOUT = 30
#     MAX_DOWNLOAD_RETRIES = 3
#     UPDATE_URLS = ['https://github.com/teampheenix/SCCT-archive/raw/master/']
# 
# Path: scctool/tasks/tasksthread.py
# class TasksThread(QThread):
#     """Define generic thread for various tasks."""
# 
#     def __init__(self):
#         """Init thread."""
#         QThread.__init__(self)
# 
#         self.__tasks = {}
#         self.__run = {}
#         self.__methods = {}
#         self.__timeout = 1
#         self.__idx = 0
#         self.__wait_first = False
# 
#     def setWaitFirst(self, wait_first):
#         """Set the thread to wait first."""
#         self.__wait_first = bool(wait_first)
# 
#     def setTimeout(self, timeout):
#         """Set the timeout between tasks."""
#         self.__timeout = float(timeout)
# 
#     def addTask(self, task, method):
#         """Add a task."""
#         if(len(self.__tasks) > 5):
#             raise UserWarning("Only {} tasks allowed per thread.".format(6))
#         self.__tasks[task] = False
#         self.__methods[task] = method
# 
#     def hasActiveTask(self):
#         """Check if any task is active."""
#         return any(self.__tasks.values())
# 
#     def isActive(self, task):
#         """Check if a sepcific task is active."""
#         try:
#             return self.__tasks[task]
#         except Exception:
#             return False
# 
#     def activateTask(self, task):
#         """Activate a task."""
#         if not (task in self.__tasks):
#             raise UserWarning(
#                 "Task {} of {} is not valid.".format(
#                     task,
#                     self.__class__.__name__))
# 
#         self.__tasks[task] = True
# 
#         if not self.isRunning():
#             self.start()
# 
#     def terminate(self):
#         """Deactivate all tasks and terminate thread."""
#         for task in self.__tasks:
#             self.__tasks[task] = False
# 
#     def deactivateTask(self, task):
#         """Deactivate a Task."""
#         if not (task in self.__tasks):
#             raise UserWarning(
#                 "Task {} of {} is not valid.".format(
#                     task,
#                     self.__class__.__name__))
#         self.__tasks[task] = False
# 
#     def execTask(self, task):
#         """Execute task."""
#         self.__methods[task]()
# 
#     def execActiveTasks(self):
#         """Exectute all active tasks."""
#         executedTasks = []
#         continue_loop = True
# 
#         while continue_loop and self.hasActiveTask():
#             continue_loop = False
#             for task, active in self.__tasks.items():
#                 if active and task not in executedTasks:
#                     self.execTask(task)
#                     executedTasks.append(task)
#                     continue_loop = True
# 
#     def __wait(self):
#         if(not self.hasActiveTask()):
#             return
# 
#         cycletime = 0.1
#         cycles = int(self.__timeout / cycletime)
#         rest = max(self.__timeout - cycles * cycletime, 0.0)
# 
#         for __ in range(cycles):
#             time.sleep(cycletime)
#             if(not self.hasActiveTask()):
#                 return
#         time.sleep(rest)
# 
#     def run(self):
#         """Run the thread."""
#         module_logger.info(
#             "A {} is starting.".format(self.__class__.__name__))
# 
#         if self.__wait_first:
#             self.__wait()
# 
#         while self.hasActiveTask():
#             self.execActiveTasks()
#             self.__wait()
# 
#         module_logger.info("A {} is done.".format(self.__class__.__name__))


# Path: scctool/view/widgets.py
import logging
import os
import re
import time
import humanize
import keyboard
import requests
import scctool.matchdata
import scctool.settings.config
import scctool.settings.translation
import scctool.tasks.updater
from PyQt5.QtCore import (QMimeData, QPoint, QPointF, QSettings, QSize, Qt,
                          pyqtProperty, pyqtSignal)
from PyQt5.QtGui import (QBrush, QColor, QDrag, QIcon, QKeySequence, QPainter,
                         QPen, QRadialGradient)
from PyQt5.QtWidgets import (QAbstractButton, QAction, QApplication, QCheckBox,
                             QColorDialog, QComboBox, QCompleter, QFileDialog,
                             QFormLayout, QFrame, QGroupBox, QHBoxLayout,
                             QHeaderView, QInputDialog, QLabel, QLineEdit,
                             QListWidget, QListWidgetItem, QMenu, QMessageBox,
                             QProgressBar, QProgressDialog, QPushButton,
                             QRadioButton, QShortcut, QSizePolicy, QStyle,
                             QStyleOptionButton, QTableWidget,
                             QTableWidgetItem, QTextBrowser, QTreeWidget,
                             QTreeWidgetItem)
from scctool.settings.client_config import ClientConfig
from scctool.tasks.tasksthread import TasksThread
            from scctool.tasks.updater import extractData
            from pyupdater.client import Client

        for __ in range(10):
            QApplication.processEvents()
        self.run()

    def run(self):
        """Run the generic task."""
        try:
            self.callback(self)
        except Exception:
            module_logger.exception('message')

        self.setValue(100)
        time.sleep(0.1)


class InitialUpdater(QProgressDialog):
    """Define initial progress dialog to download data."""

    def __init__(self, version='0.0.0'):
        """Init progress dialog."""
        QProgressDialog.__init__(self)
        self.setWindowModality(Qt.ApplicationModal)
        self.progress = 0
        self.setWindowTitle("SCC-Tool")
        self.setLabelText(_("Collecting data..."))
        self.setCancelButton(None)
        self.setRange(0, 1010)
        self.setValue(50)
        self.version = version


        settings = QSettings(ClientConfig.APP_NAME, ClientConfig.COMPANY_NAME)