Skip to content
Merged
Changes from 2 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
22 changes: 10 additions & 12 deletions mergin/client_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
import tempfile
import concurrent.futures
import os
from pygeodiff import (
GeoDiff,
GeoDiffLibError,
GeoDiffLibConflictError,
GeoDiffLibUnsupportedChangeError,
GeoDiffLibVersionError,
)

try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use similar approach as with another files ...

from merginproject import pygeodiff ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

from .deps import pygeodiff
except (ImportError, ModuleNotFoundError):
import pygeodiff

from .common import UPLOAD_CHUNK_SIZE, ClientError
from .merginproject import MerginProject
Expand Down Expand Up @@ -338,12 +336,12 @@ def _geodiff_changes_count(mp: MerginProject, diff_rel_path: str):

diff_abs = mp.fpath_meta(diff_rel_path)
try:
return GeoDiff().changes_count(diff_abs)
return pygeodiff.GeoDiff().changes_count(diff_abs)
except (
GeoDiffLibError,
GeoDiffLibConflictError,
GeoDiffLibUnsupportedChangeError,
GeoDiffLibVersionError,
pygeodiff.GeoDiffLibError,
pygeodiff.GeoDiffLibConflictError,
pygeodiff.GeoDiffLibUnsupportedChangeError,
pygeodiff.GeoDiffLibVersionError,
FileNotFoundError,
):
return None
Expand Down