Changeset 1477

Show
Ignore:
Timestamp:
06/29/08 11:56:16 (5 months ago)
Author:
klattimer
Message:

minor cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wine-doors/branches/0.2/src/utils.py

    r1476 r1477  
    3232        re_largest_val = re.compile('(.*?)\.(.*)') 
    3333        str_a = a_minor 
    34         str_b = b_minor         
     34        str_b = b_minor 
    3535        while 1: 
    3636            if str_a.find(".") >= 0: 
     
    6161        return -1 
    6262 
    63     # We should have returned by now, if we haven't we'll return something unexpected 
    64     return None 
     63    # Raise an exception if the function has failed to determine which is higher 
     64    error_msg = "Cannot determine if \"%s\" is less than or larger than \"%s\"" % (ver_a, ver_b) 
     65    raise ValueError, error_msg 
    6566 
    6667def SplitPackageString ( package_string ): 
     
    119120class Download: 
    120121    def __init__( self, remote_uri, local_uri, username=None, password=None, callback=None, cache_timeout=True ): 
    121         """ 
    122         All reporting should be done through the callback if it exists, rather than accessing parent 
    123         We need to handle download errors too, md5/file size/borked somehow else, we need to work on better callbacks! 
    124         """ 
    125122        self.local_uri = urllib.unquote(local_uri) 
    126123        self.callback = callback 
     
    224221        return True 
    225222 
    226 def UTDownloadCallback(fraction): 
    227     percent = round(fraction * 100) 
     223def UTDownloadCallback(download): 
     224    percent = round(download.fraction * 100) 
    228225    print "Downloader returned %d" % percent 
    229226