def test_view_file(self):
        test_dir = os.path.dirname(__file__)
        testfile = os.path.join(test_dir, 'test_textview.py')
        view = tv.view_file(root, 'Title', testfile, modal=False)
        self.assertIsInstance(view, tv.TextViewer)
        self.assertIn('Test', view.textView.get('1.0', '1.end'))
        view.Ok()

        # Mock messagebox will be used and view_file will not return anything
        testfile = os.path.join(test_dir, '../notthere.py')
        view = tv.view_file(root, 'Title', testfile, modal=False)
        self.assertIsNone(view)
Exemple #2
0
    def test_view_file(self):
        test_dir = os.path.dirname(__file__)
        testfile = os.path.join(test_dir, 'test_textview.py')
        view = tv.view_file(root, 'Title', testfile, modal=False)
        self.assertIsInstance(view, tv.TextViewer)
        self.assertIn('Test', view.textView.get('1.0', '1.end'))
        view.Ok()

        # Mock messagebox will be used and view_file will not return anything
        testfile = os.path.join(test_dir, '../notthere.py')
        view = tv.view_file(root, 'Title', testfile, modal=False)
        self.assertIsNone(view)
Exemple #3
0
    def test_view_file(self):
        test_dir = os.path.dirname(__file__)
        testfile = os.path.join(test_dir, "test_textview.py")
        view = tv.view_file(self.root, "Title", testfile, modal=False)
        self.assertIsInstance(view, tv.TextViewer)
        self.assertIn("Test", view.textView.get("1.0", "1.end"))
        view.Ok()

        # Mock messagebox will be used and view_file will not return anything
        testfile = os.path.join(test_dir, "../notthere.py")
        view = tv.view_file(self.root, "Title", testfile, modal=False)
        self.assertIsNone(view)
Exemple #4
0
 def display_file_text(self, title, filename, encoding=None):
     fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), filename)
     textView.view_file(self, title, fn, encoding)
 def help_dialog(event=None):
     from idlelib import textView
     fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt')
     textView.view_file(root, 'Help', fn)
Exemple #6
0
 def show(help_label=help_label, help_file=help_file):
     view_file(self.root, help_label, os.path.join(demo_dir, help_file))
def showAboutTurtle():
    view_file(demo.root, "About the new turtle module.",
              os.path.join(demo_dir, "about_turtle.txt"))
Exemple #8
0
def showAboutDemo():
    view_file(demo.root, "About turtleDemo", "about_turtledemo.txt")
Exemple #9
0
def showAboutDemo():
    view_file(demo.root, "About turtleDemo",
              os.path.join(demo_dir, "about_turtledemo.txt"))
 def display_file_text(self, title, filename, encoding=None):
     fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), filename)
     textView.view_file(self, title, fn, encoding)
 def help_dialog(self, event=None):
     fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'help.txt')
     textView.view_file(self.top, 'Help', fn)
Exemple #12
0
 def show(help_label=help_label, help_file=help_file):
     view_file(self.root, help_label,
               os.path.join(demo_dir, help_file))
Exemple #13
0
def showAboutTurtle():
    view_file(demo.root, "About the new turtle module.", "about_turtle.txt")
 def help_dialog(event=None):
     from idlelib import textView
     fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt')
     textView.view_file(root, 'Help', fn)
def showDemoHelp():
    view_file(demo.root, "Help on turtleDemo",
              os.path.join(demo_dir, "demohelp.txt"))
Exemple #16
0
def showDemoHelp():
    view_file(demo.root, "Help on turtleDemo",
              os.path.join(demo_dir, "demohelp.txt"))
def showAboutDemo():
    view_file(demo.root, "About turtleDemo",
              os.path.join(demo_dir, "about_turtledemo.txt"))
Exemple #18
0
def showAboutTurtle():
    view_file(demo.root, "About the new turtle module.",
              os.path.join(demo_dir, "about_turtle.txt"))
Exemple #19
0
def showDemoHelp():
    view_file(demo.root, "Help on turtleDemo", "demohelp.txt")