# Path: persepolis/constants/Os.py
# class OS:
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     FREE_BSD = 'FreeBSD'
#     OPEN_BSD = 'OpenBSD'
#     OSX = DARWIN = 'Darwin'
#     BSD_FAMILY = [FREE_BSD, OPEN_BSD]
#     UNIX_LIKE = BSD_FAMILY + [LINUX]
#     LIST = [LINUX, WINDOWS, FREE_BSD, OPEN_BSD, OSX]
# 
# Path: persepolis/scripts/osCommands.py
# def findFileManager():
# def touch(file_path):
# def xdgOpen(file_path, f_type='file', path='file'):
# def remove(file_path): 
# def removeDir(folder_path):
# def makeDirs(folder_path, hidden=False):
# def findMountPoint(path):
# def makeTempDownloadDir(path):
# def moveFile(old_file_path, new_path, new_path_type='folder'):
#         CREATE_NO_WINDOW = 0x08000000
#             CREATE_NO_WINDOW = 0x08000000


    from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton
    from PySide6.QtCore import Qt, QSize, QPoint, QTranslator, QCoreApplication, QLocale
    from PySide6 import QtWidgets, QtCore
    from PySide6.QtGui import QIcon
    from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton
    from PyQt5.QtCore import Qt, QSize, QPoint, QTranslator, QCoreApplication, QLocale
    from PyQt5 import QtWidgets, QtCore
    from PyQt5.QtGui import QIcon
from persepolis.constants import OS
from persepolis.scripts import osCommands
import platform
import requests
import platform
import ast



# finding os_type
os_type = platform.system()


class checkupdate(QWidget):
    def __init__(self, persepolis_setting):
        super().__init__()

# defining UI
        self.persepolis_setting = persepolis_setting
        icons = ':/' + \
            str(self.persepolis_setting.value('settings/icons')) + '/'
        self.setWindowIcon(QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))

# add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        self.setWindowTitle(QCoreApplication.translate("update_src_ui_tr", 'Checking for newer version'))

        # installed version
        self.client_version = '3.20'

        # first line text

# Path: persepolis/constants/Os.py
# class OS:
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     FREE_BSD = 'FreeBSD'
#     OPEN_BSD = 'OpenBSD'
#     OSX = DARWIN = 'Darwin'
#     BSD_FAMILY = [FREE_BSD, OPEN_BSD]
#     UNIX_LIKE = BSD_FAMILY + [LINUX]
#     LIST = [LINUX, WINDOWS, FREE_BSD, OPEN_BSD, OSX]
# 
# Path: persepolis/scripts/osCommands.py
# def findFileManager():
# def touch(file_path):
# def xdgOpen(file_path, f_type='file', path='file'):
# def remove(file_path): 
# def removeDir(folder_path):
# def makeDirs(folder_path, hidden=False):
# def findMountPoint(path):
# def makeTempDownloadDir(path):
# def moveFile(old_file_path, new_path, new_path_type='folder'):
#         CREATE_NO_WINDOW = 0x08000000
#             CREATE_NO_WINDOW = 0x08000000


# Path: persepolis/scripts/update.py
    from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton
    from PySide6.QtCore import Qt, QSize, QPoint, QTranslator, QCoreApplication, QLocale
    from PySide6 import QtWidgets, QtCore
    from PySide6.QtGui import QIcon
    from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton
    from PyQt5.QtCore import Qt, QSize, QPoint, QTranslator, QCoreApplication, QLocale
    from PyQt5 import QtWidgets, QtCore
    from PyQt5.QtGui import QIcon
from persepolis.constants import OS
from persepolis.scripts import osCommands
import platform
import requests
import platform
import ast




# finding os_type
os_type = platform.system()


class checkupdate(QWidget):
    def __init__(self, persepolis_setting):
        super().__init__()

# defining UI
        self.persepolis_setting = persepolis_setting
        icons = ':/' + \
            str(self.persepolis_setting.value('settings/icons')) + '/'
        self.setWindowIcon(QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))

# add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        self.setWindowTitle(QCoreApplication.translate("update_src_ui_tr", 'Checking for newer version'))

        # installed version
        self.client_version = '3.20'

        # first line text

        self.update_label = QLabel(QCoreApplication.translate(