Torna indietro   Hardware Upgrade Forum > Software > Linux, Unix, OS alternativi

Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria
Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria
vivo X300 Pro rappresenta un'evoluzione misurata della serie fotografica del produttore cinese, con un sistema di fotocamere migliorato, chipset Dimensity 9500 di ultima generazione e l'arrivo dell'interfaccia OriginOS 6 anche sui modelli internazionali. La scelta di limitare la batteria a 5.440mAh nel mercato europeo, rispetto ai 6.510mAh disponibili altrove, fa storcere un po' il naso
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo
Lenovo Legion Go 2 è la nuova handheld PC gaming con processore AMD Ryzen Z2 Extreme (8 core Zen 5/5c, GPU RDNA 3.5 16 CU) e schermo OLED 8,8" 1920x1200 144Hz. È dotata anche di controller rimovibili TrueStrike con joystick Hall effect e una batteria da 74Wh. Rispetto al dispositivo che l'ha preceduta, migliora ergonomia e prestazioni a basse risoluzioni, ma pesa 920g e costa 1.299€ nella configurazione con 32GB RAM/1TB SSD e Z2 Extreme
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti
A re:Invent 2025, AWS mostra un’evoluzione profonda della propria strategia: l’IA diventa una piattaforma di servizi sempre più pronta all’uso, con agenti e modelli preconfigurati che accelerano lo sviluppo, mentre il cloud resta la base imprescindibile per governare dati, complessità e lock-in in uno scenario sempre più orientato all’hybrid cloud
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 24-10-2005, 22:02   #1
lnessuno
Bannato
 
L'Avatar di lnessuno
 
Iscritto dal: Feb 2000
Città: The city of wasting disease
Messaggi: 7390
In-utility: visualizzare nella signature ciò che sta suonando amarok

se qualcuno fosse interessato... ho modificato uno script che ho trovato da qualche parte.

praticamente installando questo script in amarok, e configurandolo con il proprio nome utente e password, è possibile dire al proprio lettore di scrivere quello che sta suonando nella signature di questo forum... (vedi mia sign).

non serve a nulla però è carino


questo è il codice:

[code]#!/usr/bin/env python

# Depends on ClientForm hacked on line 2853

__module_name__ = "amarok_HWU_nowplaying"
__module_version__ = "0.1"
__module_description__ = "python module for displaying nowplaying on the hwupgrade forum : http://forum.hwupgrade.it"

import ConfigParser
import Queue
import os.path
import sys
import threading
import re
from os import *
# I don't have found pcop for Mandriva :-(
#import pcop
import ClientForm
import cookielib, urllib2
import commands

try:
from qt import *
except:
popen( "kdialog --sorry 'PyQt (Qt bindings for Python) is required for this script.'" )
raise

debug_prefix = "[AmaroK HWUNowPlaying Script]"

class ConfigDialog( QDialog ):
""" Configuration widget """

def __init__( self ):
self.load()
QDialog.__init__( self )
self.setWFlags( Qt.WDestructiveClose )
self.setCaption( "HWU Now Playing - amaroK" )

self.lay = QHBoxLayout( self )

self.vbox = QVBox( self )
self.lay.addWidget( self.vbox )

self.hboxLoginPassText = QHBox( self.vbox )
self.vboxLoginPass = QVBox( self.hboxLoginPassText )
self.vboxLoginPass.setMargin(5)

QLabel( "Username e password del forum", self.vboxLoginPass )

# Nickname
self.hboxLogin = QHBox( self.vboxLoginPass )
self.hboxLogin.setMargin(5)
QLabel( "User name : ", self.hboxLogin )

self.lineEdit1 = QLineEdit(self.hboxLogin,"lineEdit1")
self.lineEdit1.setGeometry(QRect(20,20,131,23))
self.lineEdit1.setText(self.username)

# Password
self.hboxPass = QHBox( self.vboxLoginPass )
self.hboxPass.setMargin(5)
QLabel( "User password : ", self.hboxPass )
self.lineEdit1_2 = QLineEdit(self.hboxPass,"lineEdit1_2")
self.lineEdit1_2.setGeometry(QRect(20,50,131,23))
self.lineEdit1_2.setEchoMode(QLineEdit.Password)
self.lineEdit1_2.setText(self.password)

