From ea432e6f2cb928b548683571fd2ce36f6b1e6d1c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 10 Dec 2018 17:42:04 +0100 Subject: [PATCH] Adapt for TB x64 --- WAPT/control | 2 +- setup.py | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/WAPT/control b/WAPT/control index 21688ad..5cb1441 100644 --- a/WAPT/control +++ b/WAPT/control @@ -1,5 +1,5 @@ package : fws-thunderbird-config -version : 4 +version : 5 architecture : all section : base priority : optional diff --git a/setup.py b/setup.py index 1498533..6f65c52 100644 --- a/setup.py +++ b/setup.py @@ -17,20 +17,16 @@ if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(m f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) -install_dir = programfiles -if iswin64(): - install_dir = programfiles32 - def install(): - filecopyto('autoconf.js', makepath(install_dir,'Mozilla Thunderbird','defaults','pref')) - if not isdir(makepath(install_dir, 'Mozilla Thunderbird','chrome')): - mkdirs(makepath(install_dir, 'Mozilla Thunderbird','chrome')) - filecopyto('custom-strings.txt', makepath(install_dir,'Mozilla Thunderbird','chrome')) + filecopyto('autoconf.js', makepath(programfiles,'Mozilla Thunderbird','defaults','pref')) + if not isdir(makepath(programfiles, 'Mozilla Thunderbird','chrome')): + mkdirs(makepath(programfiles, 'Mozilla Thunderbird','chrome')) + filecopyto('custom-strings.txt', makepath(programfiles,'Mozilla Thunderbird','chrome')) jinja2 = Environment( loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))), trim_blocks=True ) - open(makepath(install_dir,'Mozilla Thunderbird','thunderbird.cfg'),'w').write( + open(makepath(programfiles,'Mozilla Thunderbird','thunderbird.cfg'),'w').write( jinja2.get_template('thunderbird.cfg.j2').render( thunderbird_config_url = variables['thunderbird_config_url'], thunderbird_config_append_domain = variables['thunderbird_config_append_domain'] @@ -38,15 +34,15 @@ def install(): ) def uninstall(): - os.unlink(makepath(install_dir,'Mozilla Thunderbird','defaults','pref','autoconf.js')) - os.unlink(makepath(install_dir,'Mozilla Thunderbird','chrome','custom-strings.txt')) - os.unlink(makepath(install_dir,'Mozilla Thunderbird','thunderbird.cfg')) + os.unlink(makepath(programfiles,'Mozilla Thunderbird','defaults','pref','autoconf.js')) + os.unlink(makepath(programfiles,'Mozilla Thunderbird','chrome','custom-strings.txt')) + os.unlink(makepath(programfiles,'Mozilla Thunderbird','thunderbird.cfg')) def audit(): if ( - not isfile(makepath(install_dir,'Mozilla Thunderbird','defaults','pref','autoconf.js')) or - not isfile(makepath(install_dir,'Mozilla Thunderbird','chrome','custom-strings.txt')) or - not isfile(makepath(install_dir,'Mozilla Thunderbird','thunderbird.cfg')) + not isfile(makepath(programfiles,'Mozilla Thunderbird','defaults','pref','autoconf.js')) or + not isfile(makepath(programfiles,'Mozilla Thunderbird','chrome','custom-strings.txt')) or + not isfile(makepath(programfiles,'Mozilla Thunderbird','thunderbird.cfg')) ): print('At least one config file is missing') return "ERROR"