tis-zotero

5.0.95.1-10
Zotero is a free and open-source reference management software to manage bibliographic data and related research materials
124 downloads
Download

  Description 

  • package : tis-zotero
  • version : 5.0.95.1-10
  • architecture : all
  • categories : Utilities
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
  • description : Zotero is a free and open-source reference management software to manage bibliographic data and related research materials
  • locale : all
  • target_os : windows
  • min_os_version : 6.1
  • max_os_version :
  • min_wapt_version : 1.7
  • sources : https://www.zotero.org/download/
  • installed_size : 116416512
  • impacted_process : zotero
  • description_fr : Zotero est un logiciel de gestion de références gratuit, libre et open source, il permet de gérer des données bibliographiques et des documents de recherche
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Corporation for Digital Scholarship
  • licence : AGPL
  • signature_date : 2021-01-26T14:03:26.340986
  • Homepage : https://www.zotero.org/

  Setup.py 

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

uninstallkey = []

# Defining variables
bin_name_string = 'Zotero-%s_setup.exe'
silent_args = '-ms'
app_uninstallkey = 'Zotero %s (x86 en-US)'

def install():
    # Specific app values
    package_version = control.version.split('-')[0]

    # Installing the package
    print('Installing: %s' % bin_name)
    install_exe_if_needed(bin_name_string % package_version
        ,silentflags=silent_args
        ,key=app_uninstallkey % package_version
        ,min_version=package_version)


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = 'https://www.zotero.org/download/'
    
    # Getting latest version from official sources
    print('URL used is: %s' % url)
    for bs_search in bs_find_all(url, 'script', 'type', 'text/javascript', proxies=proxies):
        temp_str = str(bs_search)
        if 'win32' in temp_str:
            dict_version = json.loads(temp_str.split(':', 1)[-1].split('\n', 1)[0].split('}')[0] + '}')
            version = dict_version['win32']
            latest_bin = bin_name_string % version
            url_dl = 'https://www.zotero.org/download/client/dl?channel=release&platform=win32&version=%s' % version
            break
    
    # Downloading latest binaries
    if not isfile(latest_bin):
        print('Downloading: ' + bin_name_string % version)
        wget(url_dl, latest_bin, proxies=proxies)

		# Change version of the package
        pe = PackageEntry().load_control_from_wapt('.')
        pe.version = '%s-%s'%(version,int(pe.version.split('-',1)[1])+1)
        pe.save_control_to_wapt('.')
        print('Changing version to ' + pe.version + ' in WAPT\\control')
        print('Update package done. You can now build-upload your package')
    else:
        print('This package is already up-to-date')

     # Deleting outdated binaries
    for bin_in_dir in glob.glob('*.exe') or glob.glob('*.msi') or glob.glob('*.zip'):
        if bin_in_dir != latest_bin :
            print('Outdated binary: ' + bin_in_dir + ' Deleted')
            remove_file(bin_in_dir) 


def get_proxies():
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_proxies_from_wapt_console():
    proxies = {}
    if platform.system() == 'Windows':
        waptconsole_ini_path = makepath(user_local_appdata(), 'waptconsole', 'waptconsole.ini')
    else:
        waptconsole_ini_path = makepath(user_home_directory(), '.config', 'waptconsole', 'waptconsole.ini')
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, 'global', 'http_proxy')
        if proxy_wapt:
            proxies = {'http': proxy_wapt, 'https': proxy_wapt}
    return proxies


def bs_find_all(url, element, attribute=None, value=None, headers=None, proxies=None, features='html.parser', **kwargs):
    """"You may need to use a header for some websites. For example: headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
    """
    import requests
    page = requests.get(url, proxies=proxies, headers=headers, **kwargs).text
    try:
        import bs4 as BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page, features=features)
    except:
        import BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page)
    if value:
        return soup.findAll(element,{attribute:value})
    else:
        return soup.findAll(element)




										

  Changelog 


Changelog software url : https://www.zotero.org/support/changelog

No changelog
  manifest.sha256 
[["setup.py","585e5e990e1135c78b29e898a198553fcdbd7e37ffa283cf418cbd4a9e8d1c97"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/icon.png","499ad46227d2de56044d89085ff174a347b8ccca7b2e59823cdca9eaca6090f7"],["Zotero-5.0.95.1_setup.exe","085f5d44dc239dd8c90e9d2d17f381ec018390c88dfaedc59b923b13462c4c98"],["WAPT/control","10b05a74a3f57ce7cb4b3a03c84126843e15fdbe332edb9c405ed176935ee481"]]