explanation = QLabel( "Scrivi qua la tua signature!<br>Le parole racchiuse fra i caratteri '$' saranno interpretate come variabili di AmaroK. Quindi $artista$ visualizza il nome dell'artista, $title$ il titolo etc. Per avere la lista completa di queste variabili, scrivi in una console 'dcop amarok player '.", self.hboxLoginPassText )
explanation.setMargin(8)

# NowPlaying
self.hbox3 = QHBox( self.vbox)
self.hbox3.setMargin(5)
QLabel( "Testo in lettura: ", self.hbox3 )
self.lineEdit3 = QLineEdit(self.hbox3,"lineEdit3")
self.lineEdit3.setGeometry(QRect(20,20,231,23))
self.lineEdit3.setText(self.formatNowPlaying)
self.lineEdit3.setCursorPosition(0)

# NowPlayingPause
self.hbox5 = QHBox( self.vbox)
self.hbox5.setMargin(5)
QLabel( "Testo in pausa: ", self.hbox5 )
self.lineEdit5 = QLineEdit(self.hbox5,"lineEdit5")
self.lineEdit5.setGeometry(QRect(20,20,231,23))
self.lineEdit5.setText(self.formatNowPlayingPause)
self.lineEdit5.setCursorPosition(0)

# lastPlaying
self.hbox7 = QHBox( self.vbox)
self.hbox7.setMargin(5)
QLabel( "Testo fermo: ", self.hbox7 )
self.lineEdit7 = QLineEdit(self.hbox7,"lineEdit7")
self.lineEdit7.setGeometry(QRect(20,20,231,23))
self.lineEdit7.setText(self.formatLastPlaying)
self.lineEdit7.setCursorPosition(0)

# Buttons OK Cancel
self.hboxbuttons = QHBox( self.vbox )
self.hboxbuttons.setMargin(5)

self.ok = QPushButton( self.hboxbuttons )
self.ok.setText( "Ok" )

self.cancel = QPushButton( self.hboxbuttons )
self.cancel.setText( "Cancel" )
self.cancel.setDefault( True )

self.connect( self.ok, SIGNAL( "clicked()" ), self.save )
self.connect( self.cancel, SIGNAL( "clicked()" ), self, SLOT( "reject()" ) )

self.adjustSize()

def load( self ):
# defaults values
self.username = "username"
self.password = "password"
self.formatNowPlaying='Sto ascoltando: $artist$ - $title$'
self.formatNowPlayingPause='Sto ascoltando (pausa): $artist$ - $title$'
self.formatLastPlaying='Ultima canzone ascoltata: $artist$ - $title$'

""" Loads configuration from file """
self.config = ConfigParser.ConfigParser()
self.config.read( "VVnowplayingrc" )
try:
self.username = self.config.get( "General", "username" )
self.password = self.config.get( "General", "password" )
debug( "load :: Loaded from config file : username = " + str(self.username) + " ; password = " + "******\n");#str(self.password)
except:
debug("load :: No user/password found in the config file\n")
try:
self.formatNowPlaying = self.config.get( "General", "formatNowPlaying" )
self.formatNowPlayingPause = self.config.get( "General", "formatNowPlayingPause" )
self.formatLastPlaying = self.config.get( "General", "formatLastPlaying" )
except:
debug("load :: No display settings found in the config file\n")

def save( self ):
""" Saves configuration to file """

self.file = file( "VVnowplayingrc", 'w' )
self.config = ConfigParser.ConfigParser()
self.config.add_section( "General" )
debug( "save :: username = " + str(self.lineEdit1.text()) + " ; password = " + "******\n");
self.config.set( "General", "username", str(self.lineEdit1.text()))
self.config.set( "General", "password", str(self.lineEdit1_2.text()))
self.config.set( "General", "formatNowPlaying", str(self.lineEdit3.text()))
self.config.set( "General", "formatNowPlayingPause", str(self.lineEdit5.text()))
self.config.set( "General", "formatLastPlaying", str(self.lineEdit7.text()))
self.config.write( self.file )
self.file.close()

self.accept()

