Skip to content

Commit

Permalink
fix deprecated calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Caha committed Dec 13, 2023
1 parent c36e65c commit 6534728
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions media_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _quote_identifier(identifier):
def _get_project_version():
""" Returns the current version of the project """
mp = MerginProject(config.project_working_dir)
return mp.metadata["version"]
return mp.version()


def _check_has_working_dir():
Expand Down Expand Up @@ -97,13 +97,12 @@ def mc_pull(mc):
_check_pending_changes()

mp = MerginProject(config.project_working_dir)
project_full_name = f'{mp.metadata["namespace"]}/{mp.metadata["name"]}'
local_version = mp.metadata["version"]
local_version = mp.version()

try:
project_info = mc.project_info(project_full_name, since=local_version)
projects = mc.get_projects_by_names([project_full_name])
server_version = projects[project_full_name]["version"]
project_info = mc.project_info(mp.project_full_name(), since=local_version)
projects = mc.get_projects_by_names([mp.project_full_name()])
server_version = projects[mp.project_full_name()]["version"]
except ClientError as e:
# this could be e.g. DNS error
raise MediaSyncError("Mergin client error: " + str(e))
Expand Down

0 comments on commit 6534728

Please sign in to comment.