#!/usr/bin/python
+from __future__ import with_statement
+
import logging
try:
with open(path, "rb") as f:
fileVersion, fileBuild, contacts = pickle.load(f)
- except (pickle.PickleError, IOError, EOFError, ValueError):
+ except (pickle.PickleError, IOError, EOFError, ValueError, Exception):
_moduleLogger.exception("While loading")
return
for (number, phoneType) in contactNumbers
)
return numbers
+
+
+def print_addressbook(path):
+ import pprint
+
+ try:
+ with open(path, "rb") as f:
+ fileVersion, fileBuild, contacts = pickle.load(f)
+ except (pickle.PickleError, IOError, EOFError, ValueError):
+ _moduleLogger.exception("")
+ else:
+ pprint.pprint((fileVersion, fileBuild))
+ pprint.pprint(contacts)