예제 #1
0
	def report_to_db(self):
		# connect to the database
		connection = pymmFunctions.database_connection(
			self.linkingAgentIdentifierValue
			)
		# print(connection)
		# get the sql query
		sql = MySQLqueries.insertEventSQL

		cursor = pymmFunctions.do_query(
			connection,
			sql,
			self.eventType,
			self.objectIdentifierValue,
			self.objectIdentifierValueID,
			self.eventDateTime,
			self.eventOutcome,
			self.eventOutcomeDetail,
			self.eventDetailCallingFunc,
			self.eventDetailComputer,
			self.linkingAgentIdentifierValue
			)
		self.eventID = cursor.lastrowid

		connection.close_cursor()
		connection.close_connection()

		return self.eventID
예제 #2
0
	def report_to_db(self):
		# connect to the database
		connection = pymmFunctions.database_connection(
			self.user
			)
		# get the sql query
		sql = MySQLqueries.reportLTFScontents

		for _object, details in self.ltfsContents['objects'].items():
			ltoID = self.ltfsContents['ltoID']
			filename = _object
			fileSize = self.ltfsContents['objects'][_object]['size']
			modifyTime = self.ltfsContents['objects'][_object]['modified']
			filePath = self.ltfsContents['objects'][_object]['path']

			cursor = pymmFunctions.do_query(
				connection,
				sql,
				ltoID,
				filename,
				fileSize,
				modifyTime,
				filePath
				)

			connection.close_cursor()
		connection.close_connection()

		return True
예제 #3
0
	def report_to_db(self):
		# connect to the database
		connection = pymmFunctions.database_connection(
			self.user
			)
		# get the sql query
		sql = MySQLqueries.insertFixitySQL

		cursor = pymmFunctions.do_query(
			connection,
			sql,
			self.eventID,
			self.objectID,
			self.objectIdentifierValue,
			self.eventDateTime,
			self.eventDetailCallingFunc,
			self.messageDigestAlgorithm,
			self.messageDigestFilepath,
			self.messageDigestHashValue,
			self.messageDigestSource
			)
		self.fixityID = cursor.lastrowid

		connection.close_cursor()
		connection.close_connection()

		return self.fixityID
예제 #4
0
def get_event_timestamp(eventID, user):
    connection = pymmFunctions.database_connection(user)
    sql = MySQLqueries.getEventTimestamp

    cursor = pymmFunctions.do_query(connection, sql, eventID)
    # this returns a datetime.datetime tuple like
    # (datetime.datetime(2018, 7, 16, 15, 21, 13),)
    value = cursor.fetchone()
    timestamp = value[0].strftime("%Y-%m-%dT%H:%M:%S")
    return timestamp
예제 #5
0
    def report_to_db(self):
        # connect to the database
        connection = pymmFunctions.database_connection(self.user)
        # get the sql query
        sql = MySQLqueries.insertObjectSQL

        cursor = pymmFunctions.do_query(connection, sql,
                                        self.objectIdentifierValue,
                                        self.objectCategory,
                                        self.objectCategoryDetail)
        self.objectIdentifierValueID = cursor.lastrowid

        connection.close_cursor()
        connection.close_connection()

        return self.objectIdentifierValueID
예제 #6
0
    def report_to_db(self):
        # connect to the database
        connection = pymmFunctions.database_connection(self.user)
        # get the sql query
        sql = MySQLqueries.insertObjCharSQL

        cursor = pymmFunctions.do_query(connection, sql, self.objectID,
                                        self.objectIdentifierValue,
                                        self.mediaInfo, self.ingestLog,
                                        self.pbcoreText, self.pbcoreXML)
        self.objCharID = cursor.lastrowid

        connection.close_cursor()
        connection.close_connection()

        return self.objCharID