syntax error line 235 neutron.py

fresh install of Neutron from cvs

edited the config.txt as per the README

upon executing ./neutron.py I recieve the following error:

 ./neutron.py
  File "./neutron.py", line 235
    else:
       ^
SyntaxError: invalid syntax

When I look at the source I see nothing obvious, however I am a relative newbie to python, experience with other languages.

The code block is as follows:

def get_true_jid(jid):
	true_jid = ''
	if type(jid) is types.ListType:
		jid = jid[0]
	if type(jid) is types.InstanceType:
		jid = unicode(jid) # str(jid)
	stripped_jid = string.split(jid, '/', 1)[0]
	resource = ''
	if len(string.split(jid, '/', 1)) == 2:
		resource = string.split(jid, '/', 1)[1]
	if GROUPCHATS.has_key(stripped_jid):
		if GROUPCHATS[stripped_jid].has_key(resource):
			true_jid = string.split(unicode(GROUPCHATS[stripped_jid][resource]['jid']), '/', 1)[0]
        else:
            true_jid = stripped_jid
	else:
		true_jid = stripped_jid
	return true_jid

Any help would be appreciated,
Thanks in advance.

Burke

syntax error line 235 neutron.py - fixed now: eek -> None None

after a Google search I learned a bit about whitespace and python's syntax :)

However now I run ./neutron.py and it scrolls along as though it is working, with the final usless output of:

eek ->  None None

here is the complete output from neutron:

[burke@demon neutron]$ ./neutron.py
Plugin: chat_plugin.py
Plugin: domain_plugin.py
Plugin: freshmeat_plugin.py
Plugin: vote_plugin.py
Plugin: rss_plugin.py
Plugin: query_plugin.py
Plugin: presence_plugin.py
Plugin: babel_plugin.py
Plugin: dns_plugin.py
Plugin: weather_plugin.py
Plugin: access_plugin.py
Plugin: eliza_plugin.py
Plugin: temperature_plugin.py
Plugin: sg_plugin.py
Plugin: stock_plugin.py
Plugin: dict_plugin.py
Plugin: admin_plugin.py
Plugin: time_plugin.py
Plugin: fact_plugin.py
Plugin: help_plugin.py
Plugin: log_plugin.py
Plugin: chatbot_nick_plugin.py
Plugin: quote_plugin.py
Plugin: userinfo_plugin.py
Plugin: google_plugin.py
Plugin: python_plugin.py
Executing Init Script
Querying Channels
Finished Querying Headlines
Connected
eek ->  None None

At this point there is no indication in the Wildfire admin that neutron is connected.

Any help is appreciated,
Burke

support

so is it pointless to hope for support/hints for neutron here?

Try this modified version

bve wrote:

upon executing ./neutron.py I recieve the following error:

 ./neutron.py
  File "./neutron.py", line 235
    else:
       ^
SyntaxError: invalid syntax

When I look at the source I see nothing obvious, however I am a relative newbie to python, experience with other languages.

I'm newbie to python too, but as you pointed, it seems a tab indentation problem. When I fixed all the mistakes I could find, Neutron works again, or at least it connects:

...
Plugin: userinfo_plugin.py
Plugin: vote_plugin.py
Plugin: weather_plugin.py
Executing Init Script
Querying Channels
Finished Querying Headlines
Connected
Logged In
Presence Sent

You can try the modified file: neutron.py.

If it still fails with the weird 'eek' message, try to login on a jabber.org account, for example, to check if the problem is on your installation, or on Neutron...

modified version

Thanks, I had actually tested the acct with gaim and can connect.

Your version produces the same 'eek' result, and looking at the code I can tell it is an authentication failure.

setting debug=1 in line 445

445 JCON = xmpp.Client(server=SERVER, port=PORT, debug=1)

results in output which shows SASL auth failure:

DEBUG: sasl         error Failed SASL authentification: 

Can I change the authentication method in neutron?

Try 5223, but better to have SASL on the server.

bve wrote:

results in output which shows SASL auth failure:

DEBUG: sasl         error Failed SASL authentification: 

Can I change the authentication method in neutron?

Maybe putting PORT=5223 on config.txt Neutron will use the old and deprecated SSL.

However, the XMPP way of connecting is STARTTLS+SASL, and Wildfire certainly supports that.

You probably want to have STARTTLS+SASL for the future. Maybe you disabled that authentication method on the server, or are using an older version?

Syndicate content