Exemple #1
0
def main():

    """
    Main file of the validator. uses other class methods for checking
    different aspects of the directory path.

    usage: checker.py [-h] [-v] path

            positional arguments:
            path           Path to your folder

            optional arguments:
            -h, --help     show this help message and exit
            -v, --verbose  increase output verbosity


    """

    parser = argparse.ArgumentParser()
    parser.add_argument('-v', '--verbose', action='store_true',
                        help='increase output verbosity')
    parser.add_argument('path', help='Path to your folder ')
    args = parser.parse_args()

    if args.verbose:
        try:
            directory = args.path
        except IndexError:
            directory = '.'

        if not os.path.isdir(args.path):
            print('Directory does not exist:', args.path)
            exit(1)
        error_found = is_AnDO(directory, True , False)
        if error_found == 1:
            print("\n" +
                  directory +
                  ": Is Not validated by AnDOChecker")
        else:
            print("\n" +
                  directory +
                  ": Is validated by AnDOChecker")
    else:
        try:
            directory = args.path
        except IndexError:
            directory = '.'
        if not os.path.isdir(args.path):
            print('Directory does not exist:', args.path)
            exit(1)
        error_found = is_AnDO(directory, False, False)
        if error_found:
            print("\n" +
                  directory +
                  ": Is Not validated by AnDOChecker")
        else:
            print("\n" +
                  directory +
                  ": Is validated by AnDOChecker")
Exemple #2
0
 def test_AnDO_dataset_7(self):
     directory = currpath + "/ds007/data/exp-Landing/"
     self.assertEqual(andoE.is_AnDO(directory), False)
Exemple #3
0
 def test_AnDO_dataset_6(self):
     directory = currpath + "/ds006/data/Landing"
     self.assertEqual(andoE.is_AnDO(directory), False)
Exemple #4
0
 def test_AnDO_dataset_5(self):
     directory = currpath + "/ds005/data/my_experiment"
     self.assertEqual(andoE.is_AnDO(directory), False)
Exemple #5
0
 def test_AnDO_dataset_4(self):
     directory = currpath + "/ds004/data/newexp_vision"
     self.assertEqual(andoE.is_AnDO(directory), False)
Exemple #6
0
 def test_AnDO_dataset_7(self):
     directory = os.path.join(currpath, "dataset007", "exp-Landing")
     self.assertEqual(andoE.is_AnDO(directory, False, False), False)
Exemple #7
0
 def test_AnDO_dataset_5(self):
     directory = os.path.join(currpath, "dataset005", "exp-myexperiment")
     self.assertEqual(andoE.is_AnDO(directory, False, False), True)
Exemple #8
0
 def test_AnDO_dataset_4(self):
     directory = os.path.join(currpath, "dataset004", "exp-vision")
     self.assertEqual(andoE.is_AnDO(directory, False, False), True)
Exemple #9
0
    parser.add_argument('-v',
                        '--verbose',
                        action='store_true',
                        help='increase output verbosity')
    parser.add_argument('path', help='Path to your folder ')
    args = parser.parse_args()

    if args.verbose:
        try:
            directory = args.path
        except IndexError:
            directory = '.'
        error = is_AnDO_verbose(directory)

        if error == 1:
            print("\n" + directory + ": Is Not validated by AnDOChecker")
        else:
            print("\n" + directory + ": Is validated by AnDOChecker")
    else:
        try:
            directory = args.path
        except IndexError:

            directory = '.'

        error_not_found = is_AnDO(directory)
        if not error_not_found:
            print("\n" + directory + ": Is Not validated by AnDOChecker")
        else:
            print("\n" + directory + ": Is validated by AnDOChecker")