get the pause status from amarok 2.1
As the title says, I'm trying to find a way to get the pause status from amarok 2.1. I'm running kubuntu 9.04 with kde 4.2.2, python 2.6.2. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: get the pause status from amarok 2.1
On Fri, 14 Aug 2009 12:55:07 +0200, Diez B. Roggisch wrote: > Sleepy Cabbage schrieb: >> As the title says, I'm trying to find a way to get the pause status >> from amarok 2.1. >> >> I'm running kubuntu 9.04 with kde 4.2.2, python 2.6.2. >> >> Thanks in advance. > > Not at my linux-system right now, but dcop and the respective > python-module should help. > > Diez Thanks for you reply Diez. i'm sure that kde4.2 now uses qdbus instead of dcop and not sure whether amarok has the qdbus org.kde.amarok /Player GetStatus as it returns the following: qdbus: I don't know how to display an argument of type '()' -- http://mail.python.org/mailman/listinfo/python-list
Re: get the pause status from amarok 2.1
On Sat, 15 Aug 2009 09:25:19 +, Sleepy Cabbage wrote: > On Fri, 14 Aug 2009 12:55:07 +0200, Diez B. Roggisch wrote: > >> Sleepy Cabbage schrieb: >>> As the title says, I'm trying to find a way to get the pause status >>> from amarok 2.1. >>> >>> I'm running kubuntu 9.04 with kde 4.2.2, python 2.6.2. >>> >>> Thanks in advance. >> >> Not at my linux-system right now, but dcop and the respective >> python-module should help. >> >> Diez > > Thanks for you reply Diez. i'm sure that kde4.2 now uses qdbus instead > of dcop and not sure whether amarok has the qdbus org.kde.amarok /Player > GetStatus as it returns the following: qdbus: I don't know how to > display an argument of type '()' 'dbus --literal org.kde.amarok /Player org.freedesktop.MediaPlayer.GetStatus' -- http://mail.python.org/mailman/listinfo/python-list
Re: get the pause status from amarok 2.1
On Mon, 17 Aug 2009 07:23:55 +, Sleepy Cabbage wrote: > On Sat, 15 Aug 2009 09:25:19 +0000, Sleepy Cabbage wrote: > >> On Fri, 14 Aug 2009 12:55:07 +0200, Diez B. Roggisch wrote: >> >>> Sleepy Cabbage schrieb: >>>> As the title says, I'm trying to find a way to get the pause status >>>> from amarok 2.1. >>>> >>>> I'm running kubuntu 9.04 with kde 4.2.2, python 2.6.2. >>>> >>>> Thanks in advance. >>> >>> Not at my linux-system right now, but dcop and the respective >>> python-module should help. >>> >>> Diez >> >> Thanks for you reply Diez. i'm sure that kde4.2 now uses qdbus instead >> of dcop and not sure whether amarok has the qdbus org.kde.amarok >> /Player GetStatus as it returns the following: qdbus: I don't know how >> to display an argument of type '()' > > 'dbus --literal org.kde.amarok /Player > org.freedesktop.MediaPlayer.GetStatus' Ref my last post: This works!! -- http://mail.python.org/mailman/listinfo/python-list
urlopen errors in script
I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python console and add the following: >>>import urllib2 >>>from urllib2 import urlopen >>>nowplaying = str.split(urlopen('http://www.hearteastmids.co.uk// jsfiles/NowPlayingDisplay.aspx?f=http%3A%2F%2Frope.ccap.fimc.net%2Ffeeds% 2Fnowplaying%2FGlobal%2FHeart_Network%2FHeart_East_Midlands% 2F6854.xml&l=6854&tzc=8&at=HeartEastMids').read(),'>') >>>print test[4][:-3] this works and displays the artist and song title. However, when I add this to my script I get the following errors: superkaramba(28855) ThemesDlg::addThemeToList: addThemeToList() file: "/ home/sleepy/dev/MyTheme/ MyTheme.theme" superkaramba(28855) Karamba::startKaramba: Loading script module: "MyTheme.py" superkaramba(28855) KarambaInterface::initInterpreter: Using "python" script: "/home/sleepy/dev/MyTheme/ MyTheme.py" Kross: "Loading the interpreter library for python" Kross: "Successfully loaded Interpreter instance from library." Kross: "PythonScript::Constructor." Kross: "PythonScript::execute" Kross: "PythonInterpreter::extractException: File "/home/sleepy/dev/MyTheme/MyTheme.py", line 4, in #this import statement allows access to the karamba functions File "/home/sleepy/dev/MyTheme/MyTheme.py", line 9, in import urllib2 File "", line 18, in _import File "/usr/lib/python2.6/urllib2.py", line 92, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): " Kross: "Error error=Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) lineno=81 trace= File "/home/sleepy/dev/MyTheme/MyTheme.py", line 4, in #this import statement allows access to the karamba functions File "/home/sleepy/dev/MyTheme/MyTheme.py", line 9, in import urllib2 File "", line 18, in _import File "/usr/lib/python2.6/urllib2.py", line 92, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): " TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 38, in apport_excepthook from apport.packaging_impl import impl as packaging File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/__init__.py", line 1, in from apport.report import Report File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/report.py", line 21, in import fileutils File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/fileutils.py", line 16, in from packaging_impl import impl as packaging File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/packaging_impl.py", line 18, in import apt File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apt/__init__.py", line 7, in from apt.package import Package File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apt/package.py", line 23, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Original exception was: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Kross: "PythonScript::Destructor." Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list
urlopen errors in script
I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python console and add the following: ">>>import urllib2" ">>>from urllib2 import urlopen" ">>>nowplaying = str.split(urlopen('http://www.hearteastmids.co.uk// jsfiles/NowPlayingDisplay.aspx?f=http%3A%2F%2Frope.ccap.fimc.net%2Ffeeds% 2Fnowplaying%2FGlobal%2FHeart_Network%2FHeart_East_Midlands% 2F6854.xml&l=6854&tzc=8&at=HeartEastMids').read(),'>')" ">>>print test[4][:-3]" this works and displays the artist and song title. However, when I add this to my script I get the following errors: superkaramba(28855) ThemesDlg::addThemeToList: addThemeToList() file: "/ home/sleepy/dev/MyTheme/ MyTheme.theme" superkaramba(28855) Karamba::startKaramba: Loading script module: "MyTheme.py" superkaramba(28855) KarambaInterface::initInterpreter: Using "python" script: "/home/sleepy/dev/MyTheme/ MyTheme.py" Kross: "Loading the interpreter library for python" Kross: "Successfully loaded Interpreter instance from library." Kross: "PythonScript::Constructor." Kross: "PythonScript::execute" Kross: "PythonInterpreter::extractException: File "/home/sleepy/dev/MyTheme/MyTheme.py", line 4, in #this import statement allows access to the karamba functions File "/home/sleepy/dev/MyTheme/MyTheme.py", line 9, in import urllib2 File "", line 18, in _import File "/usr/lib/python2.6/urllib2.py", line 92, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): " Kross: "Error error=Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) lineno=81 trace= File "/home/sleepy/dev/MyTheme/MyTheme.py", line 4, in #this import statement allows access to the karamba functions File "/home/sleepy/dev/MyTheme/MyTheme.py", line 9, in import urllib2 File "", line 18, in _import File "/usr/lib/python2.6/urllib2.py", line 92, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): " TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 38, in apport_excepthook from apport.packaging_impl import impl as packaging File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/__init__.py", line 1, in from apport.report import Report File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/report.py", line 21, in import fileutils File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/fileutils.py", line 16, in from packaging_impl import impl as packaging File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apport/packaging_impl.py", line 18, in import apt File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apt/__init__.py", line 7, in from apt.package import Package File "", line 18, in _import File "/usr/lib/python2.6/dist-packages/apt/package.py", line 23, in import httplib File "", line 18, in _import File "/usr/lib/python2.6/httplib.py", line 1054, in import ssl File "", line 18, in _import File "/usr/lib/python2.6/ssl.py", line 81, in class SSLSocket (socket): TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Original exception was: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Kross: "PythonScript::Destructor." Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list
Re: urlopen errors in script
On Tue, 18 Aug 2009 13:21:59 +0200, Peter Otten wrote: > Sleepy Cabbage wrote: > >> I'm scripting a superkaramba theme using python and have intgrated >> output from amarok. I have also would like to show the artist and song >> title from a radio stream i've added to my playlist. >> >> If I open a python console and add the following: >> >> ">>>import urllib2" >> ">>>from urllib2 import urlopen" >> >> ">>>nowplaying = str.split(urlopen('http://www.hearteastmids.co.uk// >> jsfiles/NowPlayingDisplay.aspx?f=http%3A%2F%2Frope.ccap.fimc.net% 2Ffeeds% >> 2Fnowplaying%2FGlobal%2FHeart_Network%2FHeart_East_Midlands% >> 2F6854.xml&l=6854&tzc=8&at=HeartEastMids').read(),'>')" >> >> ">>>print test[4][:-3]" >> >> this works and displays the artist and song title. >> >> However, when I add this to my script I get the following errors: > > Please give a minimal version of your script that produces the error, > not some arbitrary excerpt that you ran successfully on the command > line. > > If I were to guess: you are doing something like > > import socket > socket.socket = socket > > somewhere, thus confusing the socket class with the module of the same > name. > > Peter Thanks Peter. This is the script up to where the error seems to fall: "#!/usr/bin/env superkaramba" "# -*- coding: iso-8859-1 -*-" "import karamba" "import subprocess" "from subprocess import Popen, PIPE, STDOUT, call" "import urllib" "from urllib import urlopen" "#this is called when your widget is initialized" "def initWidget(widget):" "clkPause = karamba.createClickArea(widget, 156, 470, 35, 35, "qdbus org.kde.amarok /Player Pause")" "nowplaying = urllib.urlopen('http://www.hearteastmids.co.uk//jsfiles/ NowPlayingDisplay.aspx?f=http%3A%2F%2Frope.ccap.fimc.net%2Ffeeds% 2Fnowplaying%2FGlobal%2FHeart_Network%2FHeart_East_Midlands% 2F6854.xml&l=6854&tzc=8&at=HeartEastMids').read()" Hope this can enlighten things -- http://mail.python.org/mailman/listinfo/python-list
Re: urlopen errors in script
Thanks for the time you've spent anyway Peter. I have superkaramba installed and the rest of the script is running fine, it's only when I put the urlopen part in that it comes back with errors. The quotes are just to make it readable on here as my first attempt at posting muted the text. -- http://mail.python.org/mailman/listinfo/python-list
Re: urlopen errors in script
On Tue, 18 Aug 2009 13:05:03 +, Sleepy Cabbage wrote: > Thanks for the time you've spent anyway Peter. I have superkaramba > installed and the rest of the script is running fine, it's only when I > put the urlopen part in that it comes back with errors. The quotes are > just to make it readable on here as my first attempt at posting muted > the text. This has been solved by upgrading to kde 4.3 -- http://mail.python.org/mailman/listinfo/python-list