Hi folks, I have plans for a pytone-plugins package for debian, to do that properly I want to setup a website where everybody is able download and to provide own plugins. To get a start I ask you to send me your plugins or scripts you have written for pytone. Later the archiv will be a darcs repo and everybody should be able to send me the stuff via darcs --send :). But at first I want to have some scripts for the initial archiv. So, if you have written something for pytone and you think it could be usefull to others, please send me.
Best wishes Alex
On Sun, 15 May 2005, Alexander Wirt wrote:
I have plans for a pytone-plugins package for debian, to do that properly I want to setup a website where everybody is able download and to provide own plugins. To get a start I ask you to send me your plugins or scripts you have written for pytone. Later the archiv will be a darcs repo and everybody should be able to send me the stuff via darcs --send :). But at first I want to have some scripts for the initial archiv. So, if you have written something for pytone and you think it could be usefull to others, please send me.
You can include my xterm plugin if you like, but it needs a better name since it's not only for xterm. Maybe term-title ?
PS I would like to do the same for Red Hat/Fedora, but since most (if not all) plugins are pretty small in size I prefer to have them shipped with pytone itself. I don't see a good point in making it a seperate package.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
Hi,
On 18.05.05, Dag Wieers wrote:
On Sun, 15 May 2005, Alexander Wirt wrote:
I have plans for a pytone-plugins package for debian, to do that properly I want to setup a website where everybody is able download and to provide own plugins. To get a start I ask you to send me your plugins or scripts you have written for pytone. Later the archiv will be a darcs repo and everybody should be able to send me the stuff via darcs --send :). But at first I want to have some scripts for the initial archiv. So, if you have written something for pytone and you think it could be usefull to others, please send me.
It would be really cool if somebody else could manage the plugins - assuming that there will be more than a few :-) So, Alex, your initiative is very welcome!
You can include my xterm plugin if you like, but it needs a better name since it's not only for xterm. Maybe term-title ?
The dash in the middle is probably not optimal (I don't think that Python likes such things in module names, but maybe I'm wrong). So how about termtitle?
Jörg
On Thu, 19 May 2005, Joerg Lehmann wrote:
On 18.05.05, Dag Wieers wrote:
On Sun, 15 May 2005, Alexander Wirt wrote:
I have plans for a pytone-plugins package for debian, to do that properly I want to setup a website where everybody is able download and to provide own plugins. To get a start I ask you to send me your plugins or scripts you have written for pytone. Later the archiv will be a darcs repo and everybody should be able to send me the stuff via darcs --send :). But at first I want to have some scripts for the initial archiv. So, if you have written something for pytone and you think it could be usefull to others, please send me.
You can include my xterm plugin if you like, but it needs a better name since it's not only for xterm. Maybe term-title ?
The dash in the middle is probably not optimal (I don't think that Python likes such things in module names, but maybe I'm wrong). So how about termtitle?
Perfect, I attached the termtitle plugin. It is now a self-contained file (not a directory) with some information included. Feel free to copy and distribute it as you like.
I also attached an osdtitle plugin, which makes the changesongcommand obsolete for this use. (The plugin is nicer to configure/add than changesongcommand imo)
PS The ~/.pytone/plugins directory does not seem to work on my system. Pytone does not find the plugins there.
PS2 The advantage of a self-contained plugin is that people can now copy&paste it directly from the mailinglist into the plugin directory.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
Hi Dag!
On 29.05.05, Dag Wieers wrote:
On Thu, 19 May 2005, Joerg Lehmann wrote:
On 18.05.05, Dag Wieers wrote:
On Sun, 15 May 2005, Alexander Wirt wrote:
I have plans for a pytone-plugins package for debian, to do that properly I want to setup a website where everybody is able download and to provide own plugins. To get a start I ask you to send me your plugins or scripts you have written for pytone. Later the archiv will be a darcs repo and everybody should be able to send me the stuff via darcs --send :). But at first I want to have some scripts for the initial archiv. So, if you have written something for pytone and you think it could be usefull to others, please send me.
You can include my xterm plugin if you like, but it needs a better name since it's not only for xterm. Maybe term-title ?
The dash in the middle is probably not optimal (I don't think that Python likes such things in module names, but maybe I'm wrong). So how about termtitle?
Perfect, I attached the termtitle plugin. It is now a self-contained file (not a directory) with some information included. Feel free to copy and distribute it as you like.
I also attached an osdtitle plugin, which makes the changesongcommand obsolete for this use. (The plugin is nicer to configure/add than changesongcommand imo)
Cool. Note that in the tar-ball I just posted the link to, only the termtitle plugin is included - in an older version. I'll put up a new version later.
The osdplugin is really nice, it's much cleaner and nicer than the older solution!
PS The ~/.pytone/plugins directory does not seem to work on my system. Pytone does not find the plugins there.
Thanks, I'll have a look.
PS2 The advantage of a self-contained plugin is that people can now copy&paste it directly from the mailinglist into the plugin directory.
Yep, but AFAICS everything works also for modules, so there is no problem...
Jörg
Hi Dag!
a few comments/questions regarding the termtitle plugin.
On 29.05.05, Dag Wieers wrote: [...]
import events, plugin, config, sys, os, re
class config(config.configsection): songformat = config.configstring('%(artist)s - %(title)s') term = os.getenv('TERM')
Is term supposed to be config options? If yes and in case you want to specify a default, use term = config.configstring(os.getenv('TERM'))
termre = re.compile('(screen|xterm-*)')
Here applies the same, except that you have to compile the regexp in the plugin and not its config.
Anyway, both options are currently not used...
class plugin(plugin.plugin): def start(self): self.channel.subscribe(events.playbackinfochanged, self.playbackinfochanged) self.previoussong = '' self.previouscross = False
def playbackinfochanged(self, event): if event.playbackinfo.song != self.previoussong: self.changetermtitle(event) self.previoussong = event.playbackinfo.song if event.playbackinfo.iscrossfading() != self.previouscross: self.changetermtitle(event) self.previouscross = event.playbackinfo.iscrossfading()
def changetermtitle(self, event): prefix = (event.playbackinfo.iscrossfading() and "-> " or "") song = event.playbackinfo.song.format(self.config.songformat, safe=True) sys.stdout.write('\033]0;' + prefix + song + '\007')
# vim:ts=4:sw=4
On Sun, 29 May 2005, Joerg Lehmann wrote:
a few comments/questions regarding the termtitle plugin.
On 29.05.05, Dag Wieers wrote: [...]
import events, plugin, config, sys, os, re
class config(config.configsection): songformat = config.configstring('%(artist)s - %(title)s') term = os.getenv('TERM')
Is term supposed to be config options? If yes and in case you want to specify a default, use term = config.configstring(os.getenv('TERM'))
Nope, I see no reason to let people specify this themselves.
termre = re.compile('(screen|xterm*)')
Here applies the same, except that you have to compile the regexp in the plugin and not its config.
It would be nicer to check for the capability instead of matching it to a known list. But I'm not sure if that is possible. (ie. other programs do the same)
Ah, I noticed though that it should be xterm*, not xterm-*.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
On Sun, 29 May 2005, Dag Wieers wrote:
Ah, I noticed though that it should be xterm*, not xterm-*.
Somehow my terminal type check got lost too and I fixed another issue with crossfading. I moved the terminal related stuff to start(). Is there a way a plugin can disable itself (ie. being destroyed if start() fails or something).
http://dag.wieers.com/home-made/pytone/termtitle.py
The osdtitle plugin will now do its osd_cat stuff in the background, so it's no longer blocking other plugins.
http://dag.wieers.com/home-made/pytone/osdtitle.py
Kind regards, -- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
Ah, I noticed though that it should be xterm*, not xterm-*.
Somehow my terminal type check got lost too and I fixed another issue with crossfading. I moved the terminal related stuff to start(). Is there a way a plugin can disable itself (ie. being destroyed if start() fails or something).
Just raise an exception, which currently stops PyTone. Then the user has to deconfigure the plugin. In the future, one could also just disable the plugin and report this to the error log.
The osdtitle plugin will now do its osd_cat stuff in the background, so it's no longer blocking other plugins.
Fine.
I put a new tarball with the plugins online under the path I've send before. Testing is appreciated.
Jörg
PS: The problem with the ~/.pytone/plugins directory is, that there has to be an __init__.py file present (just create an empty one).
On Sun, 29 May 2005, Joerg Lehmann wrote:
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
I put a new tarball with the plugins online under the path I've send before. Testing is appreciated.
When building I get this:
[root@emyn PyTone-2.2.3+]# ./setup.py build running build running build_py package init file 'src/plugins/termtitle/__init__.py' not found (or not a regular file) error: package directory 'src/plugins/audioscrobbler' does not exist
After removing both plugins from setup.py it is ok. I thought you mentioned that you added the new plugins ?
Then when running:
[dag@emyn ~]$ pytone Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pytone/pytone.py", line 57, in ? config.processconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 905, in processconfig processstandardconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 759, in processstandardconfig readconfigsection(section, eval(section)) File "/usr/lib/python2.3/site-packages/pytone/config.py", line 699, in readconfigsection raise ConfigError("Unkown configuration option '%s' in section '%s'" % config.ConfigError: Unkown configuration option 'server' in section 'network'
After removing the server option in the network section I got another backtrace which is related to the window size of the xterm. Apparently 80x25 is still not sufficient for pytone on startup ?
Also could you create it as 2.2.3.1 or something similar, not the plus sign, otherwise I have difficulties to package it properly. I'd like to create test packages of those releases too.
PS: The problem with the ~/.pytone/plugins directory is, that there has to be an __init__.py file present (just create an empty one).
If I do this, it works but it will only recognize the plugins in my user-directory (~/.pytone/plugins) not the ones I have in the global directory.
Also in this case, pytone bails out if it cannot find a plugin. It would be nicer to eg. display a message (maybe with: press enter to proceed) or just log the failure and continue.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
Hi Dag,
On 05.06.05, Dag Wieers wrote:
On Sun, 29 May 2005, Joerg Lehmann wrote:
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
I put a new tarball with the plugins online under the path I've send before. Testing is appreciated.
When building I get this:
[root@emyn PyTone-2.2.3+]# ./setup.py build running build running build_py package init file 'src/plugins/termtitle/__init__.py' not found (or not a regular file) error: package directory 'src/plugins/audioscrobbler' does not exist
After removing both plugins from setup.py it is ok. I thought you mentioned that you added the new plugins ?
I still wait for permission to distribute the audioscrobbler plugin. The termtitle plugin is no longer a package, but I did not yet fix the setup.py file.
Then when running:
[dag@emyn ~]$ pytone Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pytone/pytone.py", line 57, in ? config.processconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 905, in processconfig processstandardconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 759, in processstandardconfig readconfigsection(section, eval(section)) File "/usr/lib/python2.3/site-packages/pytone/config.py", line 699, in readconfigsection raise ConfigError("Unkown configuration option '%s' in section '%s'" % config.ConfigError: Unkown configuration option 'server' in section 'network'
After removing the server option in the network section I got another backtrace which is related to the window size of the xterm. Apparently 80x25 is still not sufficient for pytone on startup ?
The server option has been renamed (probably that's not really critical since not many people are using it).
For me, a terminal size of 80x24 works perfectly.
Also could you create it as 2.2.3.1 or something similar, not the plus sign, otherwise I have difficulties to package it properly. I'd like to create test packages of those releases too.
These test release are really just meant as a snapshot. I'm not sure whether it's a good idea to package them. Normally, I use a pre notation, but since I don't know yet whether the next release will be PyTone 2.3.0 or 2.2.4, I used the +.
PS: The problem with the ~/.pytone/plugins directory is, that there has to be an __init__.py file present (just create an empty one).
If I do this, it works but it will only recognize the plugins in my user-directory (~/.pytone/plugins) not the ones I have in the global directory.
Hey, that's what I have been looking at for the last ten minutes ;-). I don't understand what's going on there...
Also in this case, pytone bails out if it cannot find a plugin. It would be nicer to eg. display a message (maybe with: press enter to proceed) or just log the failure and continue.
Of course, but there are so many things to do and currently my free time is very limited.
Jörg
On Sun, 5 Jun 2005, Joerg Lehmann wrote:
On 05.06.05, Dag Wieers wrote:
On Sun, 29 May 2005, Joerg Lehmann wrote:
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
Then when running:
[dag@emyn ~]$ pytone Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pytone/pytone.py", line 57, in ? config.processconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 905, in processconfig processstandardconfig() File "/usr/lib/python2.3/site-packages/pytone/config.py", line 759, in processstandardconfig readconfigsection(section, eval(section)) File "/usr/lib/python2.3/site-packages/pytone/config.py", line 699, in readconfigsection raise ConfigError("Unkown configuration option '%s' in section '%s'" % config.ConfigError: Unkown configuration option 'server' in section 'network'
After removing the server option in the network section I got another backtrace which is related to the window size of the xterm. Apparently 80x25 is still not sufficient for pytone on startup ?
The server option has been renamed (probably that's not really critical since not many people are using it).
I think it was enabled (empty) by default, so everyone who upgrades hit this problem.
For me, a terminal size of 80x24 works perfectly.
This is what I get:
[dag@emyn ~]$ pytone Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pytone/pytone.py", line 272, in ? m = mainscreen.mainscreen(stdscr, songdbids, playerids, plugins) File "/usr/lib/python2.3/site-packages/pytone/mainscreen.py", line 62, in __init__ self.connectborders() File "/usr/lib/python2.3/site-packages/pytone/mainscreen.py", line 260, in connectborders win.update() File "/usr/lib/python2.3/site-packages/pytone/playlistwin.py", line 203, in update self.updatescrollbar() File "/usr/lib/python2.3/site-packages/pytone/playlistwin.py", line 68, in updatescrollbar self.drawscrollbar(self.playlist.top, len(self.playlist)) File "/usr/lib/python2.3/site-packages/pytone/window.py", line 243, in drawscrollbar self.vline(3, xpos, curses.ACS_CKBOARD, self.ih-4, self.colors.scrollbar) File "/usr/lib/python2.3/site-packages/pytone/window.py", line 117, in vline self.win.vline(x, y, c, n, attr) error: wmove() returned ERR Locals by frame, innermost last
Frame ? in /usr/lib/python2.3/site-packages/pytone/pytone.py at line 280 sigtermhandler = <function sigtermhandler at 0xb75541ec> helper = <module 'helper' from '/usr/lib/python2.3/site-packages/pytone/helper.py'> curses = <module 'curses' from '/usr/lib/python2.3/curses/__init__.pyc'> locale = <module 'locale' from '/usr/lib/python2.3/locale.pyc'> stdscr = <_curses.curses window object at 0xb7d78360> songdbname = cd plugins = [(<module 'plugins.termtitle' from '/home/dag/.pytone/plugins/termtitle.pyc'>, <plugins.termtitle.config instance at 0xb75006ec>), (<module 'plugins.osdtitle' from '/home/dag/.pytone/plugins/osdtitle.pyc'>, <plugins.osdtitle.config instance at 0xb750398c>)] songdbids = ['main', 'cd'] mainscreen = <module 'mainscreen' from '/usr/lib/python2.3/site-packages/pytone/mainscreen.pyc'> playerids = ['main', None] errors = <module 'errors' from '/usr/lib/python2.3/site-packages/pytone/errors.pyc'> log = <module 'log' from '/usr/lib/python2.3/site-packages/pytone/log.pyc'> cursessetup = <function cursessetup at 0xb7506e64> gettext = <module 'gettext' from '/usr/lib/python2.3/gettext.pyc'> version = <module 'version' from '/usr/lib/python2.3/site-packages/pytone/version.py'> cursescleanup = <function cursescleanup at 0xb7554144> config = <module 'config' from '/usr/lib/python2.3/site-packages/pytone/config.py'> events = <module 'events' from '/usr/lib/python2.3/site-packages/pytone/events.pyc'> hub = <module 'hub' from '/usr/lib/python2.3/site-packages/pytone/hub.pyc'> __builtins__ = <module '__builtin__' (built-in)> __file__ = /usr/lib/python2.3/site-packages/pytone/pytone.py sys = <module 'sys' (built-in)> services = <module 'services' from '/usr/lib/python2.3/site-packages/pytone/services/__init__.pyc'> __name__ = __main__ network = <module 'network' from '/usr/lib/python2.3/site-packages/pytone/network.py'> e = [Errno 17] File exists: '/home/dag/.pytone' name = osdtitle pluginconfig = <plugins.osdtitle.config instance at 0xb750398c> signal = <module 'signal' (built-in)> m = None __doc__ = None pluginmodule = <module 'plugins.osdtitle' from '/home/dag/.pytone/plugins/osdtitle.pyc'> locallocaledir = /usr/lib/python2.3/site-packages/pytone/../locale os = <module 'os' from '/usr/lib/python2.3/os.pyc'> songdbid = cd songdbmanager = <songdbmanager(songdb manager service, stopped)>
Frame __init__ in /usr/lib/python2.3/site-packages/pytone/mainscreen.py at line 62 screen = <_curses.curses window object at 0xb7d78360> windowslayout = {'playerwin': (3, 80, 0, 0, 15), 'playlistwin': (2, 80, 21, 0, 15), 'iteminfowin': (6, 80, 3, 0, 15), 'filelistwin': (12, 80, 9, 0, 15)} plugins = [(<module 'plugins.termtitle' from '/home/dag/.pytone/plugins/termtitle.pyc'>, <plugins.termtitle.config instance at 0xb75006ec>), (<module 'plugins.osdtitle' from '/home/dag/.pytone/plugins/osdtitle.pyc'>, <plugins.osdtitle.config instance at 0xb750398c>)] songdbids = ['main', 'cd'] playerids = ['main', None] self = <mainscreen.mainscreen instance at 0xb74d746c>
Frame connectborders in /usr/lib/python2.3/site-packages/pytone/mainscreen.py at line 260 win = <playlistwin.playlistwin instance at 0xb354eacc> borderends = [] mainwindows = [<filelistwin.filelistwin instance at 0xb74d792c>, <playerwin.playerwin instance at 0xb74d780c>, <iteminfowin.iteminfowin instance at 0xb74d78cc>, <playlistwin.playlistwin instance at 0xb354eacc>] self = <mainscreen.mainscreen instance at 0xb74d746c>
Frame update in /usr/lib/python2.3/site-packages/pytone/playlistwin.py at line 203 autoplaymode = [Random] self = <playlistwin.playlistwin instance at 0xb354eacc>
Frame updatescrollbar in /usr/lib/python2.3/site-packages/pytone/playlistwin.py at line 68 self = <playlistwin.playlistwin instance at 0xb354eacc>
Frame drawscrollbar in /usr/lib/python2.3/site-packages/pytone/window.py at line 243 xpos = 79 top = 0 scrollbarbegin = 3 scrollbarheight = -4 total = 1 self = <playlistwin.playlistwin instance at 0xb354eacc>
Frame vline in /usr/lib/python2.3/site-packages/pytone/window.py at line 121 c = 4194401 attr = 512 self = <playlistwin.playlistwin instance at 0xb354eacc> n = -4 y = 79 x = 3
BTW I don't know who's responsible for centering the variables in the output, but this has already caused me spending minuted to just make the format look readable. Simply left-aligning might be better here.
Also could you create it as 2.2.3.1 or something similar, not the plus sign, otherwise I have difficulties to package it properly. I'd like to create test packages of those releases too.
These test release are really just meant as a snapshot. I'm not sure whether it's a good idea to package them. Normally, I use a pre notation, but since I don't know yet whether the next release will be PyTone 2.3.0 or 2.2.4, I used the +.
Well, I normally do not install _anything_ if it's not packaged. I'm sure there are more people like me. So releasing test packages (they do not appear in the repository) helps testing things.
Also in this case, pytone bails out if it cannot find a plugin. It would be nicer to eg. display a message (maybe with: press enter to proceed) or just log the failure and continue.
Of course, but there are so many things to do and currently my free time is very limited.
Oh, but I mention it so that it could be added to the TODO list. This way it's being listed as a known issue. I'm not implying _you_ have to fix this asap :) I don't have the time to look at the issues currently either.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
On Sun, 5 Jun 2005, Dag Wieers wrote:
On Sun, 29 May 2005, Joerg Lehmann wrote:
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
I put a new tarball with the plugins online under the path I've send before. Testing is appreciated.
When building I get this:
I noticed that the 2.2.3+ did not include the window refresh bug, as it re-appeared when upgrading.
Can we expect a new release ? I'm waiting for changing other stuff until a new release has been made.
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]
Hi Dag,
On 20.06.05, Dag Wieers wrote:
On Sun, 5 Jun 2005, Dag Wieers wrote:
On Sun, 29 May 2005, Joerg Lehmann wrote:
On 29.05.05, Dag Wieers wrote:
On Sun, 29 May 2005, Dag Wieers wrote:
I put a new tarball with the plugins online under the path I've send before. Testing is appreciated.
When building I get this:
I noticed that the 2.2.3+ did not include the window refresh bug, as it re-appeared when upgrading.
I did not include it because I could not reproduce your problem and also because I do not understand what it does (update_panels is already called directly before the only doupdate call). But on the other hand it doesn't hurt, so I'll add it together with a corresponding comment.
Can we expect a new release ? I'm waiting for changing other stuff until a new release has been made.
Sorry, I have been quite busy lately. Still, I'll try to make a release as soon as possible.
Jörg