Version 0.4.3
This commit is contained in:
1 parent
f2b98d02a2
commit
fc3741a158
6 files changed
+33
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -245,6 +245,14 @@ msgctxt "#30183"
|
||||
msgid "Login with username"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30184"
|
||||
msgid "Export access token to key file"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30185"
|
||||
msgid "Select a folder to save the key file"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30200"
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
@@ -245,6 +245,14 @@ msgctxt "#30183"
|
||||
msgid "Login with username"
|
||||
msgstr "Iniciar sesión con nombre y clave"
|
||||
|
||||
msgctxt "#30184"
|
||||
msgid "Export access token to key file"
|
||||
msgstr "Exportar token de acceso a fichero key"
|
||||
|
||||
msgctxt "#30185"
|
||||
msgid "Select a folder to save the key file"
|
||||
msgstr "Seleccion una carpeta donde guardar el fichero key"
|
||||
|
||||
msgctxt "#30200"
|
||||
msgid "Error"
|
||||
msgstr "Error"
|
||||
|
||||
@@ -748,6 +748,12 @@ class Movistar(object):
|
||||
filename = bytes(filename, 'utf-8')
|
||||
shutil.copyfile(filename, self.cache.config_directory + 'auth.key')
|
||||
|
||||
def export_key_file(self, filename):
|
||||
import shutil
|
||||
if sys.version_info[0] > 2:
|
||||
filename = bytes(filename, 'utf-8')
|
||||
shutil.copyfile(self.cache.config_directory + 'auth.key', filename)
|
||||
|
||||
def load_key_file(self):
|
||||
content = self.cache.load_file('auth.key')
|
||||
if content:
|
||||
|
||||
@@ -404,10 +404,17 @@ def login_with_key():
|
||||
m.install_key_file(filename)
|
||||
clear_session()
|
||||
|
||||
def export_key():
|
||||
directory = xbmcgui.Dialog().browseSingle(0, addon.getLocalizedString(30185), '')
|
||||
if directory:
|
||||
m.export_key_file(directory + 'movistarplus.key')
|
||||
|
||||
def list_users():
|
||||
open_folder(addon.getLocalizedString(30160)) # Change user
|
||||
add_menu_option(addon.getLocalizedString(30183), get_url(action='login')) # Login with username
|
||||
add_menu_option(addon.getLocalizedString(30181), get_url(action='login_with_key')) # Login with key
|
||||
if os.path.exists(profile_dir + 'auth.key'):
|
||||
add_menu_option(addon.getLocalizedString(30184), get_url(action='export_key')) # Export key
|
||||
add_menu_option(addon.getLocalizedString(30150), get_url(action='logout')) # Close session
|
||||
close_folder()
|
||||
|
||||
@@ -438,6 +445,8 @@ def router(paramstring):
|
||||
login_with_key()
|
||||
elif params['action'] == 'login':
|
||||
login()
|
||||
elif params['action'] == 'export_key':
|
||||
export_key()
|
||||
elif params['action'] == 'user':
|
||||
list_users()
|
||||
elif params['action'] == 'logout':
|
||||
|
||||
Reference in new issue
Block a user