From: Peter Å. <as...@ce...> - 2012-01-09 08:19:08
|
Try running "strace -f" on the entire application. Rgds, Peter On Wed, 4 Jan 2012, Andy Davidson wrote: > > Dear pythondialog-users. > > Thanks for this software, but please could I request some technical support with regards to an issue I am struggling to debug. I am trying to produce a dialog.menu and populate the menu with items as discovered in a database. > > I see in demo.py that d.menu takes a list of tuples for menu option choices, so this is the data type I am building. > > This is the code I am using : > > def add_check(d, userid, cursor): > cursor.execute ("SELECT id, hostname FROM host WHERE user_id=%s", userid) > hostchoices = list(cursor.fetchall()) > # print hostchoices; > while 1: > (code, tag) = d.menu( "Pick a host to manage?", > width=60, > choices=hostchoices ) > if handle_exit_code(d, code): > break > d.msgbox ("You picked host " . tag) > return 0 > > > > When I print hostchoices, I see : > > [(1L, 'host1'), (2L, 'host2), (3L, 'host3'), (4L, 'host4'), (6L, 'host6'), (7L, 'host7'), (8L, 'host8')] > > > > > It produces this traceback : > > Traceback (most recent call last): > File "monshell.py", line 126, in <module> > if __name__ == "__main__": main() > File "monshell.py", line 119, in main > main_menu(d, userid, cursor) > File "monshell.py", line 98, in main_menu > options[tag](d,userid,cursor) > File "monshell.py", line 73, in add_check > choices=hostchoices ) > File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 1253, in menu > > File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 825, in _perform > > File "build/bdist.macosx-10.7-intel/egg/dialog.py", line 765, in _wait_for_program_termination > > dialog.PythonDialogErrorBeforeExecInChildProcess: <PythonDialogErrorBeforeExecInChildProcess: perhaps the dialog-like program could not be executed; perhaps the system is out of memory; perhaps the maximum number of open file descriptors has been reached> > > > It happens on the Linux and OSX version I have. > > Any clues about how I can debug this ? Dialog is running ok elsewhere in my application - in fact I also use a static menu elsewhere which builds just fine. > > Thanks > Andy > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Pythondialog-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythondialog-users > --- Peter Åstrand ThinLinc Chief Developer Cendio AB http://www.cendio.com Wallenbergs gata 4 583 30 Linköping Phone: +46-13-21 46 00 |