Skip to content

Commit d7b1bc2

Browse files
committed
add copy_static_rdf_files()
1 parent 3ebff59 commit d7b1bc2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

legal_tools/management/commands/publish.py

+24
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,26 @@ def copy_static_cc_legal_tools_files(self):
301301
os.path.join(destination, file_name),
302302
)
303303

304+
def copy_static_rdf_files(self):
305+
hostname = socket.gethostname()
306+
output_dir = self.output_dir
307+
LOG.info("Copying static rdf files")
308+
LOG.debug(f"{hostname}:{output_dir}")
309+
path = "rdf"
310+
source = os.path.join(
311+
settings.PROJECT_ROOT,
312+
"cc_legal_tools",
313+
"static",
314+
path,
315+
)
316+
destination = os.path.join(output_dir, path)
317+
os.makedirs(destination, exist_ok=True)
318+
for file_name in os.listdir(source):
319+
copyfile(
320+
os.path.join(source, file_name),
321+
os.path.join(destination, file_name),
322+
)
323+
304324
def write_rdf_meta(self):
305325
"""
306326
Generate the index.rdf, images.rdf and copies the rest.
@@ -326,6 +346,9 @@ def write_rdf_meta(self):
326346
# Write and Copy RDF/XML meta files
327347
if meta_file in ["jurisdictions.rdf", "selectors.rdf"]:
328348
continue
349+
elif meta_file in ["schema.rdf"]:
350+
# see copy_static_rdf_files()
351+
pass
329352
elif meta_file in ["index.rdf", "images.rdf"]:
330353
LOG.info(f"Writing {meta_file}")
331354
save_images_and_index_rdf(dest_dir, meta_file)
@@ -549,6 +572,7 @@ def distill_and_copy(self):
549572
self.write_robots_txt()
550573
self.copy_static_wp_content_files()
551574
self.copy_static_cc_legal_tools_files()
575+
self.copy_static_rdf_files()
552576
self.write_rdf_meta()
553577
self.copy_legal_code_plaintext()
554578
self.write_dev_index()

0 commit comments

Comments
 (0)