mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a tweak to allow skipping network check on news download.
The mechanism used for checking for available network connections may not always be accurate, so allow it to be skipped. For instance network manager may not be aware of all available connection and so return a false negative. This has been added as a tweak to allow those who know what they're doing to use the alternate behavior, without breaking the default check mechanism.
This commit is contained in:
parent
aa4a177c04
commit
758c24f920
@ -567,3 +567,7 @@ show_saved_search_box = False
|
|||||||
# exclude_fields_on_paste = ['cover', 'timestamp', '#mycolumn']
|
# exclude_fields_on_paste = ['cover', 'timestamp', '#mycolumn']
|
||||||
# to prevent pasting of the cover, Date and custom column, mycolumn.
|
# to prevent pasting of the cover, Date and custom column, mycolumn.
|
||||||
exclude_fields_on_paste = []
|
exclude_fields_on_paste = []
|
||||||
|
|
||||||
|
#: Skip network check
|
||||||
|
# Skip checking the network state before downloading news
|
||||||
|
skip_network_check = False
|
||||||
|
@ -7,7 +7,7 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from calibre.constants import iswindows, islinux, isbsd
|
from calibre.constants import iswindows, islinux, isbsd
|
||||||
|
from calibre.utils.config_base import tweaks
|
||||||
|
|
||||||
class LinuxNetworkStatus(object):
|
class LinuxNetworkStatus(object):
|
||||||
|
|
||||||
@ -55,4 +55,7 @@ _network_status = WindowsNetworkStatus() if iswindows else \
|
|||||||
|
|
||||||
|
|
||||||
def internet_connected():
|
def internet_connected():
|
||||||
|
if tweaks['skip_network_check']:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
return _network_status()
|
return _network_status()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user