diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 5753a7c974..b2d06a0502 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -296,6 +296,8 @@ class Main(MainWindow, Ui_MainWindow): self.card_view.connect_dirtied_signal(self.upload_booklists) self.show() + if self.system_tray_icon.isVisible() and opts.start_in_tray: + self.hide() self.stack.setCurrentIndex(0) try: db = LibraryDatabase2(self.library_path) @@ -1527,6 +1529,8 @@ path_to_ebook to the database. ''') parser.add_option('--with-library', default=None, action='store', help=_('Use the library located at the specified path.')) + parser.add_option('--start-in-tray', default=False, action='store_true', + help=_('Start minimized to system tray.')) parser.add_option('-v', '--verbose', default=0, action='count', help=_('Log debugging information to console')) return parser diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index ecab3fac59..8d6301ada4 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -186,7 +186,7 @@ class RecursiveFetcher(object, LoggingInterface): if hasattr(err, 'code') and responses.has_key(err.code): raise FetchError, responses[err.code] if getattr(err, 'reason', [0])[0] == 104 or \ - getattr(err, 'errno', None) == -2: # Connection reset by peer or Name or service not know + getattr(getattr(err, 'args', [None])[0], 'errno', None) == -2: # Connection reset by peer or Name or service not know self.log_debug('Temporary error, retrying in 1 second') time.sleep(1) with closing(self.browser.open(url)) as f: