Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
New tests
  • Loading branch information
npcole committed May 16, 2014
1 parent e0e89ac commit 629aeb5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
26 changes: 26 additions & 0 deletions TESTING-MuttError.py
@@ -0,0 +1,26 @@
#!/usr/bin/env python
import npyscreen

class TestForm(npyscreen.FormMutt):
def __init__(self, *args, **keywords):
super(TestForm, self).__init__(*args, **keywords)
self.add_handlers({"^R": self.go_to_main})

def go_to_main(self, t):
raise ValueError



class TestApp(npyscreen.NPSApp):
def main(self):
F = TestForm()
F.wStatus1.value = "Status Line "
F.wStatus2.value = "Second Status Line "
F.wMain.values = [str(x) for x in range(500)]

F.edit()


if __name__ == "__main__":
App = TestApp()
App.run()
28 changes: 28 additions & 0 deletions TESTING-Pager.py
@@ -0,0 +1,28 @@
#!/usr/bin/env python
import npyscreen

class EditorFormExample(npyscreen.FormMutt):
MAIN_WIDGET_CLASS = npyscreen.Pager

class TestApp(npyscreen.NPSApp):
def main(self):
F = EditorFormExample()
F.wStatus1.value = "Status Line "
F.wStatus2.value = "Second Status Line "
F.wMain.editable = False
F.wMain.autowrap = True
F.wMain.center = True


#F.wMain.buffer([str(r) for r in range(100)], scroll_if_editing=True)
#with open("/Users/nicholas/Downloads/pg2600.txt", 'r') as war_and_peace:
with open("setup.py", 'r') as war_and_peace:
F.wMain.values = war_and_peace.readlines()[:50]
#F.wMain.values = war_and_peace.readlines()

F.edit()


if __name__ == "__main__":
App = TestApp()
App.run()

0 comments on commit 629aeb5

Please sign in to comment.