diff --git a/setup.py b/setup.py index b1de944..5e0896a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='sysrev', - version='1.3.2', + version='1.3.4', description='get sysrev project data and use the sysrev api', long_description=long_description, long_description_content_type='text/markdown', # Specify the content type here diff --git a/sysrev/client.py b/sysrev/client.py index 22a5f40..ceda05f 100644 --- a/sysrev/client.py +++ b/sysrev/client.py @@ -28,7 +28,7 @@ def transform_label(self, label_type, label_value): class Synchronizer: - def create_sqlite_db(): + def create_sqlite_db(self): pathlib.Path(".sr").mkdir(exist_ok=True) conn = sqlite3.connect('.sr/sr.sqlite') c = conn.cursor() @@ -93,7 +93,12 @@ def create_sqlite_db(): conn.commit() conn.close() + # TODO - this could be made more efficient by checking sqlite state and updating the sysrev api def sync(self, client, project_id): + # check that db exists + if not pathlib.Path('.sr/sr.sqlite').exists(): + self.create_sqlite_db() + project_info = client.get_project_info(project_id) labels = client.get_labels(project_id)