Selaa lähdekoodia

wxGUI locdownload: fix missing flush method (#634)

Tomas Zigo 5 vuotta sitten
vanhempi
commit
0acd7865a6
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      gui/wxpython/startup/locdownload.py

+ 7 - 4
gui/wxpython/startup/locdownload.py

@@ -90,7 +90,7 @@ class DownloadError(Exception):
 class RedirectText(object):
 class RedirectText(object):
     def __init__(self, window):
     def __init__(self, window):
         self.out = window
         self.out = window
- 
+
     def write(self, string):
     def write(self, string):
         try:
         try:
             wx.CallAfter(self.out.SetLabel, string)
             wx.CallAfter(self.out.SetLabel, string)
@@ -98,6 +98,9 @@ class RedirectText(object):
             # window closed -> PyDeadObjectError
             # window closed -> PyDeadObjectError
             pass
             pass
 
 
+    def flush(self):
+        pass
+
 # copy from g.extension, potentially move to library
 # copy from g.extension, potentially move to library
 def move_extracted_files(extract_dir, target_dir, files):
 def move_extracted_files(extract_dir, target_dir, files):
     """Fix state of extracted file by moving them to different diretcory
     """Fix state of extracted file by moving them to different diretcory
@@ -185,7 +188,7 @@ def reporthook(count, block_size, total_size):
     sys.stdout.write("Download in progress, wait until it is finished\n{0}%, {1} MB, {2} KB/s, {3:.0f} seconds passed".format(
     sys.stdout.write("Download in progress, wait until it is finished\n{0}%, {1} MB, {2} KB/s, {3:.0f} seconds passed".format(
         percent, progress_size / (1024 * 1024), speed, duration
         percent, progress_size / (1024 * 1024), speed, duration
     ))
     ))
-    
+
 # based on g.extension, potentially move to library
 # based on g.extension, potentially move to library
 def download_and_extract(source):
 def download_and_extract(source):
     """Download a file (archive) from URL and uncompress it"""
     """Download a file (archive) from URL and uncompress it"""
@@ -490,14 +493,14 @@ class LocationDownloadDialog(wx.Dialog):
                                    caption=_("Abort download"),
                                    caption=_("Abort download"),
                                    style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION | wx.CENTRE
                                    style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION | wx.CENTRE
             )
             )
-            
+
             ret = dlg.ShowModal()
             ret = dlg.ShowModal()
             dlg.Destroy()
             dlg.Destroy()
 
 
             # TODO: terminate download process on wx.ID_YES
             # TODO: terminate download process on wx.ID_YES
             if ret == wx.ID_NO:
             if ret == wx.ID_NO:
                 return
                 return
-    
+
         self.Close()
         self.Close()
 
 
 def main():
 def main():