mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-27 09:34:42 +00:00
Merge pull request #488 from cjmayo/gschema
Avoid dependency on gsettings-desktop-schemas
This commit is contained in:
commit
5a2eda9058
1 changed files with 12 additions and 1 deletions
|
|
@ -448,7 +448,18 @@ def get_gnome_proxy(protocol="HTTP"):
|
|||
except ImportError:
|
||||
return None
|
||||
try:
|
||||
settings = Gio.Settings.new("org.gnome.system.proxy.%s" % protocol.lower())
|
||||
schema_id = "org.gnome.system.proxy.%s" % protocol.lower()
|
||||
# If the schema is not installed Gio.Settings.new() causes Trace/breakpoint trap
|
||||
source = Gio.SettingsSchemaSource.get_default()
|
||||
if source is None:
|
||||
log.debug(LOG_CHECK, "No GSettings schemas are installed")
|
||||
return None
|
||||
schema = source.lookup(schema_id, False)
|
||||
if schema is None:
|
||||
log.debug(LOG_CHECK, "%s not installed" % schema_id)
|
||||
return None
|
||||
|
||||
settings = Gio.Settings.new(schema_id)
|
||||
if protocol == "HTTP" and not settings.get_boolean("enabled"):
|
||||
return None
|
||||
host = settings.get_string("host")
|
||||
|
|
|
|||
Loading…
Reference in a new issue