Changeset 1522
- Timestamp:
- 10/20/08 11:37:07 (3 months ago)
- Files:
-
- wine-doors/trunk/src/application.py (modified) (5 diffs)
- wine-doors/trunk/src/const.py (modified) (1 diff)
- wine-doors/trunk/src/utils.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wine-doors/trunk/src/application.py
r1516 r1522 264 264 265 265 # Invoke the download helper 266 Download ( remote_file, self.cache_file, True, notify_type, notify_data )266 dl = Download ( remote_file, self.cache_file, True, notify_type, notify_data ) 267 267 self.cache_file = self.cache_file.replace( ".gz", "" ) 268 return dl.status 268 269 269 270 def Extract ( self ): … … 306 307 307 308 # Run our handy little tools on our pack file 308 self.Download( self.pack_file, APP_PACK ) 309 if self.Download( self.pack_file, APP_PACK ) == DOWNLOAD_FAILED: 310 return 309 311 self.Extract() 310 312 self.Parse() … … 314 316 (url, md5) = item 315 317 log.Debug("* Retrieving installation resource to cache: " + url) 316 self.Download( url, RESOURCE ) 318 if self.Download( url, RESOURCE ) == DOWNLOAD_FAILED: 319 self.status = FILE_NOT_FOUND 320 return 317 321 if md5: 318 322 if md5file(self.cache_file) != md5: … … 447 451 # In other words, add stuff usually added by self.InstallApplication 448 452 if self.app_pack == {}: 449 self.Download( self.pack_file, APP_PACK ) 453 if self.Download( self.pack_file, APP_PACK ) == DOWNLOAD_FAILED: 454 return 450 455 self.Extract() 451 456 self.Parse() … … 533 538 """ 534 539 log.Debug("Uninstalling application: " + str(self.pack) + " " + str(self.version)) 535 self.Download( self.pack_file, APP_PACK ) 540 if self.Download( self.pack_file, APP_PACK ) == DOWNLOAD_FAILED: 541 return 536 542 self.Extract() 537 543 self.Parse() wine-doors/trunk/src/const.py
r1480 r1522 22 22 ALL = -1 23 23 24 # Errors 24 25 FILE_NOT_FOUND = -3 25 26 27 # Download status 28 ( DOWNLOAD_NOTREADY, DOWNLOAD_FAILED, DOWNLOAD_OK ) = range( 3 ) 29 26 30 ( REPO_NAME, REPO_URI ) = range( 2 ) 27 ( PACK_TILE, PACK_SHORTNAME, PACK_VERSION ) = range ( 3 )31 ( PACK_TILE, PACK_SHORTNAME, PACK_VERSION ) = range( 3 ) 28 32 29 33 # Allow either or for filtering, this allows us to add an advanced search facility later wine-doors/trunk/src/utils.py
r1480 r1522 124 124 uitype = None 125 125 def __init__( self, remote_uri, local_uri, cache=False, uitype=None, widget=None ): 126 self.status = DOWNLOAD_NOTREADY 126 127 self.widget = widget 127 128 self.cache = cache … … 161 162 except: 162 163 pass 163 urllib.urlretrieve( remote_uri, self.local_uri, self.UpdateProgress ) 164 try: 165 urllib.urlretrieve( remote_uri, self.local_uri, self.UpdateProgress ) 166 except IOError: 167 log.Error( "Unable to download file: " + remote_uri ) 168 self.status = DOWNLOAD_FAILED 169 return 164 170 #self.wn_downloader['wn_downloader'].hide() 165 171 self.Complete() 172 self.status = DOWNLOAD_OK 166 173 167 174 def UpdateProgress( self, blocks, block_size, total_size ):
