Beispiel #1
0
def detalle_fichero_cola(item):
    itemlist = []
    try:
        client = ThriftClient(host=SERVER, port=PORT)
    except:
        itemlist.append(
            Item(title="Login incorrecto",
                 channel=CHANNELNAME,
                 action="mainlist"))
        return itemlist

    p = client.getFileData(int(item.url))
    plot = "Fichero = %s: Estado = %s --> Progreso = %s%% de %s (URL: %s)" % (
        p.name, p.statusmsg, p.progress, p.format_size, p.url)
    if len(p.error) > 0: plot = plot + " ERROR: " + p.error
    itemlist.append(
        Item(title=p.name,
             fulltitle=p.name,
             plot=plot,
             channel=CHANNELNAME,
             action="detalle_fichero_cola",
             url="%s" % p.fid))
    itemlist.append(
        Item(title=plot,
             fulltitle=p.name,
             plot=plot,
             channel=CHANNELNAME,
             action="detalle_fichero_cola",
             url="%s" % p.fid))
    itemlist.append(
        Item(title="Borrar fichero",
             fulltitle=p.name,
             plot=plot,
             channel=CHANNELNAME,
             action="borrar_fichero",
             url="%s" % p.fid))
    itemlist.append(
        Item(title="Reintentar",
             fulltitle=p.name,
             plot=plot,
             channel=CHANNELNAME,
             action="reintentar_fichero",
             url="%s" % p.fid))
    itemlist.append(
        Item(title="Volver",
             fulltitle=p.name,
             plot=plot,
             channel=CHANNELNAME,
             action="ver_paquete",
             url="%s" % p.packageID))

    return itemlist
Beispiel #2
0
def detalle_fichero_cola(item):
    itemlist = []
    try:
        client = ThriftClient(host=SERVER, port=PORT)
    except:
        itemlist.append( Item( title="Login incorrecto", channel=CHANNELNAME, action="mainlist" ) )
        return itemlist

    p = client.getFileData(int(item.url))
    plot = "Fichero = %s: Estado = %s --> Progreso = %s%% de %s (URL: %s)" % (p.name, p.statusmsg, p.progress, p.format_size, p.url)
    if len(p.error) > 0: plot = plot+" ERROR: "+p.error 
    itemlist.append( Item( title=p.name, fulltitle=p.name, plot=plot, channel=CHANNELNAME, action="detalle_fichero_cola",url="%s" % p.fid ) )
    itemlist.append( Item( title=plot, fulltitle=p.name, plot=plot, channel=CHANNELNAME, action="detalle_fichero_cola",url="%s" % p.fid ) )
    itemlist.append( Item( title="Borrar fichero", fulltitle=p.name, plot=plot, channel=CHANNELNAME, action="borrar_fichero",url="%s" % p.fid ) )
    itemlist.append( Item( title="Reintentar", fulltitle=p.name, plot=plot, channel=CHANNELNAME, action="reintentar_fichero",url="%s" % p.fid ) )
    itemlist.append( Item( title="Volver", fulltitle=p.name, plot=plot, channel=CHANNELNAME, action="ver_paquete",url="%s" % p.packageID ) )

    return itemlist