[albatross-users] Exception: set_page() passing wrong number of parameters to page_enter()?

Sheila King sheila at thinkspot.net
Mon May 19 16:59:51 EST 2003


Hello...so I am making further progress. Do have the most skeletal example 
of my own sometimes running.

Here is the main application code, at the moment:

------------(begin code)--------------
#!/big/dom/xexample/bin/python
from albatross import RandomModularSessionFileApp, SessionFileAppContext
from albatross.cgiapp import Request

class QAcontext(SessionFileAppContext):
    pass

class QAapp(RandomModularSessionFileApp):
    def __init__(self):
        RandomModularSessionFileApp.__init__(self,
                                       base_url = 'adminmgr.py',
                                       page_path = '.',
                                       start_page = 'login',
                                       secret = 'secret',
                                       session_appid = 'myapp',
                                       session_dir = './sessions')

    def create_context(self):
        return QAcontext(self)


if __name__ == '__main__':
    app = QAapp()
    app.run(Request())
------------(end code)--------------

I really only have one page working right now, which is the start page 
(login) but was trying to add more pages to the app and this is when I 
encountered my problems.

So long as the login.py module looks like this:

------------(begin code)--------------
def page_display(ctx):
    ctx.load_template('qaheader.html')
    ctx.run_template('login.html')

def page_process(ctx):
    #ctx.set_page('myaccount')
    pass
------------(end code)--------------

The application will at least run and take me to the start page.

However, if I move the comment symbol, and comment out the 'pass' 
statement, and try to enable the set_page statement, I get the following 
traceback:

Template traceback (most recent call last):

Traceback (most recent call last):
  File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py", 
line 146, in run
    self.process_request(ctx)
  File 
"/big/dom/xexample/lib/python2.2/site-packages/albatross/randompage.py", 
line 61, in process_request
    return PageModuleMixin.process_request(self, ctx)
  File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py", 
line 298, in process_request
    func(ctx)
  File "login.py", line 6, in page_process
    ctx.set_page('myaccount')
  File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py", 
line 87, in set_page
    self.app.page_enter(self, args)
TypeError: page_enter() takes exactly 2 arguments (3 given)

I am completely at a loss as to how I could be passing the wrong number of 
parameters, as I have reviewed all of the set_page statements in the sample 
code included with the Albatross package, and they all have the same syntax.

Sure would appreciate a clue here.

Thanks,


-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list