Skip to content

Commit

Permalink
testing a few more things
Browse files Browse the repository at this point in the history
  • Loading branch information
lunamidori5 committed Nov 16, 2024
1 parent 561d807 commit 3cb73df
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Webserver/Programs/File_manager/file_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import json
import time
import base64
import shutil
import hashlib
Expand Down Expand Up @@ -208,6 +209,8 @@ def upload_to_midori_ai(data: bytes):
f.write = encrypted_data

try:
while not os.path.isfile(encrypted_tar_file):
time.sleep(1)
subprocess.call([f"midori-ai-uploader --type Linux --file \"{encrypted_tar_file}\" --filename \"{filename_to_upload}\""])
os.remove(encrypted_tar_file)
except Exception as error:
Expand Down Expand Up @@ -240,7 +243,7 @@ def main(args):

for program in midori_ai_programs:
if check_programs(program):
print(f"{program} found!")
continue
else:
print(f"You are missing {program} form your path, please install or update them...")

Expand All @@ -258,21 +261,20 @@ def main(args):
print(f"Packing {working_item}")
build_tar(working_item)

compress_tar()

if unpack:
folder_to_unpack_in = input("Please enter the folder you would like to unpack in: ")
uncompress_iternet_tar()
uncompress_tar(folder_to_unpack_in)
os.remove(temp_tar_file)

if upload:
if os.path.exists(compressed_tar_file):
if os.path.exists(temp_tar_file):

compress_tar()

with open(compressed_tar_file, "rb") as f:
bytes_to_upload = f.read()

os.remove(compressed_tar_file)

upload_to_midori_ai(bytes_to_upload)

if download:
Expand Down

0 comments on commit 3cb73df

Please sign in to comment.