CVS: src/si/extras entitycheck.py,1.21,1.22
Mats Wichmann <[email protected]>
| Newsgroups | gmane.linux.lsb.implementation |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/lsb/src/si/extras
In directory sc8-pr-cvs1:/tmp/cvs-serv7338
Modified Files:
entitycheck.py
Log Message:
Detabify, just in case
Index: entitycheck.py
===================================================================
RCS file: /cvsroot/lsb/src/si/extras/entitycheck.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** entitycheck.py 10 Jan 2003 17:25:31 -0000 1.21
--- entitycheck.py 10 Jan 2003 17:50:27 -0000 1.22
***************
*** 70,92 ****
def running_output(self):
! """Print running output of (front, message) using \b and \r tricks."""
! output = "%s %s" % (self.front, self.message)
! padding = " " * (80 - len(output))
! print "%s%s%s\r" % ("\b" * (len(self.front) + 1), output, padding),
def feedback(self, block_count, block_size, total):
! """Callback function for urllib.urlretrieve()"""
! so_far = block_count * block_size
self.message = "%d of %d bytes retrieved" % (so_far, total)
! self.running_output()
! sys.stdout.flush() # force text to be displayed
def fetch(self, locations, fallback, destination):
"""retrieve the file for an entity.
Calls urllib.urlretrieve() up to three times to retrieve the
! package. Retrieval locations are looked up in 'locations',
! the name of a locations instance must match our name, that
! instance contains a primary and optional secondary url to
! find the package. A 'fallback' url is tried if they fail.
"""
self.message = "not found"
--- 70,92 ----
def running_output(self):
! """Print running output of (front, message) using \b and \r tricks."""
! output = "%s %s" % (self.front, self.message)
! padding = " " * (80 - len(output))
! print "%s%s%s\r" % ("\b" * (len(self.front) + 1), output, padding),
def feedback(self, block_count, block_size, total):
! """Callback function for urllib.urlretrieve()"""
! so_far = block_count * block_size
self.message = "%d of %d bytes retrieved" % (so_far, total)
! self.running_output()
! sys.stdout.flush() # force text to be displayed
def fetch(self, locations, fallback, destination):
"""retrieve the file for an entity.
Calls urllib.urlretrieve() up to three times to retrieve the
! package. Retrieval locations are looked up in 'locations',
! the name of a locations instance must match our name, that
! instance contains a primary and optional secondary url to
! find the package. A 'fallback' url is tried if they fail.
"""
self.message = "not found"
***************
*** 101,106 ****
self.message = "fetch %s from (%s, ...) to %s" % (self.file,
loc.path, destination)
! self.running_output()
! print
self.message = "skipped"
break
--- 101,106 ----
self.message = "fetch %s from (%s, ...) to %s" % (self.file,
loc.path, destination)
! self.running_output()
! print
self.message = "skipped"
break
***************
*** 125,130 ****
self.running_output()
print
! if self.message == "completed": return 1
! return 0
def parse_entities():
--- 125,130 ----
self.running_output()
print
! if self.message == "completed": return 1
! return 0
def parse_entities():
***************
*** 239,243 ****
for item in collection:
print "\t", item.file
! # For debugging: print both name and file
#print "\t", item.name, "->", item.file
--- 239,243 ----
for item in collection:
print "\t", item.file
! # For debugging: print both name and file
#print "\t", item.name, "->", item.file
***************
*** 317,321 ****
if pkg.fetch(locations, fallback_url, package_path):
retrieved = retrieved + 1
! else:
if pkg.message == 'retrieval failed':
fails.append(pkg)
--- 317,321 ----
if pkg.fetch(locations, fallback_url, package_path):
retrieved = retrieved + 1
! else:
if pkg.message == 'retrieval failed':
fails.append(pkg)