tis-pdfsam

4.1.4-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.
3708 downloads
Download

  Description 

  • package : tis-pdfsam
  • version : 4.1.4-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_os_version : 6.0
  • max_os_version :
  • 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-10-13T15:38:54.267909
  • 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
  manifest.sha256 
[["pdfsam-4.1.4.msi","8fb5f22885bafeded489a57e278f6cea77a96aa36529cc4f9b3da84479215852"],["setup.py","f2e426d8ac2ea50b23e8608fb251e97ec48e180d86d9423c75be89815b1daa6f"],["WAPT/icon.png","7332a01aa80f667ce3cd79545bc9d3974baabe25bc7bc476deaee6bf5df4ad11"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/control","f4f32691bfbb385ec501198c7b86b471f4ce6a4fcb04d6d96d67b2b36565eb3b"]]