Skip to content

Commit

Permalink
dojson: fix parentheses with spaces
Browse files Browse the repository at this point in the history
* Closes rero/rero-ils#3033.

Co-Authored-by: Peter Weber <[email protected]>
  • Loading branch information
rerowep committed Aug 4, 2022
1 parent 6114715 commit 7ff3569
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion rero_mef/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def ordert_data(data):
f' new:\t{json.dumps(data, sort_keys=True)}')
if output:
file_diff.write(data)
del(compaire_data[pid])
del (compaire_data[pid])
else:
if verbose:
click.echo(f'NEW :\t{json.dumps(data, sort_keys=True)}')
Expand Down
32 changes: 16 additions & 16 deletions rero_mef/marctojson/do_idref_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ def trans_idref_preferred_name(self):
tag_grouping = [
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
}
Expand Down Expand Up @@ -354,15 +354,15 @@ def trans_idref_authorized_access_point(self):
tag_grouping = [
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
},
{
'subtags': 'def',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ' ; '
}
Expand Down Expand Up @@ -402,8 +402,8 @@ def trans_idref_variant_name(self):
tag_grouping = [
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
}
Expand Down Expand Up @@ -434,15 +434,15 @@ def trans_idref_variant_access_point(self):
tag_grouping = [
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
},
{
'subtags': 'def',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ' ; '
}
Expand All @@ -466,15 +466,15 @@ def trans_idref_parallel_access_point(self):
tag_grouping = [
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
},
{
'subtags': 'def',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ' ; '
}
Expand Down
2 changes: 1 addition & 1 deletion rero_mef/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ def write_link_json(
agent_pid = viaf_pid
add_schema(json_dump, 'viaf')
json_dump['pid'] = agent_pid
del(json_dump['viaf_pid'])
del (json_dump['viaf_pid'])
# only save VIAF data with used pids
write_to_file = write_to_file_viaf if agent == 'viaf' else True
if write_to_file:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/agents/test_agent_idref_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def test_idref_parallel_access_point():
trans = trans_prep('idref', xml_part_to_add)
trans.trans_idref_parallel_access_point()
assert trans.json == {
'parallel_access_point': ['Paul. VI ( pape ) ( 1897-1978 )']
'parallel_access_point': ['Paul. VI (pape) (1897-1978)']
}


Expand Down
8 changes: 4 additions & 4 deletions tests/unit/agents/test_idref_contributions_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ def test_idref_authorized_access_point():
trans = trans_prep('idref', xml_part_to_add)
trans.trans_idref_authorized_access_point()
assert trans.json == {
'authorized_access_point': 'Stift Alter Dom Sankt Pauli ( Münster in '
'Westfalen, Allemagne )',
'authorized_access_point': 'Stift Alter Dom Sankt Pauli (Münster in '
'Westfalen, Allemagne)',
'bf:Agent': 'bf:Organisation',
'conference': False,
}
Expand All @@ -521,8 +521,8 @@ def test_idref_authorized_access_point():
trans = trans_prep('idref', xml_part_to_add)
trans.trans_idref_authorized_access_point()
assert trans.json == {
'authorized_access_point': 'Stift Alter Dom Sankt Pauli ( Münster in '
'Westfalen, Allemagne )',
'authorized_access_point': 'Stift Alter Dom Sankt Pauli (Münster in '
'Westfalen, Allemagne)',
'bf:Agent': 'bf:Organisation',
'conference': True,
}
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/test_marctojson_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def test_build_string_list_from_fields():
tag_grouping=[
{
'subtags': 'c',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': ', '
},
{
'subtags': 'def',
'start': ' ( ',
'end': ' )',
'start': ' (',
'end': ')',
'delimiter': '',
'subdelimiter': '; '
}
Expand All @@ -80,6 +80,6 @@ def test_build_string_list_from_fields():
assert data == [
'Place of public./distr.'
'. Address/publisher/dist.'
' ( Name of publisher/dist. )'
' ( Date; Place; Address )'
' (Name of publisher/dist.)'
' (Date; Place; Address)'
]

0 comments on commit 7ff3569

Please sign in to comment.