def __dispatch_task_type(self):
		if self.task_type in valid_task_types:
			swift_store_url=configuration.swift_store_url.format(self.tenant)
			ex = Extractor(containerName=self.container, storage_url=swift_store_url, token=self.token)
			if self.task_type == valid_task_types[0]:
				s = ex.runIdentifierForWholeContainer()
			elif self.task_type == valid_task_types[1]:
				s = ex.runFilterForWholeContainer()
			elif self.task_type == valid_task_types[3]:
				s=ex.runDisposalForWholeContainer()
			self.__notifySender("task {} finished: {}".format(self.task_type, s), task_type="success")
	def __dispatch_task_type(self):
		if self.task_type in valid_task_types:
			swift_store_url=configuration.swift_store_url.format(self.tenant)
			ex = Extractor(containerName=self.container, storage_url=swift_store_url, token=self.token)
			if self.task_type == valid_task_types[0]:
				s = ex.runIdentifierForWholeContainer()
			elif self.task_type == valid_task_types[1]:
				s = ex.runFilterForWholeContainer()
			elif self.task_type == valid_task_types[3]:
				s = ex.runDisposalForWholeContainer()
			elif self.task_type == valid_task_types[4]:
				s = ex.runReplicateMetadataForWholeContainer()
			self.__notifySender("task {} finished: {}".format(self.task_type, s), task_type="success")
Exemplo n.º 3
0
#swift_user = "******"
#swift_pw = "testing"
swift_auth_url = "http://192.168.209.204:8080/auth/v1.0"
swift_store_url = "http://192.168.209.204:8080/v1/AUTH_{}"
swift_user = "******"
swift_pw = "testing"

swift_url = swift_auth_url
log = logging.getLogger()
sb = SwiftBackend(swift_url=swift_url,
                  swift_user=swift_user,
                  swift_pw=swift_pw)
conn = sb._getConnection()

if __name__ == '__main__':
    log.error('starting metadata extractor tester')
    ex = Extractor(containerName=containerName,
                   swift_url=swift_url,
                   swift_user=swift_user,
                   swift_pw=swift_pw)
    #ex.runIdentifierForWholeContainer()
    #ex.runFilterForWholeContainer()
    #ex.replicateMetaData()
    #Replicator.replicateMetadata(conn=conn,containerName=self.containerName,objectName=objName,objectType=objType)
    #Replicator.replicateMetadata(conn=conn,containerName=containerName,objectName="DSC00712.JPG",objectType="image/jpeg")
    ex.runReplicateMetadataForWholeContainer()

    # ex.runDummyLoad()

    log.error('DONE')

	Copyright (C) <2016> Tim Waizenegger, <University of Stuttgart>

	This software may be modified and distributed under the terms
	of the MIT license.  See the LICENSE file for details.
"""
import logging
from mcm.metadataExtractor.Extractor import Extractor

# log lvls: DEBUG - INFO - WARNING - ERROR - CRITICAL
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(module)s - %(levelname)s ##\t  %(message)s')

containerName = 'crypto-4'
#swift_url = "http://192.168.209.204:8080/auth/v1.0"
swift_url = "http://localhost:3000/auth/v1.0"
swift_user = "******"
swift_pw = "testing"

log = logging.getLogger()
ex = Extractor(containerName=containerName, swift_url=swift_url, swift_user=swift_user, swift_pw=swift_pw)

if __name__ == '__main__':
	log.error('starting metadata extractor tester')

	ex.runIdentifierForWholeContainer()
	ex.runFilterForWholeContainer()
	# ex.runDummyLoad()

	log.error('DONE')