From 01b69ae781a7384578feed2d264978f9a0819973 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Apr 2017 20:13:01 +0530 Subject: [PATCH] Get rid fo the last use of the old server code --- src/calibre/gui2/actions/device.py | 12 +++++------- src/calibre/srv/TODO | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/actions/device.py b/src/calibre/gui2/actions/device.py index da4117c913..48ee30b22c 100644 --- a/src/calibre/gui2/actions/device.py +++ b/src/calibre/gui2/actions/device.py @@ -13,7 +13,6 @@ from calibre.constants import get_osx_version, isosx, iswindows from calibre.gui2 import info_dialog, question_dialog from calibre.gui2.actions import InterfaceAction from calibre.gui2.dialogs.smartdevice import SmartdeviceDialog -from calibre.utils.config import tweaks from calibre.utils.icu import primary_sort_key from calibre.utils.smtp import config as email_config @@ -77,13 +76,12 @@ class ShareConnMenu(QMenu): # {{{ from calibre.utils.mdns import get_external_ip, verify_ipV4_address text = _('Start Content server') if running: - listen_on = (verify_ipV4_address(tweaks['server_listen_on']) or - get_external_ip()) + from calibre.srv.opts import server_config + opts = server_config() + listen_on = verify_ipV4_address(opts.listen_on) or get_external_ip() try: - from calibre.library.server import server_config as content_server_config - cs_port = content_server_config().parse().port - ip_text = _(' [%(ip)s, port %(port)d]')%dict(ip=listen_on, - port=cs_port) + ip_text = _(' [%(ip)s, port %(port)d]')%dict( + ip=listen_on, port=opts.port) except Exception: ip_text = ' [%s]'%listen_on text = _('Stop Content server') + ip_text diff --git a/src/calibre/srv/TODO b/src/calibre/srv/TODO index f67ccb4fa0..8a63f0cc53 100644 --- a/src/calibre/srv/TODO +++ b/src/calibre/srv/TODO @@ -1,3 +1,3 @@ Rewrite server integration with nginx/apache section -Grep for from library.server and port all code that uses it +grep src/calibre/srv and src/pyj for TODO