예제 #1
0
def main():
    """Run schiffmanandstein1970 as script"""
    a = GenericInputFileArgParser(obj=SchiffmanAndStein1970,
                                  methods=[('make_all', [], {})],
                                  pass_open_file=True)

    a.main()
예제 #2
0
def main():
    """Run nogamiandli2003 as script"""
    a = GenericInputFileArgParser(obj=NogamiAndLi2003,
                                  methods=[('make_all', [], {})],
                                 pass_open_file=True)

    a.main()
예제 #3
0
def main():
    """Run nogamiandli2003 as script"""
    a = GenericInputFileArgParser(obj=NogamiAndLi2003,
                                  methods=[('make_all', [], {})],
                                  pass_open_file=True)

    a.main()
예제 #4
0
def main():
    """Run schiffmanandstein1970 as script"""
    a = GenericInputFileArgParser(obj=SchiffmanAndStein1970,
                                  methods=[('make_all', [], {})],
                                 pass_open_file=True)

    a.main()
예제 #5
0
    def test_pattern_with_fobj(self):

        a = GenericInputFileArgParser(self._abc_fobj, True)
        args = '-d {0} -p *.txt'.format(self.tempdir.path).split()
#        print(args)
        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            b1
                            b2""").splitlines())
예제 #6
0
    def test_directory_with_path(self):

        a = GenericInputFileArgParser(self._abc_path, False)
        args = '-d {0} -p'.format(self.tempdir.path).split()
        print(args)
        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            a1.py
                            a2.py""").splitlines())
예제 #7
0
    def test_pattern_with_fobj(self):

        a = GenericInputFileArgParser(self._abc_fobj, True)
        args = '-d {0} -p *.txt'.format(self.tempdir.path).split()
#        print(args)
        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            b1
                            b2""").splitlines())
예제 #8
0
    def test_directory_with_path(self):

        a = GenericInputFileArgParser(self._abc_path, False)
        args = '-d {0} -p'.format(self.tempdir.path).split()
        print(args)
        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            a1.py
                            a2.py""").splitlines())
예제 #9
0
    def test_filename_with_path(self):

        a = GenericInputFileArgParser(self._abc_path, False)
        args = '-f {0} {1}'.format(os.path.join(self.tempdir.path, 'a1.py'),
                                   os.path.join(self.tempdir.path,
                                                'b1.txt')).split()
        #        print(args)
        a.main(argv=args)

        assert_equal(
            self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
            textwrap.dedent("""\
                            a1.py
                            b1.txt""").splitlines())
예제 #10
0
    def test_filename_with_path(self):

        a = GenericInputFileArgParser(self._abc_path, False)
        args = '-f {0} {1}'.format(
            os.path.join(self.tempdir.path, 'a1.py'),
            os.path.join(self.tempdir.path, 'b1.txt')
                                ).split()
#        print(args)
        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            a1.py
                            b1.txt""").splitlines())
예제 #11
0
    def test_methods_with_path(self):

        a = GenericInputFileArgParser(HelperForGenericInputFileArgParser,
                                      False, [('dog', [], {})])

        args = '-f {0} {1}'.format(os.path.join(self.tempdir.path, 'a1.py'),
                                   os.path.join(self.tempdir.path,
                                                'b1.txt')).split()

        a.main(argv=args)

        assert_equal(
            self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
            textwrap.dedent("""\
                            a1.py
                            dog
                            b1.txt
                            dog
                            """).splitlines())
예제 #12
0
    def test_methods_with_path(self):




        a = GenericInputFileArgParser(HelperForGenericInputFileArgParser,
                                      False, [('dog',[],{})])

        args = '-f {0} {1}'.format(
            os.path.join(self.tempdir.path, 'a1.py'),
            os.path.join(self.tempdir.path, 'b1.txt')
                                ).split()

        a.main(argv=args)

        assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(),
                            textwrap.dedent("""\
                            a1.py
                            dog
                            b1.txt
                            dog
                            """).splitlines())