Esempio n. 1
0
    def testRunOnEntireTestFolder(self):
        for execute_path in os.listdir(self.base_path):
            print '#' * 50
            print "# Working with dir: ", execute_path
            paths = files.find_all_files(os.path.join(self.base_path, execute_path))
            for pa in paths:
                print "#", pa.is_interesting(), '|', pa
                if pa.is_interesting():
                    pa.get_handler().execute()

                d = directory.get_dir(dir_name = execute_path)
                # If the directory is not in the database
                if not d:
                    d = directory.create_directory(
                       dir_name = execute_path,
                       path_name = self.base_path,
                       checked = datetime.now()
                    )
                    # Brand spanking new
                else:
                    if d.is_old():
                        print 'Dir is old'
                        continue

                print "#", pa.get_descriptive_string()
Esempio n. 2
0
        execute_paths.append(full_path)

print execute_paths

# Run on the paths submitted to us.
for execute_path in execute_paths:
    print 'Path: ', execute_path

    results = []

    if settings.VERBOSE:
        pass

    print 'Start the analyzing'
    take_action = False
    d = directory.get_dir(dir_name = execute_path)
    
    print 'Directory', d
    
    # The directory is 
    if d is None:
        if settings.VERBOSE:
            print 'Creating the directory in the database'

        take_action = True
        
        d = directory.create_directory(
           dir_name = execute_path,
           path_name = settings.DOWNLOADS_FOLDER,
           checked = datetime.datetime.now()
        )