Skip to content

Commit 4d8bf38

Browse files
still the docs issue
1 parent 463af69 commit 4d8bf38

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

pica/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class PICALauncherApp:
103103
FONT_INFO = ('Segoe UI', FONT_SIZE_BASE)
104104
FONT_INFO_ITALIC = ('Segoe UI', FONT_SIZE_BASE, 'italic')
105105
LOGO_FILE = resource_path("assets/LOGO/UGC_DAE_CSR_NBG.jpeg")
106-
MANUAL_FILE = resource_path("docs/Instruments_Manuals_Lists.md")
106+
MANUAL_FILE = resource_path("docs/User_Manual.md")
107107
README_FILE = resource_path("README.md")
108108
LICENSE_FILE = resource_path("LICENSE")
109109
UPDATES_FILE = resource_path("CHANGELOG.md")
@@ -745,7 +745,7 @@ def open_updates(self):
745745
self._show_file_in_window(self.UPDATES_FILE, "Change Log")
746746

747747
def open_manual_file(self):
748-
self._show_file_in_window(self.MANUAL_FILE, "Instrument Manuals")
748+
self._show_file_in_window(self.MANUAL_FILE, "User Manual")
749749

750750
def open_license(self):
751751
self._show_file_in_window(self.LICENSE_FILE, "MIT License")

setup.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
from setuptools import setup
2+
from setuptools.command.build_py import build_py as build_py_orig
13
import os
24
import shutil
3-
from setuptools import setup
4-
55

66
PICA_PKG_DIR = 'pica'
77
DATA_FILES_TO_COPY = {
@@ -17,14 +17,30 @@
1717
]
1818
}
1919

20-
for dest_subdir, files in DATA_FILES_TO_COPY.items():
21-
dest_dir = os.path.join(PICA_PKG_DIR, dest_subdir)
22-
if not os.path.exists(dest_dir):
23-
os.makedirs(dest_dir)
24-
25-
for file_path in files:
26-
if os.path.exists(file_path):
27-
shutil.copy(file_path, dest_dir)
28-
20+
class build_py(build_py_orig):
21+
"""
22+
Custom build command to copy data files into the package source tree.
23+
"""
24+
def run(self):
25+
# First, copy the files
26+
print("--- Custom build_py: Copying data files ---")
27+
for dest_subdir, files in DATA_FILES_TO_COPY.items():
28+
dest_dir = os.path.join(PICA_PKG_DIR, dest_subdir)
29+
if not os.path.exists(dest_dir):
30+
print(f"Creating directory: {dest_dir}")
31+
os.makedirs(dest_dir)
32+
33+
for file_path in files:
34+
if os.path.exists(file_path):
35+
print(f"Copying {file_path} to {dest_dir}")
36+
shutil.copy(file_path, dest_dir)
37+
else:
38+
print(f"WARNING: File not found, cannot copy: {file_path}")
39+
40+
# Then run the original build_py command
41+
print("--- Custom build_py: Running original build command ---")
42+
build_py_orig.run(self)
2943

30-
setup()
44+
setup(
45+
cmdclass={'build_py': build_py}
46+
)

0 commit comments

Comments
 (0)