Fix percent done on resumed /clone.bundle

The Content-Length when resuming is the number of bytes that
remain in the file. To compute the total size as expected by
the progress meter, we must add the bytes already stored.

While we are in this method fix uses of % operator to ensure
a tuple is always supplied.

Change-Id: Ic899231b5bc0ab43b3ddb1d29845f6390e820115
diff --git a/project.py b/project.py
index 68c1c68..35dbafd 100644
--- a/project.py
+++ b/project.py
@@ -1564,7 +1564,7 @@
       try:
         req = urllib2.Request(srcUrl)
         if pos > 0:
-          req.add_header('Range', 'bytes=%d-' % pos)
+          req.add_header('Range', 'bytes=%d-' % (pos,))
 
         try:
           r = urllib2.urlopen(req)
@@ -1583,7 +1583,7 @@
               msg = e.read()
               if len(msg) > 0 and msg[-1] == '\n':
                 msg = msg[0:-1]
-              msg = ' (%s)' % msg
+              msg = ' (%s)' % (msg,)
             except:
               msg = ''
           else:
@@ -1601,7 +1601,7 @@
 
       p = None
       try:
-        size = r.headers.get('content-length', 0)
+        size = pos + r.headers.get('content-length', 0)
         unit = 1 << 10
 
         if size and not quiet:
@@ -1611,7 +1611,7 @@
           else:
             desc = 'KB'
           p = Progress(
-            'Downloading %s' % self.relpath,
+            'Downloading %s' % (self.relpath,),
             int(size) / unit,
             units=desc)
           if pos > 0: