Skip to content

Commit

Permalink
Fix for issue "Exception in Tkinter callback"
Browse files Browse the repository at this point in the history
- Test if EML file variable not equal to None before attempting to remove file
- Miscellaneous minor doc fixes
  • Loading branch information
adb014 authored Jul 12, 2017
1 parent 1301bf7 commit 6b2ad3e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
13 changes: 6 additions & 7 deletions README.dev
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Development
Open the Winpython control panel for the 32bit version
Hit the "register" button
SET PATH=%PATH%;c:\Python32
python create_exe.py
python create_helper.py
# The helper32 directory with the eml2pst application is built

Reopen the Winpython control panel for the 32bit version
Expand All @@ -63,7 +63,7 @@ Development
Open the Winpython control panel for the 64bit version
Hit the "register" button
SET PATH=%PATH%;c:\Python64
python create_exe.py
python create_helper.py

Reopen the Winpython control panel for the 64bit version
Hit the "unregister" button
Expand All @@ -76,7 +76,7 @@ Development
python create_exe.py

The sub-directory 'dist' now contains the binary distribution, and the
files "nsf2x-X.X.X.zip" and "nsf2x-1.2.7-setup.exe" contains a zip
files "nsf2x-V.V.V.zip" and "nsf2x-V.V.V-XX-setup.exe" contains a zip
and installer of this directory for distribution.

create_exe.py attempts to include all DLLs that are necessary of the use of
Expand Down Expand Up @@ -265,7 +265,7 @@ Development
address book to have the certificates for all the senders and recipients of
encrypted mails. These certificates can be in the form of a local contact
or the "Global Address List" of the Exchange server. Otherwise NSF2X
will cause Outlook to present the user is a dialog asking them how to
will cause Outlook to present the user with a dialog asking them how to
treat the missing certificate, with no way to automate the selection of
the correct option, as NSF2X is blocked by the dialog.

Expand Down Expand Up @@ -318,10 +318,9 @@ Development

The messages of an MBOX file are recognized by the fact they start with
"\nFrom". That is each new message is separated by a newline character
and the From field is the first field of the header. The EML files are
written with the From field first to simplify this. As "\nFrom" might
and the From field is the first field of the header. As "\nFrom" might
appear in a real message, the use of MIME ensures that these uses of
"\nFrom" won't be incorrectly interpreted.
"\nFrom" won't be incorrectly interpreted as they'll be base64 encoded.

See also
--------
Expand Down
6 changes: 3 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Quick Start
WARNING
-------
NSF2X can read all the encrypted mails that your Notes ID gives you access to. It
decrypts these mail in its output EML, and MBOX files, as NSF2X can't use the
can decrypt these mail in its output EML, and MBOX files, as NSF2X can't use the
Notes encryption in the EML files. So if you care about the security of your mail
archives, store them on encrypted disks after conversion. You've been warned.
However, a mail that is encrypted in Notes can be re-encrypted with the users
Expand Down Expand Up @@ -306,8 +306,8 @@ Details
as long as the NSF and PST files are in locations that NSF2X can access
with the screen locked

14. Treat any exceptions manually
---------------------------------
14. Treat any exceptions manually
---------------------------------
Some mails in Lotus notes might be malformed and not capable of being
transformed into MIME by Lotus. It is also possible that an unexpected
error might occur. Hopefully, this will be very rare or not occur at all,
Expand Down
30 changes: 15 additions & 15 deletions create_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def __init__(self, **kw):

# the VersionInfo resource, uncomment and fill in those items
# that make sense:

# The 'version' attribute MUST be defined, otherwise no versioninfo will be built:
# self.version = "1.0"

# self.company_name = "Company Name"
# self.copyright = "Copyright Company Name © 2013"
# self.legal_copyright = "Copyright Company Name © 2013"
Expand Down Expand Up @@ -71,7 +71,7 @@ def is_exe(fpath):
return exe_file

return None

def find_all_files_in_dir(directory):
ret = []
for root, dir, files in os.walk(directory) :
Expand All @@ -81,20 +81,20 @@ def find_all_files_in_dir(directory):
if _files :
ret += [(root, _files)]
return ret

def main () :
if platform.architecture()[0] == "32bit":
bitness = 'x86'
else :
bitness = 'amd64'

RT_BITMAP = 2
RT_MANIFEST = 24

version = "1.3.1"
version = "1.3.3"
author = "[email protected]"
description="NSF2X - Converts Lotus NSF files to EML, MBOX or PST files..."

# A manifest which specifies the executionlevel
# and windows common-controls library version 6

Expand Down Expand Up @@ -212,19 +212,19 @@ def main () :

# windows subsystem executables (no console)
windows=[nsf2x],

# version of the program
version=version,

# short description of the program
description=description,

# author contact details
author=author,
url='mailto:' + author,

# data files to include
data_files=[(".", ("README.txt", "LICENSE")),
data_files=[(".", ("README.txt", "LICENSE")),
("src", ("create_exe.py", "create_helper.py", "eml2pst.py",
"nsf2x.py", "mapiex.py", "testmapiex.py",
"nsf2x.nsi", "nsf2x_lang.nsi", "README.dev"))] +
Expand All @@ -236,7 +236,7 @@ def main () :
zipfile=None,
options={"py2exe": py2exe_options},
)

zf = zipfile.ZipFile("nsf2x-" + version + "-" + bitness + ".zip", "w", zipfile.ZIP_DEFLATED)
for root, dir, files in os.walk("dist") :
for file in files :
Expand All @@ -253,8 +253,8 @@ def main () :
raise "Can not find NSIS executable on your path"
subprocess.call([makensis, "-DVERSION=" + version, "-DPUBLISHER=" + author,
"-DBITNESS=" + bitness, "nsf2x.nsi"])

if len(sys.argv) == 1:
sys.argv.append("py2exe")

main()
2 changes: 1 addition & 1 deletion nsf2x.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ def realConvert(self, src, dest):

except (pywintypes.com_error, OSError) as ex: # pylint: disable=E1101
e += 1 #count the exceptions
if self.Format.get() != Format.MBOX:
if eml != None and self.Format.get() != Format.MBOX:
# File might already be closed and/or removed. So failure is ok
try:
f.close()
Expand Down

0 comments on commit 6b2ad3e

Please sign in to comment.