tis-pdfsam

4.2.1-5
PDFsam Basic or PDF Split and Merge is a free and open-source cross-platform desktop application to split, merge, extract pages, rotate and mix PDF documents.
4759 downloads
Download

  Description 

  • package : tis-pdfsam
  • version : 4.2.1-5
  • architecture : x64
  • categories : Utilities,Office
  • maintainer : WAPT Team,Jimmy PELÉ
  • description : PDFsam Basic or PDF Split and Merge is a free and open-source cross-platform desktop application to split, merge, extract pages, rotate and mix PDF documents.
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.5
  • sources : https://github.com/torakiki/pdfsam/releases
  • installed_size : 131706880
  • impacted_process :
  • description_fr : PDFsam Basic ou PDF Split and Merge est un logiciel libre multiplateforme pour diviser, fusionner, extraire des pages, faire pivoter et associer des documents PDF.
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Andrea Vacondio
  • licence : AGPLv3
  • signature_date : 2020-11-20T12:33:42.400570
  • Homepage : https://pdfsam.org/

  Setup.py 

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

uninstallkey = []

# Installation procedure: https://github.com/torakiki/pdfsam/wiki/Properties-and-arguments

# Defining variables
bin_name_string = 'pdfsam-%s.msi'
silent_args = 'PREMIUM_MODULES=false CHECK_FOR_NEWS=false CHECK_FOR_UPDATES=false SKIPTHANKSPAGE=true DONATE_NOTIFICATION=false PLAY_SOUNDS=false'


def install():
    # Initializing variables
    package_version = control.version.split('-',1)[0]
    bin_name = bin_name_string % package_version

    # Installing the package
    print('Installing: %s' % bin_name)
    install_msi_if_needed(bin_name,
        properties=silent_args,
        min_version=package_version)

    remove_desktop_shortcut('PDFsam Basic')


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

    # Initializing variables
    proxies = get_proxies()
    app_name = control.name
    url_api = 'https://api.github.com/repos/torakiki/pdfsam/releases/latest'

    # Getting latest informations from Github API
    json_load = json.loads(wgets(url_api,proxies=proxies))
    for download in json_load['assets']:
        if download['browser_download_url'].endswith('.msi'):
            url_dl = download['browser_download_url']
            break

    version = json_load['tag_name'].replace('v','')
    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: ' + 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 get_proxies():
    import platform
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_version_from_binary(filename):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)['ProductVersion']
    else:
        return get_file_properties(filename)['ProductVersion']


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)

										

  Changelog 



No changelog.txt.
									
  manifest.sha256