kmonsoor / npyscreen

Automatically exported from code.google.com/p/npyscreen
Other
0 stars 0 forks source link

error running sample application #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

 run this code: 
#!/usr/bin/env python
#
# assuming you are using virtual environments. 
#
# >source env/bin/activate
# >pip install --pre npyscreen
import npyscreen

class myEmployeeForm(npyscreen.Form):
    def afterEditing(self):
        self.parentApp.NEXT_ACTIVE_FORM = None

    def create(self):
       self.myName        = self.add(npyscreen.TitleText, name='Name')
       self.myDepartment = self.add(npyscreen.TitleSelectOne, scroll_exit=True, max_height=3, name='Department', values = ['Department 1', 'Department 2', 'Department 3'])
       self.myDate        = self.add(npyscreen.TitleDateCombo, name='Date Employed')

class MyApplication(npyscreen.NPSAppManaged):
    def onStart(self):
        self.addForm('MAIN', myEmployeeForm, name='New Employee')
        # A real application might define more forms here.......

if __name__ == '__main__':
    TestApp = MyApplication().run()

What is the expected output? What do you see instead?

 ./temp.py 
Traceback (most recent call last):
  File "./temp.py", line 25, in <module>
    TestApp = MyApplication().run()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/npyssafewrapper.py", line 96, in wrapper_no_fork
    return_code = call_function(_SCREEN)
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/apNPSApplicationManaged.py", line 163, in main
    self._THISFORM._resize()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/fmForm.py", line 112, in _resize
    w._resize()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/wgwidget.py", line 240, in _resize
    self.resize()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/wgtitlefield.py", line 63, in resize
    self.entry_widget._resize()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/wgwidget.py", line 240, in _resize
    self.resize()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/wgmultiline.py", line 105, in resize
    self.display()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/wgwidget.py", line 344, in display
    self.parent.refresh()
  File "/home/eric/test3/lib/python3.3/site-packages/npyscreen/proto_fm_screen_area.py", line 145, in refresh
    self.curses_pad.refresh(self.show_from_y,self.show_from_x,self.show_aty,self.show_atx,_my,_mx)
TypeError: refresh() takes exactly 0 arguments (6 given)

What version of the product are you using? On what operating system?
npyscreen 2.0pre93
centos 6.4
python 3.3

Please provide any additional information below.

Original issue reported on code.google.com by eric.spe...@txwormhole.com on 24 Mar 2014 at 7:56

GoogleCodeExporter commented 9 years ago
Very odd.

1.  That example code runs perfectly on my setup.

2. The call to refresh is a call to the python standard library, which has 
always taken 6 optional arguments.  It is documented here:

http://docs.python.org/2/library/curses.html#curses.window.refresh

and 

http://docs.python.org/3/library/curses.html#curses.window.refresh

I've tested it under python2 and python3.3

It is almost as if centos has given you a non-standard version of the standard 
curses library.  

Is there any other way you can replicate the problem?

Original comment by nicholas.cole on 25 Mar 2014 at 9:31

GoogleCodeExporter commented 9 years ago
using the native python 2.6.6 on centos 6.4 works for me as well. I'm trying to 
get it to run using python 3.3 (using the make altinstall method) but when I do 
this I get import errors for various thing (pygtk, gtk for example) and in my 
thrashing about thought I had it right... but maybe not sorry for the red 
herring 

Original comment by eric.spe...@txwormhole.com on 26 Mar 2014 at 3:14

GoogleCodeExporter commented 9 years ago
There WAS a bug in Python 3.2 on some platforms that showed this bug:

https://bugs.launchpad.net/ubuntu/+source/python3.2/+bug/1021783

I wonder if you are seeing a version of that?

Original comment by nicholas.cole on 26 Mar 2014 at 9:20