diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2009-07-29 17:58:14 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2009-07-29 17:58:14 (GMT) |
commit | c73b1bfa6b1de28934f93dd2a773a67f647b7824 (patch) | |
tree | 6063cf9f3868f7eba3e894aed1c41db41528b53d | |
parent | bb796538fc53ac6a40fd12df7594b5550157619f (diff) | |
download | fusearchive-c73b1bfa6b1de28934f93dd2a773a67f647b7824.zip fusearchive-c73b1bfa6b1de28934f93dd2a773a67f647b7824.tar.gz fusearchive-c73b1bfa6b1de28934f93dd2a773a67f647b7824.tar.bz2 |
Use some more printf like % stuff instead of str()before-class-split
-rwxr-xr-x | fusearchive.py | 12 |
1 files changed, 6 insertions, 6 deletions
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 ): |