tis-gajim

1.3.3-7
Gajim is an open source instant messaging client for the Jabber open standard network
7432 downloads
Download
See build result See VirusTotal scan
tis-gajim icon
  • package : tis-gajim
  • name : Gajim
  • version : 1.3.3-7
  • categories : Utilities
  • maintainer : WAPT Team,Tranquil IT,Kenan KILICARSLAN,Jimmy PELÉ
  • editor : Gajim team
  • licence : GPL3
  • locale : all
  • target_os : windows
  • impacted_process : Gajim,Gajim-Debug,gajim-history-manager
  • architecture : x86
  • signature_date : 2022-04-26 04:22
  • size : 49.92 Mo
  • homepage : https://gajim.org/
package           : tis-gajim
version           : 1.3.3-7
architecture      : x86
section           : base
priority          : optional
name              : Gajim
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Kenan KILICARSLAN,Jimmy PELÉ
description       : Gajim is an open source instant messaging client for the Jabber open standard network
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 1.7
sources           : https://gajim.org/download/
installed_size    : 
impacted_process  : Gajim,Gajim-Debug,gajim-history-manager
description_fr    : Gajim est un logiciel libre client de messagerie instantanée pour le réseau standard ouvert Jabber
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Gajim team
keywords          : messaging,network,standard,jabber
licence           : GPL3
homepage          : https://gajim.org/
package_uuid      : 25bd8d3d-c109-478c-b893-7dc2807b653b
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://dev.gajim.org/gajim/gajim/-/blob/master/ChangeLog
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : 4023938ece24bd58a70ae58c920b41598f19ab41734a47869ebf2fc4bac50df5
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : uYDu7m2WjLbPbsaE0V8St7PeOhdb3nIuQjyYMPEKkQzZAH4peZ3k9aHbiHyP+UFZI58ePm9XDxd+su0f3Q7SDaYTPpKbcgJdWaMznJt4rVNuBo0Wefdsk25wkXhoyRo90Hs2IJvqAnZCAkNx1N7SHkKJgvrfefTiNLtkACaZEfGcagMH4z8Jjug/0jbPC6dFpC2ydA+4S/AhOii0g2aGtXEIpmRs30slAw7dOSyxxneM/hN2ROysIf+DM2MJmd525WYsLeSk8+EsokfTGdgC6weJFLablbFj8mUGGGQ5wsimU8feKbhIH+1PiM7dD5hMPealhd/Zh8I5G7rAzcNizw==
signature_date    : 2022-04-26T04:22:19.168252
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
import time

uninstallkey = []

# Defining variables
bin_name_string = "Gajim-%s-32bit.exe"
silent_args = "/S"
app_uninstallkey = "Gajim"
bin_path = makepath(programfiles, "Gajim", "bin", "Gajim.exe")


