tis-cudatext icon

CudaText

Paquet d’installation silencieuse pour CudaText

1.177.1.0-5
Development
Development

  • package: tis-cudatext
  • name: CudaText
  • version: 1.177.1.0-5
  • 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.70 Mo
  • installed_size: 28.18 Mo
  • homepage : http://uvviewsoft.com/cudatext/

package           : tis-cudatext
version           : 1.177.1.0-5
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      : 1857a34a-8a86-4251-8938-d0bd873204ba
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_date    : 2024-10-19T17:06:30.000000
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
signature         : oCl6CO9codaJ/8ySNO0xx7ewFdsSDS6O82wGwDIwhUHh7qbLWmZ06UqE0xlw1bHwAsug9C10UpbXrfgCwDWLR+zewBCNgriEDRNlVrL/H2V6bpOV35r83kg2AOW0zY/7TgKOeasrlDHJrokBAkYdxPW77ep4OyWM8GgEI+6276T+qd709SJFxz58loZOYBcLWLKoDBp2MLaIEXezogUfhh5CeFZOr6SNlEFFy61rcVj5EA+rxU/Ayb08pxG0MvhrQkMMz0mdYu2BykuXqTc7ZJguPyML0rr+G9+XkeTz2HIBaQHN/pahh7mJ3RNH23ywr19naFDULa9O6GeaTiXMFw==

# -*- 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")
app_settings = makepath(app_dir, "settings")


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)
    mkdirs(app_settings)
    run(f'icacls "{app_settings}" /grant "Authenticated Users":(OI)(CI)(RX,W)')
    run(f'icacls "{app_settings}" /grant "Users":(OI)(CI)(RX,W)')
    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 *
import time

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()
    time.sleep(5)
    return rj["data"]["url"]

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
9c21a70c51d8cc7a8886415dd1c17d5e3af408d21a06f470ccbe9045f9061860 : WAPT/control
ea2383e906352851706a5f4f96ee2947ce3a3aa9a9811bb519da7957af26dd8c : WAPT/icon.png
0881a33779707815c78b45634788ef1b4cd2ebbe2ab0788953fc883336aa88a7 : cudatext-win-x32-1.177.1.0.zip
a0fdb56e719faf15523df0f743e58deb358793504c7fc7a343542a0528372149 : luti.json
7b20e01bafe0132e372ba93e3ef80245080280720cb383f2397652f35eb15724 : setup.py
59639c203245372a92c49d4af6edca5583858cf60a7f0fd35ae4059c783b0b20 : update_package.py