Détails du package smp-keepass_2.41-12_all_all.wapt
retour Revenir à la liste des packages

smp-keepass

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-keepass
version           : 2.41-12
architecture      : all
section           : base
priority          : optional
maintainer        : Simon Fonteneau
description       : Password Manager KeePass2
depends           : 
conflicts         : 
maturity          : 
locale            : all
target_os         : windows
min_os_version    : 
max_os_version    : 
min_wapt_version  : 1.6
sources           : 
installed_size    : 
impacted_process  : KeePass.exe
description_fr    : Gestionnaire de mot de passe KeePass2
description_pl    : 
description_de    : 
description_es    : 
audit_schedule    : 
editor            : Dominik Reichl
keywords          : password
licence           : GPLv2
homepage          : https://keepass.info/
package_uuid      : 4baca654-d0b5-443f-950b-dd6cf59f9cd6
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : CYc+YMrE/C3OsTzRA6wepQyc18DpLdCm0z0GzwtyqMdWPuAYHbz5DiDZLuam0BDomctlZOVDlgf2IyvK4rfIDCj0Uxe0ZB8DsggQDpgswJnQK+nC9pr+6h8Y2fPA8e7DOch7uRKKpQInnwl4RS/2p9FZJqpaAcqWJ3PhZc/sQayVcCyUQ8/p3xzzxEdIBPvjlNd/uyKAyhTP1YX7FeM3JYBT9rb0y9thqzfrOux7+U+23/jc9rssYD3mlrBLu768S/UW+kYcWytror+D3WTVPBuoNXv6otk9RPWPcvGLqwf2HNI7khNPowen9YQsP8BTk5YMSjuP0XOyv3e2bM+ZXg==
signature_date    : 20190121-185603
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes






Fichier setup.py :

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

uninstallkey = []

def install():
    print('installing keepass')
    versionpaquet = control['version'].split('-',1)[0]
    install_exe_if_needed('KeePass-%s-Setup.exe' % versionpaquet,silentflags='/VERYSILENT',key='KeePassPasswordSafe2_is1',min_version=versionpaquet,killbefore=['KeePass.exe'])

    keysoftinfo=installed_softwares('KeePassPasswordSafe2_is1')
    for info in keysoftinfo :
        installlocation = info['install_location']

    for lf in glob.glob('*.lngx'):
        if isfile(makepath(installlocation,'Languages',lf)):
            remove_file(makepath(installlocation,'Languages',lf))
        filecopyto(lf,makepath(installlocation,'Languages'))



