Skip to content

Commit

Permalink
fix invalid syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Jan 17, 2024
1 parent b37af47 commit b5d2db4
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions pygeodiff/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, libname=None):
def __del__(self):
self.shutdown()

def _lazy_load():
def _lazy_load(self):
if self.clib is None:
self.clib = GeoDiffLib(self.libname)

Expand All @@ -54,7 +54,7 @@ def set_logger_callback(self, callback):
When callback is None, no output is produced at all
Callback function has 2 arguments: (int) errorCode, (string) msg
"""
_lazy_load()
self._lazy_load()
return self.clib.set_logger_callback(self.context, callback)

def set_tables_to_skip(self, tables):
Expand All @@ -66,7 +66,7 @@ def set_tables_to_skip(self, tables):
If empty list is passed, skip tables list will be reset.
"""
_lazy_load()
self._lazy_load()
return self.clib.set_tables_to_skip(self.context, tables)

LevelError = 1
Expand All @@ -84,7 +84,7 @@ def set_maximum_logger_level(self, maxLevel):
maxLogLevel = 3 errors, warnings and infos are passed to logger callback
maxLogLevel = 4 errors, warnings, infos, debug messages are passed to logger callback
"""
_lazy_load()
self._lazy_load()
return self.clib.set_maximum_logger_level(self.context, maxLevel)

def drivers(self):
Expand All @@ -93,14 +93,14 @@ def drivers(self):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.drivers(self.context)

def driver_is_registered(self, name):
"""
Returns whether dataset with given name is registered (e.g. "sqlite" or "postgresql")
"""
_lazy_load()
self._lazy_load()
return self.clib.driver_is_registered(self.context, name)

def create_changeset(self, base, modified, changeset):
Expand All @@ -117,7 +117,7 @@ def create_changeset(self, base, modified, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.create_changeset(self.context, base, modified, changeset)

def invert_changeset(self, changeset, changeset_inv):
Expand All @@ -133,7 +133,7 @@ def invert_changeset(self, changeset, changeset_inv):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.invert_changeset(self.context, changeset, changeset_inv)

def rebase(self, base, modified_their, modified, conflict):
Expand All @@ -159,7 +159,7 @@ def rebase(self, base, modified_their, modified, conflict):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.rebase(self.context, base, modified_their, modified, conflict)

def create_rebased_changeset(
Expand All @@ -183,7 +183,7 @@ def create_rebased_changeset(
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.create_rebased_changeset(
self.context, base, modified, changeset_their, changeset, conflict
)
Expand All @@ -198,7 +198,7 @@ def apply_changeset(self, base, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.apply_changeset(self.context, base, changeset)

def list_changes(self, changeset, json):
Expand All @@ -209,7 +209,7 @@ def list_changes(self, changeset, json):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.list_changes(self.context, changeset, json)

def list_changes_summary(self, changeset, json):
Expand All @@ -220,7 +220,7 @@ def list_changes_summary(self, changeset, json):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.list_changes_summary(self.context, changeset, json)

def has_changes(self, changeset):
Expand All @@ -229,7 +229,7 @@ def has_changes(self, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.has_changes(self.context, changeset)

def changes_count(self, changeset):
Expand All @@ -238,7 +238,7 @@ def changes_count(self, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.changes_count(self.context, changeset)

def concat_changes(self, list_changesets, output_changeset):
Expand All @@ -252,7 +252,7 @@ def concat_changes(self, list_changesets, output_changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.concat_changes(self.context, list_changesets, output_changeset)

def make_copy(
Expand All @@ -276,7 +276,7 @@ def make_copy(
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.make_copy(
self.context,
driver_src,
Expand All @@ -297,7 +297,7 @@ def make_copy_sqlite(self, src, dst):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.make_copy_sqlite(self.context, src, dst)

def create_changeset_ex(self, driver, driver_info, base, modified, changeset):
Expand All @@ -310,7 +310,7 @@ def create_changeset_ex(self, driver, driver_info, base, modified, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.create_changeset_ex(
self.context, driver, driver_info, base, modified, changeset
)
Expand Down Expand Up @@ -344,7 +344,7 @@ def create_changeset_dr(
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.create_changeset_dr(
self.context,
driver_src,
Expand All @@ -366,7 +366,7 @@ def apply_changeset_ex(self, driver, driver_info, base, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.apply_changeset_ex(
self.context, driver, driver_info, base, changeset
)
Expand All @@ -387,7 +387,7 @@ def create_rebased_changeset_ex(
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.create_rebased_changeset_ex(
self.context,
driver,
Expand All @@ -406,7 +406,7 @@ def rebase_ex(self, driver, driver_info, base, modified, base2their, conflict_fi
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.rebase_ex(
self.context, driver, driver_info, base, modified, base2their, conflict_file
)
Expand All @@ -417,7 +417,7 @@ def dump_data(self, driver, driver_info, src, changeset):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.dump_data(self.context, driver, driver_info, src, changeset)

def schema(self, driver, driver_info, src, json):
Expand All @@ -426,28 +426,28 @@ def schema(self, driver, driver_info, src, json):
raises GeoDiffLibError on error
"""
_lazy_load()
self._lazy_load()
return self.clib.schema(self.context, driver, driver_info, src, json)

def read_changeset(self, changeset):
"""
Opens a changeset file and returns reader object or raises GeoDiffLibError on error.
"""
_lazy_load()
self._lazy_load()
return self.clib.read_changeset(self.context, changeset)

def version(self):
"""
geodiff version
"""
_lazy_load()
self._lazy_load()
return self.clib.version()

def create_wkb_from_gpkg_header(self, geometry):
"""
Extracts geometry in WKB format from the geometry encoded according to GeoPackage spec
"""
_lazy_load()
self._lazy_load()
return self.clib.create_wkb_from_gpkg_header(self.context, geometry)


Expand Down

0 comments on commit b5d2db4

Please sign in to comment.