Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11627

Modified Files:
        icecast.py 
Removed Files:
        icecastchanger.py 
Log Message:
move the icecast changer into icecast.py

Index: icecast.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/icecast.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** icecast.py  30 Sep 2003 16:51:22 -0000      1.10
--- icecast.py  14 Feb 2004 19:18:31 -0000      1.11
***************
*** 11,14 ****
--- 11,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.11  2004/02/14 19:18:31  mikeruelle
+ # move the icecast changer into icecast.py
+ #
  # Revision 1.10  2003/09/30 16:51:22  mikeruelle
  # add some default options
***************
*** 59,64 ****
  import signal
  import time
- 
  import plugin
  
  class PluginInterface(plugin.DaemonPlugin):
--- 62,68 ----
  import signal
  import time
  import plugin
+ import rc
+ import event as em
  
  class PluginInterface(plugin.DaemonPlugin):
***************
*** 88,92 ****
          self.icecast_pid = None
          self.ices_pid = None
!         plugin.activate('icecastchanger')
  
          try:
--- 92,96 ----
          self.icecast_pid = None
          self.ices_pid = None
!         plugin.activate('icecast.IcecastChanger')
  
          try:
***************
*** 154,155 ****
--- 158,183 ----
          os.waitpid(self.icecast_pid, 0)
  
+ class IcecastChanger(plugin.ItemPlugin):
+     """
+     This plugin is automatically included by the icecast plugin. There
+     should be no need to activate it yourself. It's purpose is to add
+     the extra action to m3u files to use them as playlists for icecast. 
+     """
+     def __init__(self):
+         plugin.ItemPlugin.__init__(self)
+ 
+     def change2m3u(self, arg=None, menuw=None):
+         myfile = file(os.path.join(config.FREEVO_CACHEDIR, 'changem3u.txt'), 'wb')
+         myfile.write(self.item.filename)
+         myfile.flush()
+         myfile.close()
+         rc.post_event(em.MENU_BACK_ONE_MENU)
+         
+     def actions(self, item):
+         self.item = item
+         if item.type == 'playlist':
+             fsuffix = os.path.splitext(item.filename)[1].lower()[1:]
+             if fsuffix == 'm3u':
+                 return [ (self.change2m3u,
+                           _('Set as icecast playlist')) ]
+         return []

--- icecastchanger.py DELETED ---



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to