From: Andy D. <an...@no...> - 2012-01-04 15:04:26
|
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 |