Skip to content

Commit 86ca5a6

Browse files
FEAT: Add Audio Track Offset Syncronization project
1 parent 36df6cd commit 86ca5a6

5 files changed

Lines changed: 1658 additions & 0 deletions

File tree

Binary file not shown.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# System Files
7+
**/.DS_Store
8+
**/Thumbs.db
9+
Icon? # match Icon<CR>
10+
**/Icon? # explicit: match at any nested level
11+
12+
# Ignore the Windows .Desktop Files
13+
**/desktop.ini
14+
15+
# Ignore the Logs directory
16+
**/Logs/*
17+
18+
# Ignore the Compressed Files
19+
**/.zip
20+
**/.rar
21+
**/*.gz
22+
**/*.7z
23+
**/*.tar.gz
24+
25+
# Ignore the Data Directories
26+
# Input folders
27+
**/Input/*
28+
**/Inputs/*
29+
**/input/*
30+
**/inputs/*
31+
32+
# Output folders
33+
**/Output/*
34+
**/Outputs/*
35+
**/output/*
36+
**/outputs/*
37+
38+
# Data folders
39+
**/Dados/*
40+
**/Data/*
41+
**/dados/*
42+
**/data/*
43+
44+
# Dataset folders
45+
**/Dataset/*
46+
**/Datasets/*
47+
**/dataset/*
48+
**/datasets/*
49+
50+
# Results folders
51+
**/Result/*
52+
**/Results/*
53+
**/result/*
54+
**/results/*
55+
56+
!.assets/*
57+
58+
# Ignore the Data Files
59+
**/*.csv
60+
**/*.json
61+
**/*.xml
62+
**/*.xls
63+
**/*.xlsx
64+
**/*.txt
65+
**/*.parquet
66+
**/*.arff
67+
**/*.png
68+
**/*.jpg
69+
**/*.jpeg
70+
**/*.gif
71+
**/*.bmp
72+
**/*.tiff
73+
**/*.svg
74+
**/*.~lock*
75+
!**/requirements.txt
76+
!**/README.md
77+
78+
# Environments
79+
**/.env
80+
**/.venv
81+
**/env/
82+
**/venv/
83+
**/ENV/
84+
**/env.bak/
85+
**/venv.bak/
86+
87+
# Ignore the Auto Commiter Python Files
88+
**/class_block_functions_committer.py
89+
**/functions_committer.py
90+
**/readme_sections_committer.py
91+
92+
# Ignore the Main Template Python File
93+
**/main-template.py
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Variables
2+
VENV := venv
3+
OS := $(shell uname 2>/dev/null || echo Windows)
4+
5+
# Detect correct Python and Pip commands based on OS
6+
ifeq ($(OS), Windows) # Windows
7+
PYTHON := $(VENV)/Scripts/python.exe
8+
PIP := $(VENV)/Scripts/pip.exe
9+
PYTHON_CMD := python
10+
CLEAR_CMD := cls
11+
TIME_CMD :=
12+
else # Unix-like
13+
PYTHON := $(VENV)/bin/python3
14+
PIP := $(VENV)/bin/pip
15+
PYTHON_CMD := python3
16+
CLEAR_CMD := clear
17+
TIME_CMD := time
18+
endif
19+
20+
# Logs directory
21+
LOG_DIR := ./Logs
22+
23+
# Ensure logs directory exists (cross-platform)
24+
ENSURE_LOG_DIR := @mkdir -p $(LOG_DIR) 2>/dev/null || $(PYTHON_CMD) -c "import os; os.makedirs('$(LOG_DIR)', exist_ok=True)"
25+
26+
# Run-and-log function
27+
# On Windows: simply runs the Python script normally
28+
# On Unix-like systems: supports DETACH variable
29+
# - If DETACH is set, runs the script in detached mode and tails the log file
30+
# - Else, runs the script normally
31+
ifeq ($(OS), Windows) # Windows
32+
RUN_AND_LOG = $(PYTHON) $(1)
33+
else
34+
RUN_AND_LOG = \ # Unix-like
35+
if [ -z "$(DETACH)" ]; then \
36+
$(PYTHON) $(1); \
37+
else \
38+
LOG_FILE=$(LOG_DIR)/$$(basename $(1) .py).log; \
39+
nohup $(PYTHON) $(1) > $$LOG_FILE 2>&1 & \
40+
tail -f $$LOG_FILE; \
41+
fi
42+
endif
43+
44+
# Default target
45+
all: run
46+
47+
# Make Rules
48+
run: dependencies
49+
$(ENSURE_LOG_DIR)
50+
$(CLEAR_CMD)
51+
$(call RUN_AND_LOG, ./main.py)
52+
53+
# Create virtual environment if missing
54+
$(VENV):
55+
@echo "Creating virtual environment..."
56+
$(PYTHON_CMD) -m venv $(VENV)
57+
$(PYTHON) -m pip install --upgrade pip
58+
59+
dependencies: $(VENV)
60+
@echo "Installing/Updating Python dependencies..."
61+
$(PIP) install -r requirements.txt
62+
63+
# Generate requirements.txt from current venv
64+
generate_requirements: $(VENV)
65+
$(PIP) freeze > requirements.txt
66+
67+
# Clean artifacts
68+
clean:
69+
rm -rf $(VENV) || rmdir /S /Q $(VENV) 2>nul
70+
find . -type f -name '*.pyc' -delete || del /S /Q *.pyc 2>nul
71+
find . -type d -name '__pycache__' -delete || rmdir /S /Q __pycache__ 2>nul
72+
73+
.PHONY: all run clean dependencies generate_requirements

0 commit comments

Comments
 (0)