fix sezione "I miei link"
This commit is contained in:
@@ -298,13 +298,13 @@ def run(item=None):
|
||||
if hasattr(e, 'reason'):
|
||||
logger.error("Razon del error, codigo: %s | Razon: %s" % (str(e.reason[0]), str(e.reason[1])))
|
||||
texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web"
|
||||
platformtools.dialog_ok("alfa", texto)
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), texto)
|
||||
|
||||
# Grab server response errors
|
||||
elif hasattr(e, 'code'):
|
||||
logger.error("Codigo de error HTTP : %d" % e.code)
|
||||
# "El sitio web no funciona correctamente (error http %d)"
|
||||
platformtools.dialog_ok("alfa", config.get_localized_string(30051) % e.code)
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(30051) % e.code)
|
||||
except WebErrorException, e:
|
||||
import traceback
|
||||
logger.error(traceback.format_exc())
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<setting id="addon_update_enabled" type="bool" label="70581" default="true"/>
|
||||
<setting id="addon_update_message" type="bool" label="70582" default="true"/>
|
||||
|
||||
<setting label="Lista activa" type="text" id="lista_activa" default="alfavorites-default.json" visible="false"/>
|
||||
<setting label="Lista activa" type="text" id="lista_activa" default="kodfavorites-default.json" visible="false"/>
|
||||
|
||||
<setting type="sep"/>
|
||||
<setting label="70583" type="lsep"/>
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_filename_from_name(name):
|
||||
# Apuntar en un fichero de log los códigos de los ficheros que se hayan compartido
|
||||
def save_log_lista_shared(msg):
|
||||
msg = fechahora_actual() + ': ' + msg + os.linesep
|
||||
fullfilename = os.path.join(config.get_data_path(), 'alfavorites_shared.log')
|
||||
fullfilename = os.path.join(config.get_data_path(), 'kodfavorites_shared.log')
|
||||
with open(fullfilename, 'a') as f: f.write(msg); f.close()
|
||||
|
||||
# Limpiar texto para usar como nombre de fichero
|
||||
@@ -67,7 +67,7 @@ def text_clean(txt, disallowed_chars = '[^a-zA-Z0-9\-_()\[\]. ]+', blank_char =
|
||||
|
||||
# Clase para cargar y guardar en el fichero de Alfavoritos
|
||||
# --------------------------------------------------------
|
||||
class AlfavoritesData:
|
||||
class kodfavoritesData:
|
||||
|
||||
def __init__(self, filename = None):
|
||||
|
||||
@@ -124,7 +124,7 @@ class AlfavoritesData:
|
||||
|
||||
def addFavourite(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
# Si se llega aquí mediante el menú contextual, hay que recuperar los parámetros action y channel
|
||||
if item.from_action:
|
||||
@@ -177,7 +177,7 @@ def addFavourite(item):
|
||||
|
||||
def mainlist(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
item.category = get_name_from_filename(os.path.basename(alfav.user_favorites_file))
|
||||
|
||||
itemlist = []
|
||||
@@ -214,7 +214,7 @@ def mainlist(item):
|
||||
|
||||
def mostrar_perfil(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
itemlist = []
|
||||
|
||||
@@ -289,7 +289,7 @@ def _crea_perfil(alfav):
|
||||
|
||||
def crear_perfil(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not _crea_perfil(alfav): return False
|
||||
|
||||
@@ -299,7 +299,7 @@ def crear_perfil(item):
|
||||
|
||||
def editar_perfil_titulo(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
|
||||
@@ -316,7 +316,7 @@ def editar_perfil_titulo(item):
|
||||
|
||||
def eliminar_perfil(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
|
||||
@@ -364,7 +364,7 @@ def acciones_enlace(item):
|
||||
|
||||
def editar_enlace_titulo(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -386,7 +386,7 @@ def editar_enlace_titulo(item):
|
||||
|
||||
def editar_enlace_color(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -410,7 +410,7 @@ def editar_enlace_color(item):
|
||||
|
||||
def editar_enlace_thumbnail(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -470,7 +470,7 @@ def editar_enlace_thumbnail(item):
|
||||
|
||||
def editar_enlace_carpeta(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -489,7 +489,7 @@ def editar_enlace_carpeta(item):
|
||||
|
||||
def editar_enlace_lista(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -510,7 +510,7 @@ def editar_enlace_lista(item):
|
||||
if ret == -1:
|
||||
return False # pedido cancel
|
||||
|
||||
alfav_destino = AlfavoritesData(opciones[ret])
|
||||
alfav_destino = kodfavoritesData(opciones[ret])
|
||||
|
||||
# Diálogo para escoger/crear carpeta en la lista de destino
|
||||
i_perfil = _selecciona_perfil(alfav_destino, 'Seleccionar carpeta destino', -1)
|
||||
@@ -527,7 +527,7 @@ def editar_enlace_lista(item):
|
||||
|
||||
def eliminar_enlace(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
|
||||
@@ -543,7 +543,7 @@ def eliminar_enlace(item):
|
||||
# ------------------------
|
||||
def mover_perfil(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
alfav.user_favorites = _mover_item(alfav.user_favorites, item.i_perfil, item.direccion)
|
||||
alfav.save()
|
||||
@@ -553,7 +553,7 @@ def mover_perfil(item):
|
||||
|
||||
def mover_enlace(item):
|
||||
logger.info()
|
||||
alfav = AlfavoritesData()
|
||||
alfav = kodfavoritesData()
|
||||
|
||||
if not alfav.user_favorites[item.i_perfil]: return False
|
||||
alfav.user_favorites[item.i_perfil]['items'] = _mover_item(alfav.user_favorites[item.i_perfil]['items'], item.i_enlace, item.direccion)
|
||||
@@ -651,7 +651,7 @@ def activar_lista(item):
|
||||
config.set_setting('lista_activa', item.lista)
|
||||
|
||||
from channelselector import get_thumb
|
||||
item_inicio = Item(title=config.get_localized_string(70527), channel="alfavorites", action="mainlist",
|
||||
item_inicio = Item(title=config.get_localized_string(70527), channel="kodfavorites", action="mainlist",
|
||||
thumbnail=get_thumb("mylink.png"),
|
||||
category=config.get_localized_string(70527), viewmode="thumbnails")
|
||||
platformtools.itemlist_update(item_inicio, replace=True)
|
||||
@@ -721,7 +721,7 @@ def informacion_lista(item):
|
||||
platformtools.dialog_ok('Alfa', config.get_localized_string(70630), item.lista)
|
||||
return False
|
||||
|
||||
alfav = AlfavoritesData(item.lista)
|
||||
alfav = kodfavoritesData(item.lista)
|
||||
|
||||
txt = 'Lista: [COLOR gold]%s[/COLOR]' % item.lista
|
||||
txt += '[CR]' + config.get_localized_string(70634) + ' ' + alfav.info_lista['created'] + ' ' + config.get_localized_string(70635) + ' ' + alfav.info_lista['updated']
|
||||
@@ -783,7 +783,7 @@ def compartir_lista(item):
|
||||
# Apuntar código en fichero de log y dentro de la lista
|
||||
save_log_lista_shared(config.get_localized_string(70648) + ' ' + item.lista + ' ' + codigo + ' ' + config.get_localized_string(70649))
|
||||
|
||||
alfav = AlfavoritesData(item.lista)
|
||||
alfav = kodfavoritesData(item.lista)
|
||||
alfav.info_lista['tinyupload_date'] = fechahora_actual()
|
||||
alfav.info_lista['tinyupload_code'] = codigo
|
||||
alfav.save()
|
||||
@@ -844,7 +844,7 @@ def crear_lista(item):
|
||||
return False
|
||||
|
||||
# Provocar que se guarde con las carpetas vacías por defecto
|
||||
alfav = AlfavoritesData(filename)
|
||||
alfav = kodfavoritesData(filename)
|
||||
|
||||
platformtools.itemlist_refresh()
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user