tis-projectlibre 1.7-1

  • package : tis-projectlibre
  • version : 1.7-1
  • description : OpenProj / ProjectLibre project management Ouvre fichiers msproject
  • maintainer : Tranquil IT Systems
  • date : 2018-02-27 19:06:55
  • Depends :

setup.py

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

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

software_name = "ProjectLibre"

def update_control(entry):
    # use last msi to get the version
    msi_list = glob.glob('*.msi')
    if msi_list:
        entry.version = get_msi_properties(msi_list[-1])['ProductVersion']

def install():
    # list all msi in package
    versionsoft = control['version'].split('-',1)[0]

    if iswin64():
        msi = "projectlibre-%s-x64.msi" % versionsoft
        install_msi_if_needed(msi,min_version=versionsoft,killbefore=['ProjectLibre'])
    else:
        msi = "projectlibre-%s.msi" % versionsoft
        install_msi_if_needed(msi,min_version=versionsoft,killbefore=['ProjectLibre'])


def session_setup():
    exe = makepath(programfiles32,'ProjectLibre','ProjectLibre.exe')
    create_programs_menu_shortcut('ProjectLibre',exe)


def update_package():
    import BeautifulSoup,requests,re
    from waptpackage import PackageEntry
    verify=True
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]

    base_url = "https://sourceforge.net/projects/projectlibre/files/ProjectLibre/?SetFreedomCookie"

    page = requests.get(base_url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; en-US; Win64; x64)'},verify=verify).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_raw_string = str(bs.find('div',{'id':'files'}).find('div',{'class':'download-bar'}).find('strong').find('a',{'href':'/projects/projectlibre/files/latest/download?source=files'}).find('span').text)
    software_version = re.findall('Download projectlibre-(.*).msi *',str(bs_raw_string))[0]
    print software_version

    print "Current %s WAPT package version is : %s" % (software_name,current_version)
    print "Latest %s version available is : %s" % (software_name,software_version)

    if Version(current_version) < Version(software_version):
        print("%s package is not up-to-date, updating" % software_name)
        print("Cleanup current files")

        filename = "projectlibre-%s.msi" % software_version
        filename64 = "projectlibre-%s-x64.msi" % software_version

        for msi in glob.glob('*.msi'):
            if msi not in {filename,filename64}:
                remove_file(msi)

        print("Downloading latest version")
        download_url = 'https://freefr.dl.sourceforge.net/project/projectlibre/ProjectLibre/%s/projectlibre-%s.msi' % (software_version,software_version)
        download_url64 = 'https://freefr.dl.sourceforge.net/project/projectlibre/ProjectLibre/%s/projectlibre-%s-x64.msi' % (software_version,software_version)
        wget(download_url,filename)
        wget(download_url64,filename64)

        pe.version = software_version + '-0'
        pe.save_control_to_wapt(os.getcwd())
    else:
        print("No update needed, package already up to date")

if __name__ == "__main__":
    update_package()




    

Changelog

No changelog
    

manifest.sha256

[["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["projectlibre-1.7-x64.msi", "83f2dfc72d0e6732cdef4fb20ba6cadf8576def9cec6353c6152af614a531781"], ["projectlibre-1.7.msi", "1f45e864097bd887f1141f9a8433cec3fb35900acef43269d16e6da4f3336195"], ["setup.py", "2c01032b226d48d686facf901d4eba5504a66f300cb77358ccc463f511bd35ce"], ["WAPT/control", "c406aea7d5d7365ddda36e92cacd3cc56be2814a08baf986a817ef68aa4faff1"]]