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

Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando
Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando
Abbiamo giocato a lungo a Battlefield 6, abbiamo provato tutte le modalità multiplayer, Redsec, e le numerose personalizzazioni. In sintesi, ci siamo concentrati su ogni aspetto del titolo per comprendere al meglio uno degli FPS più ambiziosi della storia dei videogiochi e, dopo quasi due mesi, abbiamo tirato le somme. In questo articolo, condividiamo con voi tutto ciò che è Battlefield 6, un gioco che, a nostro avviso, rappresenta esattamente ciò che questo genere attendeva da tempo
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare
Abbiamo messo alla prova il drone Antigravity A1 capace di riprese in 8K a 360° che permette un reframe in post-produzione ad eliche ferme. Il concetto è molto valido, permette al pilota di concentrarsi sul volo e le manovre in tutta sicurezza e decidere con tutta tranquillità come gestire le riprese. La qualità dei video, tuttavia, ha bisogno di uno step in più per essere competitiva
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator
Dopo oltre 4 anni si rinnova la serie Sony Alpha 7 con la quinta generazione, che porta in dote veramente tante novità a partire dai 30fps e dal nuovo sensore partially stacked da 33Mpixel. L'abbiamo provata per un breve periodo, ecco come è andata dopo averla messa alle strette.
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


Due mesi di Battlefield 6: dalla campagna al battle royale, è l'FPS che stavamo aspettando Due mesi di Battlefield 6: dalla campagna al bat...
Antigravity A1: drone futuristico per riprese a 360° in 8K con qualche lacuna da colmare Antigravity A1: drone futuristico per riprese a ...
Sony Alpha 7 V, anteprima e novità della nuova 30fps, che tende la mano anche ai creator Sony Alpha 7 V, anteprima e novità della ...
realme GT 8 Pro Dream Edition: prestazioni da flagship e anima racing da F1 realme GT 8 Pro Dream Edition: prestazioni da fl...
OVHcloud Summit 2025: le novità del cloud europeo tra sovranità, IA e quantum OVHcloud Summit 2025: le novità del cloud...
Apple in piena tempesta: anche il boss d...
Due GeForce GTX 580 in SLI: l'insospetta...
TSMC dà i numeri: dal processo N7...
La ricarica wireless dei Samsung Galaxy ...
Stop ai social per gli Under 16: l'Austr...
Google svela i videogiochi più ce...
TikTok lancia il nuovo feed con contenut...
Amazon aggiorna gli sconti e si prepara ...
GeForce NOW: 50% di sconto e 30 nuovi gi...
Insta360 Ace Pro 2 in offerta: disponibi...
Roborock Saros 10R a 909€ invece di 1.39...
Solo oggi due monitor Acer a prezzi assu...
FRITZ!Box in forte sconto su Amazon: mod...
Apple + Samsung = monopolio totale nel Q...
6 TV 4K in super sconto su Amazon, anche...
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: 17:53.


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