tis-notepadplusplus 7.4.2-7

  • package : tis-notepadplusplus
  • version : 7.4.2-7
  • description : Editeur de texte Notepad++
  • maintainer : TIS, Simon Fonteneau
  • date : 2017-07-20 11:22:22
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112222
  • min_os_version :
  • min_wapt_version :

setup.py

# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
#    This file is part of WAPT
#    Copyright (C) 2013  Tranquil IT Systems http://www.tranquil.it
#    WAPT aims to help Windows systems administrators to deploy
#    setup and update applications on users PC.
#
#    WAPT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    WAPT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with WAPT.  If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------
from setuphelpers import *
import re

uninstallkey = []

def install():
    versionpaquet = control['version'].split('-',1)[0]
    install_exe_if_needed('npp.%s.Installer.exe' % versionpaquet ,silentflags='/S',key='Notepad++',min_version=versionpaquet,killbefore=['notepad++.exe'])


def get_version(exe_filename):
    try:
        return Version(re.findall(r'npp\.(.*)\.Installer\.exe',exe_filename)[0],3)
    except:
        return Version(re.findall(r'npp\.(.*)\.Installer\.exe',exe_filename)[0])

def update_package():
    index = wgets('https://notepad-plus-plus.org/repository/7.x/')

    versions =  [ Version("%s%s"% a,3) for a in sorted(re.findall(r'alt="\[DIR\]"></td><td><a href="(\d*\.\d*)(\.\d*)?/">',index))]
    versions.sort()
    latest = versions[-1]
    canversion = Version(versions[-1])
    try:
        if canversion.members[-1] == '0':
            del canversion.members[-1]
        wget('https://notepad-plus-plus.org/repository/7.x/{canversion}/npp.{canversion}.Installer.exe'.format(version=latest,canversion=canversion),'.')
    except:
        latest = versions[-2]
        wget('https://notepad-plus-plus.org/repository/7.x/{version}/npp.{canversion}.Installer.exe'.format(version=latest,canversion=latest),'.')

    for f in glob.glob('*.exe'):
        if get_version(f) != Version(latest,3):
            remove_file(f)

    control = PackageEntry().load_control_from_wapt('.')
    control.version = "%s-%s" % (latest,control.version.split('-')[1])
    control.save_control_to_wapt('.')

if __name__ == '__main__':
    # update installer
    update_package()


    

manifest

[["WAPT/icon.png", "6337f923dc9c42234d68563a7e273f68acd1f829"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["npp.7.4.2.Installer.exe", "54f638fa6bdecedaf62770abb015fde6c2e0d6bc"], ["setup.py", "e40408cb860922045e1241d28d7d87a0ce3e9e26"], ["WAPT/control", "c58fa5994cbbb55e69361ee4ea5e3ae671949f53"], ["WAPT/changelog.txt", "e84645077fbc0aec950ae0eb1818a5a9f51f2fb4"]]