Package flumotion :: Package wizard :: Module shout2steps
[hide private]

Source Code for Module flumotion.wizard.shout2steps

  1  # -*- Mode: Python -*- 
  2  # vi:si:et:sw=4:sts=4:ts=4 
  3  # 
  4  # Flumotion - a streaming media server 
  5  # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). 
  6  # All rights reserved. 
  7   
  8  # This file may be distributed and/or modified under the terms of 
  9  # the GNU General Public License version 2 as published by 
 10  # the Free Software Foundation. 
 11  # This file is distributed without any warranty; without even the implied 
 12  # warranty of merchantability or fitness for a particular purpose. 
 13  # See "LICENSE.GPL" in the source distribution for more information. 
 14   
 15  # Licensees having purchased or holding a valid Flumotion Advanced 
 16  # Streaming Server license may use this file in accordance with the 
 17  # Flumotion Advanced Streaming Server Commercial License Agreement. 
 18  # See "LICENSE.Flumotion" in the source distribution for more information. 
 19   
 20  # Headers in this file shall remain intact. 
 21   
 22  import gettext 
 23   
 24  from flumotion.wizard.models import Consumer 
 25  from flumotion.wizard.basesteps import ConsumerStep 
 26   
 27  __version__ = "$Rev: 7015 $" 
 28  _ = gettext.gettext 
 29   
 30   
31 -class Shout2Consumer(Consumer):
32 componentType = 'shout2-consumer'
33 - def __init__(self):
34 super(Shout2Consumer, self).__init__() 35 self.properties.ip = '127.0.0.1' 36 self.properties.mount_point = '/' 37 self.properties.description = '' 38 self.properties.short_name = '' 39 self.properties.url = 'http://localhost/' 40 self.properties.password = ''
41 42
43 -class Shout2Step(ConsumerStep):
44 gladeFile = 'shout2-wizard.glade' 45
46 - def __init__(self, wizard):
47 self.model = Shout2Consumer() 48 ConsumerStep.__init__(self, wizard)
49 50 # ConsumerStep 51
52 - def getConsumerModel(self):
53 return self.model
54 55 # WizardStep 56
57 - def setup(self):
58 self.ip.data_type = str 59 self.port.data_type = int 60 self.mount_point.data_type = str 61 self.password.data_type = str 62 self.short_name.data_type = str 63 self.description.data_type = str 64 self.url.data_type = str 65 66 self.add_proxy(self.model.properties, 67 ['ip', 68 'port', 69 'mount_point', 70 'short_name', 71 'password', 72 'description', 73 'url'])
74
75 - def workerChanged(self, worker):
76 self.model.worker = worker 77 self.wizard.checkElements(worker, 'shout2send')
78 79
80 -class Shout2BothStep(Shout2Step):
81 name = 'Icecast streamer (audio & video)' 82 title = _('Icecast streamer (audio and video)') 83 sidebarName = _('Icecast audio/video') 84 85 # ConsumerStep 86
87 - def getConsumerType(self):
88 return 'audio-video'
89 90
91 -class Shout2AudioStep(Shout2Step):
92 name = 'Icecast streamer (audio only)' 93 title = _('Icecast streamer (audio only)') 94 sidebarName = _('Icecast audio') 95 96 # ConsumerStep 97
98 - def getConsumerType(self):
99 return 'audio'
100 101
102 -class Shout2VideoStep(Shout2Step):
103 name = 'Icecast streamer (video only)' 104 title = _('Icecast streamer (video only)') 105 sidebarName = _('Icecast video') 106 107 # ConsumerStep 108
109 - def getConsumerType(self):
110 return 'video'
111