fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8bb87b3
)
match element ids
author
Radek Czajka
<rczajka@rczajka.pl>
Wed, 12 Nov 2025 11:14:00 +0000
(12:14 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Wed, 12 Nov 2025 11:14:00 +0000
(12:14 +0100)
src/catalogue/api/tojson.py
patch
|
blob
|
history
diff --git
a/src/catalogue/api/tojson.py
b/src/catalogue/api/tojson.py
index
1fe055c
..
f28351f
100644
(file)
--- a/
src/catalogue/api/tojson.py
+++ b/
src/catalogue/api/tojson.py
@@
-97,7
+97,17
@@
id_prefixes = {
'pr': 'fn',
'pt': 'fn',
'ptrad': 'fn',
'pr': 'fn',
'pt': 'fn',
'ptrad': 'fn',
- }
+ 'wers': 'f',
+ 'wers_wciety': 'f',
+ 'wers_cd': 'f',
+ 'wers_akap': 'f',
+ 'zastepnik_wersu': 'f',
+ 'wers_do_prawej': 'f',
+ 'wers_srodek': 'f',
+ 'akap': 'f',
+ 'akap_cd': 'f',
+ 'akap_dialog': 'f',
+}
#tree = etree.parse(argv[1])
#tree = etree.parse(argv[1])
@@
-133,7
+143,7
@@
def toj(elem, S):
if 'dlugi_cytat' not in S['stack'] and 'poezja_cyt' not in S['stack']:
S['vindex'] += 1
output['visibleNumber'] = S['vindex']
if 'dlugi_cytat' not in S['stack'] and 'poezja_cyt' not in S['stack']:
S['vindex'] += 1
output['visibleNumber'] = S['vindex']
- id_prefix = id_prefixes.get(tag, 'i')
+ id_prefix = id_prefixes.get(
elem.
tag, 'i')
S['id'][id_prefix] += 1
output['id'] = id_prefix + str(S['id'][id_prefix])
if attrs:
S['id'][id_prefix] += 1
output['id'] = id_prefix + str(S['id'][id_prefix])
if attrs: