Browse Source

Adapt for TB x64

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

2
WAPT/control

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

26
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"

Loading…
Cancel
Save