Note that there are some explanatory texts on larger screens.

plurals
  1. POinitialization problem in Python
    primarykey
    data
    text
    <p>The error is given at the end:</p> <pre><code>from brisa.core.reactors import install_default_reactor reactor = install_default_reactor() print reactor from brisa.upnp.control_point.control_point import ControlPoint def on_new_device(dev): print 'Got new device:', dev.udn print "Type 'list' to see the whole list" if not dev: return def create_control_point(): c = ControlPoint() print "hello" c.subscribe('new_device_event', on_new_device) print "c" return c def main(): print "Inside main" c = create_control_point() print "Inside create control point" c.start() reactor.add_after_stop_func(c.stop) reactor.main() def _search(c): """ Start searching for devices of type upnp:rootdevice and repeat search every 600 seconds (UPnP default) """ c.start_search(600, 'upnp:rootdevice') def _stop(c): """ Stop searching """ c.stop_search() def _list_devices(c): """ Lists the devices that are in network. """ k = 0 for d in c.get_devices().values(): print 'Device no.:', k print 'UDN:', d.udn print 'Name:', d.friendly_name print 'Device type:', d.device_type print 'Services:', d.services.keys() # Only print services name print k += 1 # Control the loop at _handle_cmds function running_handle_cmds = True commands = { 'search': _search, 'stop': _stop, 'list': _list_devices, } def _handle_cmds(c): while running_handle_cmds: try: input = raw_input('&gt;&gt;&gt; ').strip() if len(input.split(" ")) &gt; 0: try: if len(input.split(" ")) &gt; 1: commands[input.split(" ")[0]](c, input.split(" ")[1]) else: commands[input.split(" ")[0]](c) except KeyError, IndexError: print 'Invalid command, try help' except TypeError: print 'Wrong usage, try help to see' except KeyboardInterrupt, EOFError: c.stop() break # Stops the main loop reactor.main_quit() if __name__ == '__main__': print "hello" main() </code></pre> <p>Error:</p> <pre><code>ankit@ubuntu:~/Desktop$ python controlpt.py &lt;brisa.core.reactors.glib2.GLib2Reactor object at 0x965bdcc&gt; hello Inside main </code></pre> <p>After that I know understand, it is not initialising the control point. The Information about the libraries(Control point) is available at <a href="http://brisa.garage.maemo.org/apidoc/index.html" rel="nofollow">http://brisa.garage.maemo.org/apidoc/index.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload