PEP8
This commit is contained in:
parent
2c2029437a
commit
b3c0374477
2 changed files with 11 additions and 12 deletions
|
@ -101,7 +101,7 @@ class Main():
|
||||||
executebuiltin('Addon.OpenSettings(%s)' % v.ADDON_ID)
|
executebuiltin('Addon.OpenSettings(%s)' % v.ADDON_ID)
|
||||||
|
|
||||||
elif mode == 'enterPMS':
|
elif mode == 'enterPMS':
|
||||||
entrypoint.enterPMS()
|
entrypoint.create_new_pms()
|
||||||
|
|
||||||
elif mode == 'reset':
|
elif mode == 'reset':
|
||||||
reset()
|
reset()
|
||||||
|
|
|
@ -869,19 +869,19 @@ def extras(plex_id):
|
||||||
xbmcplugin.endOfDirectory(HANDLE)
|
xbmcplugin.endOfDirectory(HANDLE)
|
||||||
|
|
||||||
|
|
||||||
def enterPMS():
|
def create_new_pms():
|
||||||
"""
|
"""
|
||||||
Opens dialogs for the user the plug in the PMS details
|
Opens dialogs for the user the plug in the PMS details
|
||||||
"""
|
"""
|
||||||
# "Enter your Plex Media Server's IP or URL. Examples are:"
|
# "Enter your Plex Media Server's IP or URL. Examples are:"
|
||||||
dialog('ok', lang(29999), lang(39215), '192.168.1.2', 'plex.myServer.org')
|
dialog('ok', lang(29999), lang(39215), '192.168.1.2', 'plex.myServer.org')
|
||||||
ip = dialog('input', "Enter PMS IP or URL")
|
address = dialog('input', "Enter PMS IP or URL")
|
||||||
if ip == '':
|
if address == '':
|
||||||
return
|
return
|
||||||
port = dialog('input', "Enter PMS port", '32400', type='{numeric}')
|
port = dialog('input', "Enter PMS port", '32400', type='{numeric}')
|
||||||
if port == '':
|
if port == '':
|
||||||
return
|
return
|
||||||
url = '%s:%s' % (ip, port)
|
url = '%s:%s' % (address, port)
|
||||||
# "Does your Plex Media Server support SSL connections?
|
# "Does your Plex Media Server support SSL connections?
|
||||||
# (https instead of http)"
|
# (https instead of http)"
|
||||||
https = dialog('yesno', lang(29999), lang(39217))
|
https = dialog('yesno', lang(29999), lang(39217))
|
||||||
|
@ -890,9 +890,8 @@ def enterPMS():
|
||||||
else:
|
else:
|
||||||
url = 'http://%s' % url
|
url = 'http://%s' % url
|
||||||
https = 'true' if https else 'false'
|
https = 'true' if https else 'false'
|
||||||
|
machine_identifier = GetMachineIdentifier(url)
|
||||||
machineIdentifier = GetMachineIdentifier(url)
|
if machine_identifier is None:
|
||||||
if machineIdentifier is None:
|
|
||||||
# "Error contacting url
|
# "Error contacting url
|
||||||
# Abort (Yes) or save address anyway (No)"
|
# Abort (Yes) or save address anyway (No)"
|
||||||
if dialog('yesno',
|
if dialog('yesno',
|
||||||
|
@ -902,11 +901,11 @@ def enterPMS():
|
||||||
else:
|
else:
|
||||||
settings('plex_machineIdentifier', '')
|
settings('plex_machineIdentifier', '')
|
||||||
else:
|
else:
|
||||||
settings('plex_machineIdentifier', machineIdentifier)
|
settings('plex_machineIdentifier', machine_identifier)
|
||||||
LOG.info('Set new PMS to https %s, ip %s, port %s, machineIdentifier %s'
|
LOG.info('Set new PMS to https %s, address %s, port %s, machineId %s',
|
||||||
% (https, ip, port, machineIdentifier))
|
https, address, port, machine_identifier)
|
||||||
settings('https', value=https)
|
settings('https', value=https)
|
||||||
settings('ipaddress', value=ip)
|
settings('ipaddress', value=address)
|
||||||
settings('port', value=port)
|
settings('port', value=port)
|
||||||
# Chances are this is a local PMS, so disable SSL certificate check
|
# Chances are this is a local PMS, so disable SSL certificate check
|
||||||
settings('sslverify', value='false')
|
settings('sslverify', value='false')
|
||||||
|
|
Loading…
Reference in a new issue