Skip to content

Commit 117e788

Browse files
removing __init__.py
1 parent c81e0e2 commit 117e788

File tree

4 files changed

+3
-22
lines changed

4 files changed

+3
-22
lines changed

Templates/Web/__init__.py

Whitespace-only changes.

Templates/Web/configs/HTML/__init__.py

Whitespace-only changes.

Templates/Web/configs/__init__.py

Whitespace-only changes.

Templates/Web/setup_templates.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,23 @@
11
import os
2-
import site
32

43
loc = os.getcwd()
54
new_loc = loc.replace("\\", "/")
6-
venv_templates_path = f"{new_loc}/.venv/Lib/site-packages/Templates"
7-
# Get the global site-packages directory
8-
site_packages_path = site.getsitepackages()[0]
9-
global_templates_path = f"{site_packages_path}/Templates"
105

116

127
def get_configs(filename):
13-
if os.path.exists(venv_templates_path):
14-
template_folder = venv_templates_path
15-
elif os.path.exists(global_templates_path):
16-
template_folder = global_templates_path
17-
else:
18-
return "Error: Templates folder not found"
19-
20-
with open(f"{template_folder}/Web/configs/HTML/{filename}", "r", encoding="utf-8") as file:
8+
with open(f"{new_loc}/Dev/Templates/Web/configs/HTML/{filename}", "r", encoding="utf-8") as file:
219
html_content = file.read()
2210
return html_content
2311

2412

2513
def fetch_configs():
26-
if os.path.exists(venv_templates_path):
27-
template_folder = venv_templates_path
28-
elif os.path.exists(global_templates_path):
29-
template_folder = global_templates_path
30-
else:
31-
return "Error: Templates folder not found"
32-
33-
return os.listdir(f"{template_folder}/configs/HTML/")
14+
return os.listdir(f"{new_loc}/Dev/Templates/configs/HTML/")
3415

3516

3617
def setup_configs():
3718
flask_app = """
3819
from flask import Flask, render_template
39-
import Templates.setup_templates as ds
20+
import Dev.Templates.setup_templates as ds
4021
import os
4122
4223
app = Flask(__name__)

0 commit comments

Comments
 (0)