Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding logging to metadata class

  • Loading branch information...
commit 90fc5c2b16933b8eaac3d421b39b3866815ad62a 1 parent ec56897
@firstclown authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 S3/MetaData.py
View
4 S3/MetaData.py
@@ -5,6 +5,7 @@
import cPickle
import os
+from logging import debug, info, warning, error
class MetaData(object):
_instance = None
@@ -24,6 +25,8 @@ def __init__(self):
elif os.name == "nt" and os.getenv("USERPROFILE"):
metadata_file = os.path.join(os.getenv("USERPROFILE").decode('mbcs'), "Application Data", "s3metadata.ini")
+ debug(u"Loading metadata from %s" % metadata_file)
+
if os.path.exists(metadata_file):
self.metadata = cPickle.load(open(metadata_file, 'rb'))
@@ -35,6 +38,7 @@ def save(self):
elif os.name == "nt" and os.getenv("USERPROFILE"):
metadata_file = os.path.join(os.getenv("USERPROFILE").decode('mbcs'), "Application Data", "s3metadata.ini")
+ debug(u"Saving metadata to %s" % metadata_file)
try:
cPickle.dump(self.metadata, open(metadata_file, 'wb'), -1)
except IOError, e:
Please sign in to comment.
Something went wrong with that request. Please try again.