old_contents: import sys
  sys.path.append("/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/python2.7/site-packages/")
  import gobject
  gobject.threads_init()
  import pygst
  pygst.require("0.10")
  import gst
  import pygtk
  pygtk.require("2.0")
  import gtk
  
  class Client(object):
      def __init__(self):
          self.pipeline = gst.Pipeline('client')
          self.videotestsrc = self.create_element('videotestsrc', 'video')
          self.theoraenc = self.create_element('theoraenc', 'encoder')
          self.oggmux = self.create_element('oggmux', 'muxer')
          self.tcpserversink = self.create_element('tcpserversink', 'serversink')
          self.tcpserversink.set_property('host', '0.0.0.0')
          self.tcpserversink.set_property('port', 8080)
  
          self.pipeline.add(self.videotestsrc, self.theoraenc, self.oggmux, self.tcpserversink)
          self.videotestsrc.link(self.theoraenc)
          self.theoraenc.link(self.oggmux)
          self.oggmux.link(self.tcpserversink)
  
  
      def create_element(self, element, name):
          return gst.element_factory_make(element, name)
  
      def start(self):
          self.pipeline.set_state(gst.STATE_PLAYING)
  
  
  client = Client()
  client.start()
  gtk.main()
  
  
new_contents: import sys
  sys.path.append("/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/python2.7/site-packages/")
  import gobject
  gobject.threads_init()
  import pygst
  pygst.require("0.10")
  import gst
  
  class Client(object):
      def __init__(self):
          self.pipeline = gst.Pipeline('client')
          self.videotestsrc = self.create_element('videotestsrc', 'video')
          self.theoraenc = self.create_element('theoraenc', 'encoder')
          self.oggmux = self.create_element('oggmux', 'muxer')
          self.tcpserversink = self.create_element('tcpserversink', 'serversink')
          self.tcpserversink.set_property('host', '0.0.0.0')
          self.tcpserversink.set_property('port', 8080)
  
          self.pipeline.add(self.videotestsrc, self.theoraenc, self.oggmux, self.tcpserversink)
          self.videotestsrc.link(self.theoraenc)
          self.theoraenc.link(self.oggmux)
          self.oggmux.link(self.tcpserversink)
  
  
      def create_element(self, element, name):
          return gst.element_factory_make(element, name)
  
      def start(self):
          self.pipeline.set_state(gst.STATE_PLAYING)
  
  
  client = Client()
  client.start()
  loop = gobject.MainLoop()
  loop.run()
  
subject: remove gtk/pygtk, using gobject mainloop