From c73b1bfa6b1de28934f93dd2a773a67f647b7824 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Wed, 29 Jul 2009 10:58:14 -0700 Subject: Use some more printf like % stuff instead of str() diff --git a/fusearchive.py b/fusearchive.py index 8e75ce1..bd0d843 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -24,8 +24,8 @@ fuse.fuse_python_api = (0, 2) fuse.feature_assert('stateful_files', 'has_init') -log_level = logging.DEBUG -#log_level = logging.WARNING +#log_level = logging.DEBUG +log_level = logging.WARNING logging.basicConfig( level = log_level, format = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(module)s:%(funcName)s() %(message)s', @@ -123,7 +123,7 @@ def _save_chunk_fs( chunk ): # Find a chunk slot sub = 0 while True: - checkpath = "./storage/" + subpath + "/" + hexdigest + "_" + str( sub ) + checkpath = "./storage/%s/%s_%d" % ( subpath, hexdigest, sub ) logging.debug( "Checking: " + checkpath ) if os.path.exists( checkpath ): # Check if this is our data @@ -184,7 +184,7 @@ def _save_chunk_zip( chunk ): # Find a chunk slot sub = 0 while True: - checkpath = hexdigest + "_" + str( sub ) + checkpath = "%s_%d" % ( hexdigest, sub ) logging.debug( "Checking: " + checkpath ) try: data = z.read( checkpath ) @@ -226,7 +226,7 @@ def _load_chunk_fs( key ): subpath = '/'.join( subparts ) logging.debug( "Subpath: " + subpath ) - subpath += "/" + hexdigest + "_" + str( seq ) + subpath += "/%s_%d" % ( hexdigest, seq ) logging.debug( "Chunk path: " + subpath ) @@ -260,7 +260,7 @@ def _load_chunk_zip( key ): logging.debug( "Zip name: " + zipname ) z = zipfile.ZipFile( "./storage/" + zipname, 'r', zipfile.ZIP_DEFLATED, True ) - subpath = hexdigest + "_" + str( seq ) + subpath = "%s_%d" % ( hexdigest, seq ) logging.debug( "Chunk path: " + subpath ) data = z.read( subpath ) if len( data ): -- cgit v0.10.2