This repository has been archived on 2019-02-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
WAPT/kg-qownnotes-wapt/setup.py
T
2019-01-13 20:35:12 +01:00

62 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print('installing %s' % control.asrequirement())
if iswin64():
qownnotes_path = makepath(programfiles32,'QOwnNotes')
else:
qownnotes_path = makepath(programfiles,'QOwnNotes')
mkdirs(qownnotes_path)
copytree2('QOwnNotes',qownnotes_path,onreplace=default_overwrite)
create_desktop_shortcut('QOwnNotes',qownnotes_path + '\QOwnNotes.exe')
# put here what to do when package is installed on host
# implicit context variables are WAPT, basedir, control, user, params, run
def uninstall():
print('uninstalling %s' % control.asrequirement())
# put here what to do when package is removed from host
# implicit context variables are WAPT, control, user, params, run
if iswin64():
qownnotes_path = makepath(programfiles32,'QOwnNotes')
else:
qownnotes_path = makepath(programfiles,'QOwnNotes')
remove_desktop_shortcut('QOwnNotes')
remove_tree(qownnotes_path)
def session_setup():
print('Session setup for %s' % control.asrequirement())
# put here what to do when package is configured inside a user session
# implicit context variables are WAPT, control, user, params
def update_package():
import BeautifulSoup, re, requests
url = "https://www.qownnotes.org/installation#Windows"
page = wgets(url,user_agent='Mozilla/5.0 (Windows NT 6.1; Win64; x64)')
bs = BeautifulSoup.BeautifulSoup(page)
print (bs)
version = bs.find('a')
print('Update package content from upstream binary sources')
if __name__ == '__main__':
update_package()