Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverting usfm changes #737

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/crud/files_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import usfm_grammar
from lxml import etree

from dependencies import log

def extract_dict_chapter(converted_content:dict, chapter:int) -> dict:
Expand Down Expand Up @@ -80,4 +79,3 @@ def parse_with_usfm_grammar(input_usfm, output_format=usfm_grammar.Format.JSON,
output_content = extract_usx_chapter(output_content, chapter)
output_content = etree.tostring(output_content, encoding='unicode', pretty_print=True) #pylint: disable=I1101
return output_content

2 changes: 1 addition & 1 deletion app/routers/filehandling_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
get_user_or_none
from custom_exceptions import NotAvailableException, GenericException


router = APIRouter()
#pylint: disable=too-many-arguments,unused-argument

Expand Down Expand Up @@ -69,4 +70,3 @@ async def parse_uploaded_usfm(request:Request,
log.debug("output_format: %s, content_filter: %s", output_format, content_filter)
return files_crud.parse_with_usfm_grammar(
input_usfm.USFM, output_format, content_filter, chapter)

2 changes: 1 addition & 1 deletion app/test/test_file_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def test_usfm_to_json():
found_verse = True
break
assert found_verse


for usfm_input in gospel_books_data:
resp = client.put(f"{UNIT_URL}usfm/to/json?content_filter=scripture-paragraph",
Expand Down Expand Up @@ -102,4 +103,3 @@ def test_usfm_to_usx():
print(resp.json())
assert resp.json().startswith("<usx")
assert resp.json().strip().endswith("</usx>")

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

SQLAlchemy==1.4.41
python-gitlab==3.9.0
fastapi==0.101.1
Expand Down
Loading