def session_setup():

    if not isdir(makepath(application_data,'KeePass')):
        mkdirs(makepath(application_data,'KeePass'))

    config=makepath(application_data,'KeePass','KeePass.config.xml')

    loc = get_language().lower()
    if loc in list_locales:
        LanguageFile = ur"""
		<LanguageFile>%s</LanguageFile>      """ % (list_locales[loc])
    else:
        LanguageFile = ''


    if not isfile(config):
        data = ur"""<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Meta>
		<PreferUserConfiguration>false</PreferUserConfiguration>
		<OmitItemsWithDefaultValues>true</OmitItemsWithDefaultValues>
	</Meta>
	<Application>%s
		<LastUpdateCheck>2017-06-13T19:44:53Z</LastUpdateCheck>
		<LastUsedFile>
			<Path />
			<CredProtMode>Obf</CredProtMode>
			<CredSaveMode>NoSave</CredSaveMode>
		</LastUsedFile>
		<MostRecentlyUsed>
			<MaxItemCount>12</MaxItemCount>
			<Items />
		</MostRecentlyUsed>
		<WorkingDirectories />
		<Start>
			<CheckForUpdate>false</CheckForUpdate>
			<CheckForUpdateConfigured>true</CheckForUpdateConfigured>
		</Start>
		<FileOpening />
		<FileClosing />
		<TriggerSystem>
			<Triggers />
		</TriggerSystem>
	</Application>
	<Logging />
	<MainWindow>
		<X>309</X>
		<Y>81</Y>
		<Width>662</Width>
		<Height>513</Height>
		<SplitterHorizontalFrac>0.8333</SplitterHorizontalFrac>
		<SplitterVerticalFrac>0.25</SplitterVerticalFrac>
		<Layout>Default</Layout>
		<ToolBar />
		<EntryView />
		<TanView />
		<EntryListColumnCollection>
			<Column>
				<Type>Title</Type>
				<Width>90</Width>
			</Column>
			<Column>
				<Type>UserName</Type>
				<Width>90</Width>
			</Column>
			<Column>
				<Type>Password</Type>
				<Width>90</Width>
				<HideWithAsterisks>true</HideWithAsterisks>
			</Column>
			<Column>
				<Type>Url</Type>
				<Width>90</Width>
			</Column>
			<Column>
				<Type>Notes</Type>
				<Width>90</Width>
			</Column>
		</EntryListColumnCollection>
		<EntryListColumnDisplayOrder>0 1 2 3 4</EntryListColumnDisplayOrder>
		<ListSorting>
			<Order>Ascending</Order>
		</ListSorting>
	</MainWindow>
	<UI>
		<TrayIcon />
		<Hiding />
		<StandardFont>
			<Family>Microsoft Sans Serif</Family>
			<Size>8.25</Size>
			<GraphicsUnit>Point</GraphicsUnit>
			<Style>Regular</Style>
			<OverrideUIDefault>false</OverrideUIDefault>
		</StandardFont>
		<PasswordFont>
			<Family>Courier New</Family>
			<Size>8.25</Size>
			<GraphicsUnit>Point</GraphicsUnit>
			<Style>Regular</Style>
			<OverrideUIDefault>false</OverrideUIDefault>
		</PasswordFont>
		<BannerStyle>WinVistaBlack</BannerStyle>
		<DataEditorFont>
			<Family>Microsoft Sans Serif</Family>
			<Size>8.25</Size>
			<GraphicsUnit>Point</GraphicsUnit>
			<Style>Regular</Style>
			<OverrideUIDefault>false</OverrideUIDefault>
		</DataEditorFont>
		<UIFlags>0</UIFlags>
		<KeyCreationFlags>0</KeyCreationFlags>
		<KeyPromptFlags>0</KeyPromptFlags>
	</UI>
	<Security>
		<WorkspaceLocking>
			<LockAfterTime>0</LockAfterTime>
			<LockAfterGlobalTime>0</LockAfterGlobalTime>
		</WorkspaceLocking>
		<Policy />
		<MasterPassword>
			<MinimumLength>0</MinimumLength>
			<MinimumQuality>0</MinimumQuality>
		</MasterPassword>
	</Security>
	<Native />
	<PasswordGenerator>
		<AutoGeneratedPasswordsProfile>
			<GeneratorType>CharSet</GeneratorType>
			<Length>20</Length>
			<CharSetRanges>ULD_______</CharSetRanges>
		</AutoGeneratedPasswordsProfile>
		<LastUsedProfile>
			<GeneratorType>CharSet</GeneratorType>
			<Length>20</Length>
			<CharSetRanges>ULD_______</CharSetRanges>
		</LastUsedProfile>
		<UserProfiles />
	</PasswordGenerator>
	<Defaults>
		<OptionsTabIndex>4</OptionsTabIndex>
		<SearchParameters>
			<ComparisonMode>InvariantCultureIgnoreCase</ComparisonMode>
		</SearchParameters>
		<KeySources />
	</Defaults>
	<Integration>
		<HotKeyGlobalAutoType>393281</HotKeyGlobalAutoType>
		<HotKeySelectedAutoType>0</HotKeySelectedAutoType>
		<HotKeyShowWindow>393291</HotKeyShowWindow>
		<HotKeyEntryMenu>0</HotKeyEntryMenu>
		<UrlSchemeOverrides>
			<BuiltInOverridesEnabled>1</BuiltInOverridesEnabled>
			<CustomOverrides />
		</UrlSchemeOverrides>
		<AutoTypeAbortOnWindows />
		<ProxyType>System</ProxyType>
		<ProxyAuthType>Auto</ProxyAuthType>
	</Integration>
	<Custom />
</Configuration>""" % LanguageFile
    else:

        fichier = open(config, "r")
        data = fichier.read()
        fichier.close()

         #force french
        if not '<LanguageFile>' in data:
            languagefile=ur"""<Application>%s""" % LanguageFile
            data = data.replace('<Application>',languagefile)

        # disable update
        if '<CheckForUpdate>true</CheckForUpdate>' in data :
            data = data.replace('<CheckForUpdate>true</CheckForUpdate>','<CheckForUpdate>false</CheckForUpdate>')

    fichier = open(config, "w")
    fichier.write(data)
    fichier.close()


def update_package():
    import time
    import requests,urlparse

    proxies = {}
    if isfile(makepath(application_data(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxies = {'http':proxywapt,'https':proxywapt}

    url = requests.head('https://sourceforge.net/projects/keepass/files/latest/download?source=files',proxies=proxies).headers['Location']
    dstzip = requests.head(url,proxies=proxies).headers['Location']
    filename = urlparse.unquote(dstzip.rsplit('/',1)[1])


    print filename
    vers = filename.replace('KeePass-','').replace('.zip','')

    filenameexe = "KeePass-%s-Setup.exe" %vers
    dstexe = dstzip.replace(filename,filenameexe)
    print ("Latest Version : " + vers)

    exes = glob.glob('*.exe')
    for fn in exes:
        if fn != filenameexe:
            remove_file(fn)

    if not isfile(filenameexe):
        print('Downloading %s '%(filenameexe))
        wget(dstexe,filenameexe)
    else:
        print('Already up to date, skipped')

    os.chdir(os.path.dirname(__file__))

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    pe.version = vers + '-0'
    pe.save_control_to_wapt(os.getcwd())

    for lngx in glob.glob('*.lngx'):
        remove_file(lngx)

    for line in wgets('https://keepass.info/translations.html').splitlines():
        if 'KeePass-%s' % vers[:2] in line :
            lfd = line.replace('<td><a href="','').replace('" target="_blank">','')
            if not '-Help-' in lfd.rsplit('/',1)[1] :
                if not 'Portuguese_BR' in lfd.rsplit('/',1)[1] :
                    try:
                        print('Try Download %s' % lfd)
                        wget(lfd,lfd.rsplit('/',1)[1],connect_timeout=30)
                    except:
                        # Try Again
                        wget(lfd,lfd.rsplit('/',1)[1],connect_timeout=30)

                    unzip(lfd.rsplit('/',1)[1],target='.')

                    remove_file(lfd.rsplit('/',1)[1])

                    time.sleep(2)


list_locales = {
    "ar":'Arabic.lngx', # Arabic
    "ca":'Catalan.lngx', # Catalan
    "zh":'Chinese_Simplified.lngx',# Chinese - Simplified
    "zh":'Chinese_Traditional.lngx',# Chinese - Traditional
    "co":"French.lngx", # Corsican - France
    "hr":'Croatian.lngx', # Croatian
    "cs":'Czech.lngx', # Czech
    "da":'Danish.lngx', # Danish
    "nl":'Dutch.lngx', # Dutch
    "et":'Estonian.lngx', # Estonian
    "fi":'Finnish.lngx', # Finnish
    "fr":'French.lngx', # French
    "de":'German.lngx', # German - Germany
    "el":'Greek.lngx', # Greek
    "he":'Hebrew.lngx', # Hebrew
    "hu":'Hungarian', # Hungarian
    "is":'Icelandic.lngx', # Icelandic
    "id":'Indonesian.lngx', # Indonesian
    "it":'Italian.lngx', # Italian - Italy
    "ja":'Japanese.lngx', # Japanese
    "ko":'Korean.lngx', # Korean
    "lv":'Latvian.lngx', # Latvian
    "lt":'Lithuanian.lngx', # Lithuanian
    "dsb":'German.lngx',# Lower Sorbian - Germany
    "nb":'Norwegian_NB.lngx', # Norwegian - Bokmal
    "nn":'Norwegian_NB.lngx', # Norwegian - Nynorsk
    "ps":'Pashto.lngx', # Pashto - Afghanistan
    "fa":'Persian.lngx', # Persian
    "pl":'Polish.lngx', # Polish
    "pt":'Portuguese_PT.lngx', # Portuguese - Brazil
    "ro":'Romanian.lngx', # Romanian - Romania
    "ru":'Russian.lngx', # Russian
    "sr":'Serbian_Cyrillic.lngx', # Serbian
    "sk":'Slovak.lngx', # Slovak
    "sl":'Slovenian.lngx', # Slovenian
    "es":'Spanish.lngx', # Spanish - Spain
    "sv":'Swedish.lngx', # Swedish
    "tr":'Turkish.lngx', # Turkish
    "ug":'Arabic.lngx', # Arabic
    "uk":'Ukrainian.lngx', # Ukrainian
    "wen":'German.lngx',# Upper Sorbian - Germany
    "vi":'Vietnamese.lngx', # Vietnamese
}

if __name__ == '__main__':
    update_package()