tis-seafile 6.0.6-1

  • package : tis-seafile
  • version : 6.0.6-1
  • description : Windows client for cloud file storage Seafile (HaiWenHuZhi ltd.), Desinstallation non silencieuse.
  • maintainer : Hubert TOUVET, Amelie LE JEUNE
  • date : 2017-07-20 11:24:11
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112410
  • min_os_version :
  • min_wapt_version :

setup.py

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

# registry key(s) where WAPT will find how to remove the application(s)
uninstallkey = []

def install():
    for fn in glob.glob('*.msi'):
        install_msi_if_needed(fn,killbefore = ['seaf-daemon','seafile-applet'])

def update_control(control):
    package_version = control.version.split('-')[1]
    for fn in glob.glob('*.msi'):
        control.version = "%s-%s" % (fn.split('-')[1],package_version)

def update_package():
    import re
    index = wgets('https://www.seafile.com/en/download/')
    re_versions = re.compile('<a href="https://bintray.com/artifact/download/seafile-org/seafile/seafile-([\d\.]*)-en.msi"')
    # find latest
    last_version = sorted(re_versions.findall(index))[-1]
    print last_version
    download_url = 'https://bintray.com/artifact/download/seafile-org/seafile/seafile-%s-en.msi' % last_version
    localfile = 'seafile-%s-en.msi' % last_version
    if not isfile(localfile):
        wget(download_url,localfile)

    # recup changelog
    #from BeautifulSoup import BeautifulSoup
    #bs = BeautifulSoup(wgets('https://seacloud.cc/group/3/wiki/client-changelog'))

    # removes old msi
    msis = glob.glob('*.msi')
    for fn in msis:
        if fn != localfile:
            remove_file(fn)


    # change version of package
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = get_msi_properties('seafile-%s-en.msi' % last_version)['ProductVersion']+'-0'
    pe.save_control_to_wapt(os.getcwd())


if __name__ == '__main__':
    update_package()


    

manifest

[["WAPT/icon.png", "f25eb08542d55efb4326e07173514eaeeb120ece"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["seafile-6.0.6-en.msi", "b1aeff880d31b10aafce1b80c3ccfa511222dcd3"], ["setup.py", "adfae91872fb3669a5e993272c4544c48d6f0834"], ["WAPT/control", "9a34722ad96b24bf388733def4487f5ddbdd082e"], ["WAPT/changelog.txt", "15e5343efd0b43b03cc3f3b55c5ba59b91d435a2"]]