Subject: Re: [nmr_sparky] Re: Sparky python extensions
From: Thomas Goddard
Date: May 15, 2006

Previous: 131 Next: 497


The problem is in your sparky_init.py file. The error message

Traceback (most recent call last):
File C:Program Filessparkypythonsparkypythonshell.py, line
268, in invoke_module_function
eval(code)
File string, line 1, in ?
IndentationError: expected an indented block (sparky_init.py, line 15)

means that line 15 of sparky_init.py is not indented properly.
Indentation is used in Python instead of brackets for bodies of functions.

Below I indented the lines import brmb and brmb.show_dialog(s)
so they are inside the function definition bs_command(). That should
fix the problem.

Tom

# -----------------------------------------------------------------------------
# When a Sparky session starts the initilize_session() routines are invoked
# from the following files.
#
# sparky_site.py - site initialization file
# sparky_init.py - user initialization file
#
# Typically a user has a sparky_init.py file in ~/Sparky/Python.
# If they dont then this file (which does nothing) is loaded.
#

def initialize_session(session):
#pass
def bs_command(s = session):
import bmrb
bmrb.show_dialog(s)

session.add_command(bs, BRMB submission form, bs_command)