Skip to content

Commit

Permalink
Fixed the modulenotfound error, that occured due to relative imports,…
Browse files Browse the repository at this point in the history
… by making everything absolute
  • Loading branch information
TejasIsCool committed Mar 7, 2024
1 parent ba3e81c commit 379c937
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .idea/mcIVASmaker.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import json
import os

from PIL import Image
if __name__ == "__main__":
data = {}
all_files = os.listdir("../new_textures/textures")
Expand All @@ -41,9 +40,9 @@
selection = "side"

if selection != "":
data[block_name][selection] = {"file": filenamepng, "color": avg_color}
data[block_name][selection] = filenamepng
else:
data[block_name]['extra'].append({"file": filenamepng, "color": avg_color})
data[block_name]['extra'].append(filenamepng)
else:
block_data = {
"top": filenamepng,
Expand Down
4 changes: 2 additions & 2 deletions src/logic/fileio/image_thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logic.fileio.file_verifier as image_handler
from logic.image_logic import image_to_redstone_lamps, img_to_blocks
import src.logic.fileio.file_verifier as image_handler
from src.logic.image_logic import image_to_redstone_lamps, img_to_blocks
import PIL
from PIL import Image
import io
Expand Down
2 changes: 1 addition & 1 deletion src/logic/image_logic/image_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PIL import Image
from logic.image_logic import image_to_redstone_lamps, img_to_blocks as img_to_block_img
from src.logic.image_logic import image_to_redstone_lamps, img_to_blocks as img_to_block_img
import os
import mcschematic
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/logic/image_logic/image_to_redstone_lamps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PIL import Image, ImageFile
import mcschematic
import numpy as np
from path_manager.pather import resource_path
from src.path_manager.pather import resource_path

ImageFile.LOAD_TRUNCATED_IMAGES = True

Expand Down
4 changes: 2 additions & 2 deletions src/logic/image_logic/img_to_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import json
import functools
import numpy as np
from logic.image_logic.block_parser import block_parser
from src.logic.image_logic.block_parser import block_parser
from PIL import Image, ImageFile
from path_manager.pather import resource_path
from src.path_manager.pather import resource_path
import os
from typing import TypedDict

Expand Down
2 changes: 1 addition & 1 deletion src/logic/manage_audio_tab.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import random
import ui_manager.PySimpleGUI as sg
import src.ui_manager.PySimpleGUI as sg
# Extra variables
text_list = [
'Oi', 'Oii', 'Stop it!',
Expand Down
10 changes: 5 additions & 5 deletions src/logic/manage_events.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ui_manager.PySimpleGUI as sg
import src.ui_manager.PySimpleGUI as sg

from logic.manage_image_tab import manage_img_tab
from logic.manage_video_tab import manage_vid_tab
from logic.manage_audio_tab import manage_audio_tab
from logic.popup_manager import manage_popups
from src.logic.manage_image_tab import manage_img_tab
from src.logic.manage_video_tab import manage_vid_tab
from src.logic.manage_audio_tab import manage_audio_tab
from src.logic.popup_manager import manage_popups


def manage_events(window: sg.Window):
Expand Down
8 changes: 4 additions & 4 deletions src/logic/manage_image_tab.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import time

import ui_manager.PySimpleGUI as sg
from logic.fileio.file_verifier import check_file_exists
from logic.fileio.image_thumbnail import load_image_for_display, load_image_for_preview
from logic.image_logic.image_manager import manipulate_image
import src.ui_manager.PySimpleGUI as sg
from src.logic.fileio.file_verifier import check_file_exists
from src.logic.fileio.image_thumbnail import load_image_for_display, load_image_for_preview
from src.logic.image_logic.image_manager import manipulate_image
from io import BytesIO
import logging
logger = logging.getLogger(__name__)
Expand Down
10 changes: 5 additions & 5 deletions src/logic/manage_video_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

from PIL import Image

import ui_manager.PySimpleGUI as sg
from logic.fileio.file_verifier import check_file_exists
from logic.vid_logic.ffmpeg_manager import get_resolution, get_frame_count
from logic.vid_logic.vid_manager import vid_manager
from path_manager.pather import resource_path
import src.ui_manager.PySimpleGUI as sg
from src.logic.fileio.file_verifier import check_file_exists
from src.logic.vid_logic.ffmpeg_manager import get_resolution, get_frame_count
from src.logic.vid_logic.vid_manager import vid_manager
from src.path_manager.pather import resource_path

# Loads up the progress animation
IMAGES = []
Expand Down
2 changes: 1 addition & 1 deletion src/logic/vid_logic/ffmpeg_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import os
import subprocess
from path_manager.pather import resource_path
from src.path_manager.pather import resource_path
import ffmpeg

assets_path = resource_path(f"./assets/cache/")
Expand Down
2 changes: 1 addition & 1 deletion src/logic/vid_logic/schematic_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# A set amount of frame peed, 20, 10, 5, 4, 2, 1
# For a frame speed, the user decides if the video is slowed to show all frames
# Or frame are skipped to match relative speed
# Commands or no commands(Obviously, no resdtone mechanism, orrrrr maybeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)
# Commands or no commands(Obviously, no redstone mechanism, orrrrr maybeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)
# Nah too hard (Maybe black and white(as lamps), and as rom instead?)
15 changes: 6 additions & 9 deletions src/logic/vid_logic/vid_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import time
from multiprocessing.pool import ThreadPool, Pool
from multiprocessing import Queue, Manager
import ui_manager.PySimpleGUI as sg
import src.ui_manager.PySimpleGUI as sg

from logic.image_logic.image_manager import manipulate_image
from src.logic.image_logic.image_manager import manipulate_image

from logic.vid_logic import ffmpeg_manager
from path_manager.pather import resource_path
from src.logic.vid_logic import ffmpeg_manager
from src.path_manager.pather import resource_path
import logging

logger = logging.getLogger(__name__)
Expand All @@ -21,7 +21,7 @@

vid_processed_folder = os.path.normpath(os.path.join(assets_path, "./img_process_cache/"))

# Create the paths if they don't exist (Git doesnot recognize empty folders)
# Create the paths if they don't exist (Git does not recognize empty folders)
if not os.path.exists(vid_cache_folder_jpg):
os.makedirs(vid_cache_folder_jpg)

Expand Down Expand Up @@ -88,7 +88,7 @@ def vid_manager(window: sg.Window, filepath: str, output: str, manipulation: str
# Starting the processing of images to blocks, while ffmpeg is generating those images, to save time
if file_count > current_image:
img_file_path = os.path.join(cache_folder, files[current_image])
# Remove the first 4 and last 4 chracter, to get just the number
# Remove the first 4 and last 4 characters, to get just the number
file_number = os.path.split(img_file_path)[1][4:-4]
processed_path = os.path.join(vid_processed_folder, file_number + ".png")
image_processes.append(process_pool.apply_async(
Expand Down Expand Up @@ -137,9 +137,6 @@ def vid_manager(window: sg.Window, filepath: str, output: str, manipulation: str
current_image += 1

process_pool.close()
# Reset the image counts done, because we over count in the below section otherwise
# Nope, its better to overcount hre cause user experience or smth
# window.write_event_value((THREAD_KEY, '-Reset_Images_Done-'), None)
iter_count = 0
while True:
# Updating the progress meters, till the all the processing has been done
Expand Down
2 changes: 1 addition & 1 deletion src/window/layouts/audiotab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ui_manager import PySimpleGUI as sg
from src.ui_manager import PySimpleGUI as sg


def get_audio_tab() -> list:
Expand Down
4 changes: 2 additions & 2 deletions src/window/layouts/imagetab.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ui_manager import PySimpleGUI as sg
from src.ui_manager import PySimpleGUI as sg
import textwrap
from path_manager.pather import resource_path
from src.path_manager.pather import resource_path
import json

# TODO: Black/white list will be all blocks name in a list, and clicking them changes colour to indicate its been
Expand Down
4 changes: 2 additions & 2 deletions src/window/layouts/videotab.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ui_manager import PySimpleGUI as sg
from src.ui_manager import PySimpleGUI as sg
import textwrap
from path_manager.pather import resource_path
from src.path_manager.pather import resource_path
import json

path = resource_path("./assets/blocks/all_blocks_textures/")
Expand Down
8 changes: 4 additions & 4 deletions src/window/window_layouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ui_manager import PySimpleGUI as sg
from window.layouts import imagetab, videotab, audiotab
from path_manager.pather import resource_path
from src.ui_manager import PySimpleGUI as sg
from src.window.layouts import imagetab, videotab, audiotab
from src.path_manager.pather import resource_path

# A custom decent theme
DecentGrey = {
Expand Down Expand Up @@ -71,7 +71,7 @@ def make_window():
with open(resource_path("./assets/icon/icon_base64.txt"), "rb") as f:
icon_base64 = f.read()

# Note, i hav commented out a few lines in PySimpleGUI.py
# Note, I have commented out a few lines in PySimpleGUI.py
# To make the icon stuff appear on taskbar
# Find wm_overrideredirect there ig

Expand Down

0 comments on commit 379c937

Please sign in to comment.