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

MSI PRO MAX EDGE AI+, Ryzen AI Max+ 395 e 128 GB per far girare in locale anche i modelli più grandi
MSI PRO MAX EDGE AI+, Ryzen AI Max+ 395 e 128 GB per far girare in locale anche i modelli più grandi
Abbiamo provato MSI PRO MAX EDGE AI+, un mini-PC professionale progettato per eseguire modelli di intelligenza artificiale in locale, senza dipendere dal cloud. Il sistema abbina il processore AMD Ryzen AI Max+ 395, 128 GB di memoria unificata e un telaio in alluminio da appena 4 litri, con l'obiettivo di offrire capacità di elaborazione elevate in un formato compatto.
Recensione vivo X500 Pro Max: la fotografia mobile ha un nuovo protagonista
Recensione vivo X500 Pro Max: la fotografia mobile ha un nuovo protagonista
Il nuovo top di gamma vivo punta su un comparto fotografico particolarmente articolato, con un teleobiettivo da 200 megapixel e teleconvertitori esterni capaci di arrivare a 400 mm equivalenti. Lo abbiamo provato a Tenerife, mettendo alla prova fotocamere, prestazioni, autonomia e accessori. Ecco come si è comportato.
WoW Forever: la beta è stato uno dei momenti più alti della storia dei videogiochi, e non si ripeterà
WoW Forever: la beta è stato uno dei momenti più alti della storia dei videogiochi, e non si ripeterà
Un mondo affollato e vivo, personaggi destinati a sparire a fine test e nessuno a inseguire l'oggetto giusto. Beta e stress test di World of Warcraft: Forever hanno fatto emergere un roleplay spontaneo, tra danze a Goldshire e code ordinate ai PNG
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: 7392
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


MSI PRO MAX EDGE AI+, Ryzen AI Max+ 395 e 128 GB per far girare in locale anche i modelli più grandi MSI PRO MAX EDGE AI+, Ryzen AI Max+ 395 e 128 GB...
Recensione vivo X500 Pro Max: la fotografia mobile ha un nuovo protagonista Recensione vivo X500 Pro Max: la fotografia mobi...
WoW Forever: la beta è stato uno dei momenti più alti della storia dei videogiochi, e non si ripeterà WoW Forever: la beta è stato uno dei mome...
Oracle AI World 2026: in Europa prima la sovranità, poi la sicurezza e solo dopo l'IA Oracle AI World 2026: in Europa prima la sovrani...
DS N°7 E-Tense: il SUV premium made in Melfi che punta su autonomia e comfort DS N°7 E-Tense: il SUV premium made in Melfi...
NVIDIA ai data center: i partner devono ...
L'intelligenza artificiale entra nei bra...
Un pannello e-ink può diventare un assis...
Il progetto open source che doveva liber...
iPhone 18 Pro Max a 1.599€ su Amazon in ...
Ultraviolette X-47 Venom: da EICMA la nu...
Pneumatici a prezzi stracciati su Amazon...
Mercato smartphone: fatturato record e +...
Anche Apple investe tanto nell'IA: +32% ...
Offerte Amazon da non credere: Mac mini ...
Moulinex Easy Fry Silence: friggitrice a...
Dentro la chiavetta USB cifrata c'è solo...
Sull'App Store i chatbot romantici avran...
LG Sound Suite: Dolby Atmos multicanale ...
Siri AI costa troppo, Apple ha già...
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: 12:19.


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