Skip to content

Commit 26ef57c

Browse files
committed
copier update
1 parent bf2f644 commit 26ef57c

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: 36a217c
1+
_commit: a7a3421
22
_src_path: https://github.com/orgpedia/template.mahdept2024.git
33
dept_name: Planning Department
44
org_code: mahplan2024

flow/writeTxt_/conf/cmaps/sakalmarathi.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,18 @@
226226
225: null
227227
226: null
228228
227: प्
229-
228: null
230-
229: null
229+
228: फ्
230+
229: ब्
231231
230: भ्
232-
231: null
233-
232: null
234-
233: null
235-
234: null
236-
235: व्
237-
236: null
232+
231: म्
233+
232: य्
234+
233: र्
235+
234: ल्
236+
235: व्
237+
236: श्
238238
237: ष्
239239
238: स्
240-
239: null
240+
239: ह्
241241
240: null
242242
241: null
243243
242: null
@@ -342,13 +342,13 @@
342342
341: null
343343
342: null
344344
343: ध़
345-
344: null
346-
345: null
347-
346: null
348-
347: null
345+
344: ऩ
346+
345: प़
347+
346: फ़
348+
347: ब़
349349
348: म़
350-
349: null
351-
350: null
350+
349: ऱ
351+
350: ल़
352352
351: व़
353353
352: null
354354
353: null

flow/writeTxt_/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export PYTHONPATH := $(ROOT_DIR)/../src:$(PYTHONPATH)
66
.PHONY: all
77

88
all:
9-
poetry run python src/writeTxt.py input output > logs/info.txt
9+
poetry run python src/writeTxt.py input output
1010

1111
%:
1212
poetry run python src/writeTxt.py input/$@.pdf output/$@.pdf.doc.json

import/src/build_documents.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,25 @@ def main():
4141
all_infos = json.loads(all_info_path.read_text())
4242
dept_infos = [i for i in all_infos if i["Department Name"] == DeptName]
4343

44+
for info in dept_infos:
45+
info['Unique Code'] = info['Unique Code'].replace('\u200d', '')
46+
4447
doc_infos = json.loads(doc_info_path.read_text()) if doc_info_path.exists() else []
4548
doc_set = set(i["Unique Code"] for i in doc_infos)
4649
doc_dir = doc_info_path.parent
4750

4851
new_infos = [i for i in dept_infos if i["Unique Code"] not in doc_set]
52+
if len(new_infos) != len(set(i["Unique Code"] for i in new_infos)):
53+
# removing duplicate infos, happens rarely.
54+
unique_infos, duplicate_codes, seen = [], [], set()
55+
for info in new_infos:
56+
if info['Unique Code'] not in seen:
57+
unique_infos.append(info)
58+
seen.add(info["Unique Code"])
59+
else:
60+
duplicate_codes.append(info["Unique Code"])
61+
print(f'Duplicates infos found: {",".join(duplicate_codes)}, keeping unique.')
62+
new_infos = unique_infos
4963

5064
for info in new_infos:
5165
doc_path = doc_dir / f"{info['Unique Code']}.pdf"

0 commit comments

Comments
 (0)