Fixes for Presentation 1
This commit is contained in:
parent
d093dbb5b9
commit
ffa2954d1f
@ -226,7 +226,7 @@ while (command.lower() not in ["exit", "quit", "end"]):
|
||||
print("fetch - gets the next image from database if exists")
|
||||
print("fetchall - get all images")
|
||||
print("delete - delets the next image from db if exists")
|
||||
print("delete - delets all images from the service")
|
||||
print("deleteall - delets all images from the service")
|
||||
print("rapid <#amount> [<#time>] - next <amount> images in line are sent to backend in <time> (default: 5) second intervals")
|
||||
print("skip [<#amount>] - skips the next <amount> number of images in line or 1 if no <amount> is given")
|
||||
print("set <#index> - sets image on given <index> as next in line")
|
||||
@ -234,7 +234,7 @@ while (command.lower() not in ["exit", "quit", "end"]):
|
||||
print()
|
||||
print()
|
||||
|
||||
if command.lower() == "check":
|
||||
if command.lower() == "check" or command.lower() == "health":
|
||||
check_system()
|
||||
|
||||
if command.lower() == "dir":
|
||||
|
||||
@ -85,9 +85,12 @@ class MinioService:
|
||||
r = requests.get(settings.AWS_HOST + "?list")
|
||||
root = ET.fromstring(r.content)
|
||||
list = []
|
||||
cnt = 0
|
||||
for child in root.iter('{http://s3.amazonaws.com/doc/2006-03-01/}Contents'):
|
||||
list.append(child.find('{http://s3.amazonaws.com/doc/2006-03-01/}Key').text)
|
||||
|
||||
cnt = cnt + 1
|
||||
if cnt == 0:
|
||||
return True
|
||||
body = "<Delete>"
|
||||
for key in list:
|
||||
body += "<Object><Key>" + key + "</Key></Object>"
|
||||
|
||||
@ -30,17 +30,18 @@ class MongoDBService:
|
||||
|
||||
@staticmethod
|
||||
def getSingle(identifier):
|
||||
|
||||
metadata = None
|
||||
try:
|
||||
instance = MongoManager.getInstance()
|
||||
|
||||
db = instance.AIC
|
||||
col = db.metadata
|
||||
metadata = None
|
||||
try:
|
||||
resp = col.find({"identifier": identifier})
|
||||
metadata = resp[0]
|
||||
except:
|
||||
print("Could not find Metadata")
|
||||
|
||||
if metadata is None:
|
||||
return None
|
||||
else:
|
||||
|
||||
@ -6,6 +6,11 @@ class WrapperService:
|
||||
@staticmethod
|
||||
def wrap_file(file_bytes: bytes) -> str:
|
||||
file_encoded_b64 = base64.b64encode(file_bytes)
|
||||
print('b64 gemacht')
|
||||
print(file_encoded_b64)
|
||||
print()
|
||||
print('utf8- decodiert')
|
||||
print(file_encoded_b64.decode())
|
||||
return file_encoded_b64.decode()
|
||||
|
||||
@staticmethod
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user