def install():
    # Initializing variables
    package_version = control.version.split("-")[0]
    bin_name = bin_name_string % package_version
    # get version from binary if exist
    if isfile(bin_path):
        version = get_version_from_binary(bin_path)
        # Uninstalling older versions of the software
        if version < control.get_software_version() or force:
            for uninstall in installed_softwares(name=r"\bGajim\b"):
                print("Removing: %s (%s)" % (uninstall["name"], version))
                run(uninstall_cmd(uninstall["key"]))
                wait_uninstallkey_absent(uninstall["key"])

    def get_version_bin(key):
        return get_file_properties(bin_path)["ProductVersion"]

    # Installing the package
    print("Installing: %s" % bin_name)
    install_exe_if_needed(bin_name, silentflags=silent_args, key=app_uninstallkey, min_version=package_version, get_version=get_version_bin)


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = "https://gajim.org/download/"
    bin_end = ".exe"
    if control.architecture == "x86":
        arch = "32bit"
    else:
        arch = "64bit"

    # Getting latest version from official sources
    print("URL used is: %s" % url)
    for bs_search in bs_find_all(url, "a", "class", "dropdown-item", proxies=proxies):
        if bs_search["href"].endswith(bin_end) and arch in bs_search["href"]:
            version = bs_search["href"].split("-")[1]
            # latest_bin = bs_search['href'].split('/')[-1]
            latest_bin = bin_name_string % version
            url_dl = bs_search["href"]
            break

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)
    get_version_from_binary(
        latest_bin,
    )
    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Changing version of the package
        control.version = "%s-%s" % (version, int(control.version.split("-")[-1]) + 1)
        control.save_control_to_wapt()
        print("Changing package version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)


def wait_uninstallkey_absent(key=None, max_loop=120):
    loop = 0
    while uninstall_key_exists(key):
        loop = loop + 1
        if loop > max_loop:
            return "timout"
        time.sleep(1)


def get_proxies():
    if platform.python_version_tuple()[0] == "3":
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_proxies_from_wapt_console():
    proxies = {}
    if platform.system() == "Windows":
        waptconsole_ini_path = makepath(user_local_appdata(), "waptconsole", "waptconsole.ini")
    else:
        waptconsole_ini_path = makepath(user_home_directory(), ".config", "waptconsole", "waptconsole.ini")
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, "global", "http_proxy")
        if proxy_wapt:
            proxies = {"http": proxy_wapt, "https": proxy_wapt}
    return proxies


def get_version_from_binary(filename, parameter="ProductVersion"):
    if filename.endswith(".msi"):
        return get_msi_properties(filename)[parameter]
    else:
        return get_file_properties(filename)[parameter]


def remove_outdated_binaries(version, list_extensions=["exe", "msi", "deb", "rpm", "dmg", "pkg"], list_filename_contain=None):
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if list_filename_contain:
        if type(list_filename_contain) != list:
            list_filename_contain = [list_filename_contain]
    list_extensions = ["." + ext for ext in list_extensions if ext[0] != "."]
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob("*%s" % file_ext):
            if not version in bin_in_dir:
                remove_file(bin_in_dir)
            if list_filename_contain:
                for filename_contain in list_filename_contain:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)


def bs_find(url, element, attribute=None, value=None, user_agent=None, proxies=None, features="html.parser", **kwargs):
    """ "You may need to use a user agent for some websites.
    Example: user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0')
    """
    if user_agent:
        page = requests.get(url, proxies=proxies, headers={"User-Agent": "%s" % user_agent}, **kwargs).text
    else:
        page = requests.get(url, proxies=proxies, **kwargs).text
    soup = BeautifulSoup.BeautifulSoup(page, features=features)
    if value:
        return soup.find(element, {attribute: value})
    else:
        return soup.find(element)


def bs_find_all(url, element, attribute=None, value=None, headers=None, proxies=None, features="html.parser", **kwargs):
    """ "You may need to use a header for some websites. For example: headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}"""
    import requests

    page = requests.get(url, proxies=proxies, headers=headers, **kwargs).text
    try:
        import bs4 as BeautifulSoup

        soup = BeautifulSoup.BeautifulSoup(page, features=features)
    except:
        import BeautifulSoup

        soup = BeautifulSoup.BeautifulSoup(page)
    if value:
        return soup.findAll(element, {attribute: value})
    else:
        return soup.findAll(element)
5161bb8520be1d76a7836f3ec1fcbe59ed09faa888700d4f599fce4bc3d52eaf : setup.py
9a15f608dfc6a45710b222263e2e756cbd048e9f00a0b53d056a87348543f93a : Gajim-1.3.3-32bit.exe
4023938ece24bd58a70ae58c920b41598f19ab41734a47869ebf2fc4bac50df5 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
2aaf71f0910fed720bd26d3839b45a149fb50daa5d66c28cde1257ec923f0fd4 : luti.json
4ffcfe8bb05125cb895e4f37696664ce9629fdc3aef045318d6ded1717545eb5 : WAPT/control