class Notification( QCustomEvent ):
__super_init = QCustomEvent.__init__
def __init__( self, str ):
self.__super_init(QCustomEvent.User + 1)
self.string = str


class VVNowPlaying( QApplication ):
""" The main application, also sets up the Qt event loop """

def __init__( self, args ):
QApplication.__init__( self, args )
debug( "Started.\n" )

self.queue = Queue.Queue()
self.startTimer( 100 )

# Start separate thread for reading data from stdin
self.stdinReader = threading.Thread( target = self.readStdin )
self.stdinReader.start()

self.username = "username"
self.password = "password"
self.formatNowPlaying='NP : $artist$ - $title$'
self.formatNowPlayingPause='NP (paused) : $artist$ - $title$'
self.formatLastPlaying='Last Played : $artist$ - $title$'

self.tags = {}
self.readSettings()

def readSettings( self ):
""" Reads settings from configuration file """
self.config = ConfigParser.ConfigParser()
self.config.read( "VVnowplayingrc" )
try:
self.username = self.config.get( "General", "username" )
self.password = self.config.get( "General", "password" )
debug( "readSettings :: Loaded from config file : username = " + str(self.username) + " ; password = " + "******\n");#str(self.password)
except:
debug("readSettings :: No user/password found in the config file\n")
try:
self.formatNowPlaying = self.config.get( "General", "formatNowPlaying" )
self.formatNowPlayingPause = self.config.get( "General", "formatNowPlayingPause" )
self.formatLastPlaying = self.config.get( "General", "formatLastPlaying" )
except:
debug("readSettings :: No display settings found in the config file\n")

############################################################################
# Stdin-Reader Thread
############################################################################

def readStdin( self ):
""" Reads incoming notifications from stdin """
while True:
# Read data from stdin. Will block until data arrives.
line = sys.stdin.readline()
if line:
self.queue.put_nowait( line )
else:
break

############################################################################
# Notification Handling
############################################################################

def timerEvent( self, event ):
""" Polls the notification queue at regular interval """
if not self.queue.empty():
string = QString( self.queue.get_nowait() )
debug( "Received notification: " + str( string ) )
if string.contains( "configure" ):
self.dia = ConfigDialog()
self.dia.show()
self.connect( self.dia, SIGNAL( "destroyed()" ), self.readSettings )
if string.contains( "engineStateChange: play" ):
self.nowplaying()
if string.contains( "engineStateChange: idle" ):
self.lastplaying()
if string.contains( "engineStateChange: pause" ):
self.nowplaying_pause()
if string.contains( "engineStateChange: empty" ):
self.lastplaying()
if string.contains( "trackChange" ):
pass

def nowplaying(self):
self.fetchTags();
self.formatDisplay(self.formatNowPlaying);
self.updateVVSignature(self.username,self.password,self.nowPlaying);

def nowplaying_pause(self):
self.formatDisplay(self.formatNowPlayingPause);
self.updateVVSignature(self.username,self.password,self.nowPlaying);

def lastplaying(self):
self.formatDisplay(self.formatLastPlaying);
self.updateVVSignature(self.username,self.password,self.nowPlaying);

# fetch info tags needed for displaying according to the format
def fetchTags(self):
self.tags['plop']='plop'
# fetch all formats, because some tags could be in other than the basic formatNowPlaying
for code in re.findall(r'\$[^\$]*\$',self.formatNowPlaying):
self.tags[code] = commands.getoutput('dcop amarok player '+code[1:-1]);
for code in re.findall(r'\$[^\$]*\$',self.formatNowPlayingPause):
self.tags[code] = commands.getoutput('dcop amarok player '+code[1:-1]);
for code in re.findall(r'\$[^\$]*\$',self.formatLastPlaying):
self.tags[code] = commands.getoutput('dcop amarok player '+code[1:-1]);

# build the string to be displayed according to the format
def formatDisplay(self,format):
self.nowPlaying = format
for code in re.findall(r'\$[^\$]*\$',self.nowPlaying):
try :
self.tags[code]
except:
# Occurs if running scripts when playing, and press pause or stop
self.fetchTags();
self.nowPlaying = self.nowPlaying.replace(code,self.tags
Codice:
);
		debug("fetchAmarokNP : " + str(self.nowPlaying) + "\n")
	
	def updateVVSignature(self,identifiant,password,signature) :
