tis-calibre
5.10.0-1
Calibre (stylised calibre) is a cross-platform open-source suite of e-book software.
351360 downloads

Description
- package : tis-calibre
- version : 5.10.0-1
- architecture : x86
- categories : Office,Utilities,Media
- maintainer : Tranquil IT,Kevin Guerineau,Jimmy PELÉ
- description : Calibre (stylised calibre) is a cross-platform open-source suite of e-book software.
- locale : all
- target_os : windows
- min_wapt_version : 1.5
- sources :
- installed_size : 417738752
- impacted_process : ebook-viewer.exe, calibre.exe, calibre-parallel.exe, lrfviewer.exe
- description_fr : calibre est un gestionnaire de bibliothèques numériques permettant la visualisation, la conversion, le catalogage et l'édition de livres numériques dans les principaux formats disponibles.
- description_pl :
- description_de :
- description_es :
- description_pt :
- description_it :
- description_nl :
- description_ru :
- editor : Kovid Goyal
- licence : GPLv3
- signature_date : 2021-01-22T15:24:38.133821
- Homepage : https://calibre-ebook.com
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
uninstallkey = []
# Declaring specific app values (TO CHANGE)
bin_name_string = 'calibre-%s.msi'
url_dl = 'https://calibre-ebook.com/dist/win32'
def install():
print('installing %s' % control.asrequirement())
# Specific app values
#package_version = control.get_software_version() # Do not use for now
package_version = control.version.split('-',1)[0]
impacted_process = control.impacted_process
# Getting the used storage on programfiles before installation (place it on the top)
get_disk_free_space_before = get_disk_free_space(programfiles)
for soft in installed_softwares("calibre"):
run_notfatal(uninstall_cmd(soft['key']))
install_msi_if_needed(bin_name_string % package_version
,min_version=package_version)
# Return used storage of the installation. (place it on the bottom)
get_disk_free_space_after = get_disk_free_space(programfiles)
free_space_after_diff = get_disk_free_space_before - get_disk_free_space_after
print ("Storage used: " + str(free_space_after_diff))
def update_package():
print('Update package content from upstream binary sources')
import requests,re
from waptpackage import PackageEntry
# Update transition from BeautifulSoup 3 to 4
try:
import BeautifulSoup
except:
import bs4 as BeautifulSoup
# Specific app values
app_name = control.name
url_gh = 'https://github.com/kovidgoyal/calibre/releases'
# Initializing variables
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
# Get latest version number from official website
page = requests.get(url_gh + '/latest',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},proxies=proxies).text
bs = BeautifulSoup.BeautifulSoup(page)
# bs = BeautifulSoup.BeautifulSoup(page,features="html.parser") # For bs4 only
bs_raw_string = str(bs.find('span',{'class':'css-truncate-target'}).text)
vversion = bs_raw_string
version = vversion.replace('v','')
print('Latest ' + app_name + ' version is: ' + version)
latest_bin = bin_name_string % version
# Downloading latest binaires
if not isfile(latest_bin):
print('Downloading ' + latest_bin)
wget(url_dl,latest_bin,proxies=proxies)
# Change version of the package
print ('Writing ' + version + '-0 in WAPT\\control')
pe = PackageEntry()
pe.load_control_from_wapt(os.getcwd())
pe.version = version + '-0'
pe.save_control_to_wapt(os.getcwd())
print ('Update package done. You can now build-upload your package')
else:
print ('This package is already up-to-date')
# Deleting outdated binaries
for actual_bin in glob.glob('*.exe') or glob.glob('*.msi'):
if actual_bin != latest_bin :
print('Outdated binary: ' + actual_bin + ' Deleted')
remove_file(actual_bin)
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
if __name__ == '__main__':
update_package()