Commit 7088b4d6 authored by tarun2512's avatar tarun2512

first commit

parent b13c29cd
MONGO_URI=mongodb://admin:iLens%23QAv513@192.168.0.217:30904/?authMechanism=DEFAULT&directConnection=true
BASE_URI=https://qa.unifytwin.com/
LOGIN_TOKEN=e4b4059ab01b488abdbc865f8d4cb543
USER_ID=fpWx7Aw4NJzzXWxcE6w5dU
PROJECT_ID=project_287
APP_NAME=FT Energy Manager
PREFIX=project_287
ZIP_NAME=FT Energy Manager.zip
BASE_PATH=/code/data
MOUNT_DIR=app_zip
\ No newline at end of file
This diff is collapsed.
import os
import zipfile
import json
from PIL import Image
class CloneScriptHelper:
def __int__(self):
pass
@staticmethod
def list_folders(path):
# Get a list of all items (files and directories) in the specified path
items = os.listdir(path)
# Filter out only directories
folders = [item for item in items if os.path.isdir(os.path.join(path, item))]
return folders
@staticmethod
def unzip_file(zip_filename, extract_path):
with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
zip_ref.extractall(extract_path)
print(f"File {zip_filename} successfully extracted to {extract_path}")
@staticmethod
def read_json_file(file_path):
with open(file_path, 'r') as file:
data = json.load(file)
return data
@staticmethod
def is_image(file_path):
try:
with Image.open(file_path):
return True
except (IOError, OSError):
return False
def list_images_in_folder(self, folder_path):
all_files = os.listdir(folder_path)
image_files = [file for file in all_files if self.is_image(os.path.join(folder_path, file))]
return image_files
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment