コード例 #1
0
ファイル: movies.py プロジェクト: joelbitar/rfinder
    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()
コード例 #2
0
ファイル: main.py プロジェクト: joelbitar/rfinder
    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()
        )
    else:
        # The directory is old, now we are gonna check if it's old.
        if settings.VERBOSE:
            print 'The directory is in the database. NOT going to take action'
        # If we should not delete the source after action
        # OR
        # the directory is not OLD
        if not settings.DELETE_SOURCE_AFTER_ACTION:
            if settings.VERBOSE:
                print 'We should not delete the soruce after action'
            continue
        
        if not d.is_old():