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

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

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

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

    a.main()
Example #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())
Example #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())
Example #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())
Example #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())
Example #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())
Example #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())
Example #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())
Example #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())