work around timed out connection in reinitialize, though theoretically this could...
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Wed, 23 Sep 2009 09:22:24 +0000 (09:22 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Wed, 23 Sep 2009 09:22:24 +0000 (09:22 +0000)
ftpbrowser/src/FTPBrowser.py

index 496b22c..d1bf2e4 100644 (file)
@@ -202,7 +202,14 @@ class FTPBrowser(Screen, Protocol, InfoBarNotifications, HelpableScreen):
        def reinitialize(self):
                # NOTE: this will clear the remote file list if we are not currently connected. this behavior is intended.
                # XXX: but do we also want to do this when we just returned from a notification?
-               self["remote"].refresh()
+               try:
+                       self["remote"].refresh()
+               except AttributeError, ae:
+                       # NOTE: we assume the connection was timed out by the server
+                       self.ftpclient = None
+                       self["remote"].ftpclient = None
+                       self["remote"].refresh()
+
                self["local"].refresh()
 
                if not self.ftpclient: