title: Transferring code from pygst to pyGi
body: <p>I wanted to build a program which streams radio from address. I wrote the following code:</p>
  
  <p>try:
      from gi.repository import Gst
  except AttributeError as e:
      pass</p>
  
  <pre><code>def on_tag(bus, msg):
      taglist = msg.parse_tag()
      print 'on_tag:'
      for key in taglist.keys():
          print '\t%s = %s' % (key, taglist[key])
  
  music_stream_uri = 'http://213.8.143.168/91fmAudio'
  player = Gst.element_factory_make("playbin", "player")
  player.set_property('uri', music_stream_uri)
  player.set_state(Gst.STATE_PLAYING)
  </code></pre>
  
  <p>It worked well when I did</p>
  
  <pre><code>import pygst    
  pygst.require("0.10")
  import gst
  </code></pre>
  
  <p>but since It gave me several <code>AttributeError</code> and warning claims the module is deprecating I switched to pyGi and imported </p>
  
  <pre><code>from pi.repository import Gst
  </code></pre>
  
  <p>but then I got the error</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.1\helpers\pydev\pydevd.py", line 2222, in &lt;module&gt;
      globals = debugger.run(setup['file'], None, None)
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.1\helpers\pydev\pydevd.py", line 1648, in run
      pydev_imports.execfile(file, globals, locals)  # execute the script
    File "C:/Danis/radio/radio.py", line 20, in &lt;module&gt;
      player = Gst.element_factory_make("playbin", "player")
    File "C:\Python27\lib\site-packages\gi\module.py", line 320, in __getattr__
      return getattr(self._introspection_module, name)
    File "C:\Python27\lib\site-packages\gi\module.py", line 139, in __getattr__
  self.__name__, name))
  AttributeError: 'gi.repository.Gst' object has no attribute   'element_factory_make'
  </code></pre>
  
  <p>I wonder which command in pi.Gst is equivalent to the commands of the pygst? Does anybody know how to transfer this piece of code to PyGi?</p>