'Process the session_start event.
Typical actions for the session_start event are
requesting the roster and broadcasting an initial
presence stanza.
In this case, we send disco#info and disco#items
stanzas to the requested JID and print the results.
Arguments:
event -- An empty dictionary. The session_start
event does not provide any additional
data.'

def start(self, event):

    self.get_roster()
    self.send_presence()
    try:
        if (self.get in self.info_types):
            info = self['xep_0030'].get_info(jid=self.target_jid, node=self.target_node, block=True)
        if (self.get in self.items_types):
            items = self['xep_0030'].get_items(jid=self.target_jid, node=self.target_node, block=True)
        else:
            logging.error('Invalid    disco    request    type.')
            return
    except IqError as e:
        logging.error(('Entity    returned    an    error:    %s' % e.iq['error']['condition']))
    except IqTimeout:
        logging.error('No    response    received.')
    else:
        header = ('XMPP    Service    Discovery:    %s' % self.target_jid)
        print header
        print ('-' * len(header))
        if (self.target_node != ''):
            print ('Node:    %s' % self.target_node)
            print ('-' * len(header))
        if (self.get in self.identity_types):
            print 'Identities:'
            for identity in info['disco_info']['identities']:
                print ('        -    %s' % str(identity))
        if (self.get in self.feature_types):
            print 'Features:'
            for feature in info['disco_info']['features']:
                print ('        -    %s' % feature)
        if (self.get in self.items_types):
            print 'Items:'
            for item in items['disco_items']['items']:
                print ('        -    %s' % str(item))
    finally:
        self.disconnect()
