tis-cudatext icon

CudaText

Silent install package for CudaText

1.178.0.0-4

  • package: tis-cudatext
  • name: CudaText
  • version: 1.178.0.0-4
  • categories: Development
  • maintainer: WAPT Team, Tranquil IT, Jimmy PELÉ
  • editor: Alexey Torgashin (alexey_t), Andrey Kvichanskiy (kvichans)
  • licence: MPL 2.0
  • locale: all
  • target_os: windows
  • impacted_process: cudatext
  • architecture: x86
  • signature_date:
  • size: 14.45 Mo
  • installed_size: 28.18 Mo
  • homepage : http://uvviewsoft.com/cudatext/

package           : tis-cudatext
version           : 1.178.0.0-4
architecture      : x86
section           : base
priority          : optional
name              : CudaText
categories        : Development
maintainer        : WAPT Team, Tranquil IT, Jimmy PELÉ
description       : CudaText is a free open source cross-platform native GUI text and source code editor
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://www.fosshub.com/CudaText.html
installed_size    : 28180480
impacted_process  : cudatext
description_fr    : CudaText est un éditeur de texte et de code source libre et ouvert, à interface graphique native et multiplateforme
description_pl    : CudaText jest darmowym, otwartym, międzyplatformowym, natywnym edytorem tekstu i kodu źródłowego GUI
description_de    : CudaText ist ein freier, plattformübergreifender, nativer GUI-Text- und Quellcode-Editor
description_es    : CudaText es un editor de texto y código fuente nativo de código abierto y multiplataforma
description_pt    : CudaText é um editor de código fonte e texto GUI nativo de código fonte de código aberto gratuito
description_it    : CudaText è un editor di testo e di codice sorgente open source multipiattaforma con interfaccia grafica nativa
description_nl    : CudaText is een gratis open source cross-platform native GUI tekst en broncode editor
description_ru    : CudaText - это бесплатный кроссплатформенный кроссплатформенный редактор текста и исходного кода с графическим интерфейсом с открытым исходным кодом
audit_schedule    : 
editor            : Alexey Torgashin (alexey_t), Andrey Kvichanskiy (kvichans)
keywords          : 
licence           : MPL 2.0
homepage          : http://uvviewsoft.com/cudatext/
package_uuid      : f81fbc49-baa5-4d3d-82ee-a8e83f91d38d
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : http://uvviewsoft.com/cudatext/history.txt
min_os_version    : 5.1
max_os_version    : 
icon_sha256sum    : ea2383e906352851706a5f4f96ee2947ce3a3aa9a9811bb519da7957af26dd8c
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : A1YYJxCzXEpeqYE6D1Z7QVvvdts+3S1FSWdStbxfCGMYAyqS9JBKA7IDdzuR03OsHY6KBVdKHACsAFguBQ8djMSxszZ+snUdJjxdvC5DzIZa3vgNDm5hAFgNDL8Q2NYTy8d0qJX4H+jyJ/KEKGd4oQ7BAgSzgJ9RZmXFY6tVG1s0s9BChK6kJYqF2K5xcCZGlVtbJry1YseciqrdcMb66Ae1J/Sqqxi9dPRTJymrAaw6z+OqKQSkd+mrQUlx3AoaXgLzjD1C9Ow7kLWIJObBJzq74AMKfV6h5j1rTMIX+EFP/lW/Z1UndiUQLd2MYuk6uQuE45ULrbJ38YR6qVI20g==
signature_date    : 2022-12-01T16:01:50.292576
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 *

# Defining variables
bin_name_string = "cudatext-win-x32-%s.zip"
dl_file_type = "win x32"
app_name = "CudaText"
app_dir = makepath(programfiles, app_name)
app_bin = makepath(app_dir, "cudatext.exe")


def install():
    # Initializing variables
    package_version = control.version.split("-", 1)[0]
    bin_name = "cudatext-win-x32-%s.zip" % package_version
    processes_to_kill = control.impacted_process.split(",")

    # Installing the package
    print("Installing: %s" % bin_name)
    killalltasks(processes_to_kill)
    if isdir(app_dir):
        remove_tree(app_dir)
    unzip(bin_name, target=app_dir)
    create_programs_menu_shortcut(app_name, app_bin)


def uninstall():
    # Uninstalling the package
    remove_tree(app_dir)
    remove_programs_menu_shortcut(app_name)

# -*- coding: utf-8 -*-
from setuphelpers import *

def update_package():
    print("Downloading/Updating package content from upstream binary sources")

    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    bin_name_string = "cudatext-win-x32-%s.zip"
    app_name = control.name
    url = control.sources

    # Getting latest version from official website
    print("URL used is: " + url)
    url_dl = get_download_url_from_fosshub(url, file_type="win x32", proxies=proxies)
    version = bs_find(url, "dd", "itemprop", "softwareVersion", proxies=proxies).text
    latest_bin = bin_name_string % version

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

    # 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 version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version, list_extensions=bin_name_string.split("."[-1]))


def get_download_url_from_fosshub(url, file_type="64-bit Windows Installer", proxies=None):
    import json
    import requests

    url_api_fosshub = "https://university.fosshub.com/projects.json"

    for script in bs_find_all(url, "script", proxies=proxies):
        if (len(script.contents) >= 1) and ("var settings" in script.contents[0]):
            var_settings = script.contents[0].replace("\n  var settings =", "").replace("\n", "")
            break

    for readapifosshub in json.loads(wgets(url_api_fosshub, proxies=proxies))["projects"]:
        if readapifosshub["url"].endswith(url.split("//")[-1]):
            for filename in readapifosshub["files"]:
                if filename["type"] == file_type:
                    file_name = filename["name"]

    settings = json.loads(var_settings)

    apiUrl = "https://api." + settings["domain"]
    downloadUrl = apiUrl + "/download/"

    def forming_fosshub_url(a, b, c, d, e):
        params = {"projectId": a, "releaseId": b, "projectUri": c, "fileName": d, "source": e}
        r = requests.post(downloadUrl, data=params, proxies=proxies)
        return r

    pool = settings["pool"]
    f = pool["f"]

    for c in f:
        r = forming_fosshub_url(pool["p"], c["r"], pool["u"], file_name, pool["c"])

    r = forming_fosshub_url(pool["p"], c["r"], pool["u"], file_name, pool["c"])
    rj = r.json()
    return rj["data"]["url"]

632397852455931dfcfcb4a1f63c205da43ffc8f4809a3ec06bf858157e3f1dc : setup.py
02a8655f39eedee793c1b86199083acadc6ec4b93cb47211c5daa72f9a26859b : cudatext-win-x32-1.178.0.0.zip
ad176d22ebb6819c423af4d333c77156810bc77a86603a1e1ef2c5aed443028c : update_package.py
ea2383e906352851706a5f4f96ee2947ce3a3aa9a9811bb519da7957af26dd8c : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
6a451e520046dec756dbeaa8d6274d14e719e2f8b47c892648a338a186efea87 : luti.json
70ecfcd8f65a1b932d4b68d6ff1f74245f120a2824d06a05dc61f8fd29fdd78e : WAPT/control