Browse Source

Beautify logging output, remove --windows-disable-console to avoid one concole window per gpg.exe call.

master Release_2.1.0-RC9
Jorg Knobloch 1 year ago
parent
commit
1b0cf2b8c1
2 changed files with 13 additions and 13 deletions
  1. +1
    -1
      make_for_windows.cmd
  2. +12
    -12
      pEp_import.py

+ 1
- 1
make_for_windows.cmd View File

@ -3,5 +3,5 @@ REM Bitness needs to match the bitness of the Python executable.
call C:\vs2019\VC\Auxiliary\Build\vcvars64.bat
REM call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
C:\Python27\Scripts\pip.exe install --user nuitka
C:\Python27\python.exe -m nuitka --standalone --windows-disable-console --windows-icon=logo.ico --show-progress pEp_import.py
C:\Python27\python.exe -m nuitka --standalone --windows-icon=logo.ico --show-progress pEp_import.py

+ 12
- 12
pEp_import.py View File

@ -14,8 +14,8 @@ from base64 import b64encode
profile = thunderbird.profile_path(thunderbird_base)
print "*** Import from Enigmail into pEp ***"
print "Using directory " + thunderbird_base
print "Using Thunderbird profile " + profile
print "--- Using directory " + thunderbird_base
print "--- Using Thunderbird profile " + profile
enigmail_extension = os.path.join(profile,
'extensions', '{847b3a00-7ab1-11d4-8f02-006008948af5}.xpi')
@ -23,7 +23,7 @@ enigmail_extension = os.path.join(profile,
# if this is an update to a pre-installed pEp extension or if Enigmail is not
# installed then do nothing and exit gracefully
if not os.path.isfile(enigmail_extension):
print "Enigmail extension not found: " + str(enigmail_extension)
print "--- Enigmail extension not found: " + str(enigmail_extension)
sys.exit(0)
verbose = 0
@ -36,18 +36,18 @@ with pEp_JSON.Connection() as call:
keydata = enigmail.secret(secret_key['fpr'])
call('import_key', b64encode(keydata), 23, [ '42', ])
i += 1
print "imported " + str(i) + " private keys"
print "--- Imported " + str(i) + " private keys"
# import keydata from comm_partners
i = 0
for keydata in enigmail.pubkey_iterator():
call('import_key', b64encode(keydata), 23, [ '42', ])
i += 1
print "imported " + str(i) + " public keys"
print "--- Imported " + str(i) + " public keys"
# if enigmail is not in p≡p mode create comm_partner's identities
if not thunderbird.enigmail_juniorMode(thunderbird_base):
print "Enigmail is in classic mode, importing data into management.db"
print "--- Enigmail is in classic mode, importing data into management.db"
# set own keys
i = 0
@ -63,7 +63,7 @@ with pEp_JSON.Connection() as call:
call('set_own_key', me, own_key['fpr'])
if verbose: print 'set_own_key: ' + str(me)
i += 1
print "set " + str(i) + " own keys"
print "--- Set " + str(i) + " own keys"
# set own identities
i = 0
@ -80,7 +80,7 @@ with pEp_JSON.Connection() as call:
call('myself', me)
if verbose: print "own identity: " + str(me)
i += 1
print "set " + str(i) + " own identities"
print "--- Set " + str(i) + " own identities"
# set comm partner's identities
if thunderbird.enigmail_assignKeysByRules(thunderbird_base) or \
@ -126,14 +126,14 @@ with pEp_JSON.Connection() as call:
if verbose: print "comm partner: " + str(ident)
i += 1
except:
print "Something wrong with partner '" + ident['username'] + " <" + ident['address'] + ">'"
print "set " + str(i) + " partner identities"
print " Something wrong with partner '" + ident['username'] + " <" + ident['address'] + ">', skipped"
print "--- Set " + str(i) + " partner identities"
# remove Enigmail extension
try:
print "Removing Enigmail extension from " + enigmail_extension
print "--- Removing Enigmail extension from " + enigmail_extension
os.remove(enigmail_extension)
except:
print "Removal failed :-("
print " Removal failed :-("
print "*** Import from Enigmail into pEp: Done! ***"

Loading…
Cancel
Save