Adapt for TB x64

master
Daniel Berteaud 6 years ago
parent 5c5be56913
commit ea432e6f2c
  1. 2
      WAPT/control
  2. 26
      setup.py

@ -1,5 +1,5 @@
package : fws-thunderbird-config package : fws-thunderbird-config
version : 4 version : 5
architecture : all architecture : all
section : base section : base
priority : optional priority : optional

@ -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()) 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()))) 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(): def install():
filecopyto('autoconf.js', makepath(install_dir,'Mozilla Thunderbird','defaults','pref')) filecopyto('autoconf.js', makepath(programfiles,'Mozilla Thunderbird','defaults','pref'))
if not isdir(makepath(install_dir, 'Mozilla Thunderbird','chrome')): if not isdir(makepath(programfiles, 'Mozilla Thunderbird','chrome')):
mkdirs(makepath(install_dir, 'Mozilla Thunderbird','chrome')) mkdirs(makepath(programfiles, 'Mozilla Thunderbird','chrome'))
filecopyto('custom-strings.txt', makepath(install_dir,'Mozilla Thunderbird','chrome')) filecopyto('custom-strings.txt', makepath(programfiles,'Mozilla Thunderbird','chrome'))
jinja2 = Environment( jinja2 = Environment(
loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))), loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))),
trim_blocks=True 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( jinja2.get_template('thunderbird.cfg.j2').render(
thunderbird_config_url = variables['thunderbird_config_url'], thunderbird_config_url = variables['thunderbird_config_url'],
thunderbird_config_append_domain = variables['thunderbird_config_append_domain'] thunderbird_config_append_domain = variables['thunderbird_config_append_domain']
@ -38,15 +34,15 @@ def install():
) )
def uninstall(): def uninstall():
os.unlink(makepath(install_dir,'Mozilla Thunderbird','defaults','pref','autoconf.js')) os.unlink(makepath(programfiles,'Mozilla Thunderbird','defaults','pref','autoconf.js'))
os.unlink(makepath(install_dir,'Mozilla Thunderbird','chrome','custom-strings.txt')) os.unlink(makepath(programfiles,'Mozilla Thunderbird','chrome','custom-strings.txt'))
os.unlink(makepath(install_dir,'Mozilla Thunderbird','thunderbird.cfg')) os.unlink(makepath(programfiles,'Mozilla Thunderbird','thunderbird.cfg'))
def audit(): def audit():
if ( if (
not isfile(makepath(install_dir,'Mozilla Thunderbird','defaults','pref','autoconf.js')) or not isfile(makepath(programfiles,'Mozilla Thunderbird','defaults','pref','autoconf.js')) or
not isfile(makepath(install_dir,'Mozilla Thunderbird','chrome','custom-strings.txt')) or not isfile(makepath(programfiles,'Mozilla Thunderbird','chrome','custom-strings.txt')) or
not isfile(makepath(install_dir,'Mozilla Thunderbird','thunderbird.cfg')) not isfile(makepath(programfiles,'Mozilla Thunderbird','thunderbird.cfg'))
): ):
print('At least one config file is missing') print('At least one config file is missing')
return "ERROR" return "ERROR"

Loading…
Cancel
Save