# 		debug("updateVVSignature : "+str(identifiant)+" - " + "******\n");
# 		debug("updateVVSignature : signature = "+str(signature)+"\n")
		# utilisation de cookie
		cj = cookielib.CookieJar()
		# ouverture de la connexion	
		opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
		
		# ouverture de la page d'identification
		responseIdentification = opener.open("http://www.hwupgrade.it/forum/index.php");
		# recuperation du formulaire
		formsIdentification = ClientForm.ParseResponse(responseIdentification);
		responseIdentification.close();
		formIdentification = formsIdentification[0];
		# remplissage du formulaire
		formIdentification["vb_login_username"] = identifiant;
		formIdentification["vb_login_password"] = password;
	
		# envoie du formulaire rempli
		requestAfterIdentification = formIdentification.click(type="submit")
		opener.open(requestAfterIdentification).close()
		
		# ouverture de la page de modification de la signature
		responseEditSignature = opener.open("http://www.hwupgrade.it/forum/profile.php?do=editsignature")
		# recuperation du formulaire
		formsEditProfile = ClientForm.ParseResponse(responseEditSignature);
		responseEditSignature.close();
		formEditProfile = formsEditProfile[0];
		# modification de la signature	
		formEditProfile["message"]=signature;
		# envoie du formulaire rempli
		requestAfterProfileUpdate = formEditProfile.click(type="submit")
		responseAfterProfileUpdate= opener.open(requestAfterProfileUpdate)
		responseAfterProfileUpdate.close()

############################################################################

def debug( message ):
	""" Prints debug message to stdout """
	sys.stderr.write(debug_prefix + " " + message)

def main( args ):
	app = VVNowPlaying( args )
	app.exec_loop()

if __name__ == "__main__":
	main( sys.argv )

salvare con il nome AmarokHWUnowPlaying.py e compattarlo con tar. poi da strumenti - gestione script si va su installa script, si punta il file et voilà... (una volta lanciato bisogna configurarlo cmq!)

boh a me serviva e l'ho fatto, se serve anche a qualcun altro... tanto meglio
lnessuno è offline   Rispondi citando il messaggio o parte di esso
Old 24-10-2005, 23:42   #2
SilverXXX
Senior Member
 
L'Avatar di SilverXXX
 
Iscritto dal: Jan 2004
Città: Gatteo
Messaggi: 2955
Truzzo il giusto
Io aspette la nuova release dikopete che permetta di usare i commenti, così lì caccio lì le canzoni. La mi asignature è personale e guai a chi la tocca
__________________
And so at last the beast fell and the unbelievers rejoiced. But all was not lost, for from the ash rose a great bird. The bird gazed down upon the unbelievers and cast fire and thunder upon them. For the beast had been reborn with its strength renewed, and the followers of Mammon cowered in horror.
SilverXXX è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria Recensione vivo X300 Pro: è ancora lui il...
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'...
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti AWS re:Invent 2025: inizia l'era dell'AI-as-a-Se...
Cos'è la bolla dell'IA e perché se ne parla Cos'è la bolla dell'IA e perché se...
BOOX Palma 2 Pro in prova: l'e-reader diventa a colori, e davvero tascabile BOOX Palma 2 Pro in prova: l'e-reader diventa a ...
Factorial, azienda di batterie allo stat...
Le specifiche fuori di testa della Yangw...
I numeri incredibili di Xiaomi: nel 2025...
In Cina è pronto il parco fotovol...
Neuralink accelera: produzione di massa ...
Starlink abbassa l'orbita di migliaia di...
Dal MIT una nuova batteria per auto elet...
Adam Mosseri parla di IA su Instagram: l...
Suonerie personalizzate e Tone Store: il...
LG UltraGear evo: svelati i monitor gami...
Nelle offerte Amazon del nuovo anno ci s...
Meta Quest 3 da 512 GB torna a 469€ con ...
Steam a inizio 2026: i giochi più vendut...
Auto sempre al top: compressore Xiaomi, ...
In Francia si ragiona sul ban dei social...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 16:39.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v