Skip to content

Commit

Permalink
Merge pull request #206 from cve-search/actions/black
Browse files Browse the repository at this point in the history
Format Python code with psf/black push
  • Loading branch information
P-T-I authored Nov 21, 2023
2 parents b059504 + 56954ad commit e5feef2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CveXplore/database/maintenance/DownloadHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def chunk_list(self, lst: list, number: int) -> list:
Yield successive n-sized chunks from lst.
"""
for i in range(0, len(lst), number):
yield lst[i: i + number]
yield lst[i : i + number]

def _db_bulk_writer(self, batch: list):
"""
Expand Down
12 changes: 9 additions & 3 deletions CveXplore/database/maintenance/main_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def update(self, update_source: str | list = None):
self.datasource.set_handlers_for_collections()

self.logger.info(f"Database update complete!")
self.logger.info(f"Update Total duration: {timedelta(seconds=time.time() - start_time)}")
self.logger.info(
f"Update Total duration: {timedelta(seconds=time.time() - start_time)}"
)

def populate(self, populate_source: str | list = None):
"""
Expand Down Expand Up @@ -159,7 +161,9 @@ def populate(self, populate_source: str | list = None):
self.datasource.set_handlers_for_collections()

self.logger.info(f"Database population complete!")
self.logger.info(f"Populate total duration: {timedelta(seconds=time.time() - start_time)}")
self.logger.info(
f"Populate total duration: {timedelta(seconds=time.time() - start_time)}"
)

def initialize(self):
"""
Expand All @@ -183,4 +187,6 @@ def initialize(self):
self.update()

self.logger.info(f"Database initialization complete!")
self.logger.info(f"Initialization total duration: {timedelta(seconds=time.time() - start_time)}")
self.logger.info(
f"Initialization total duration: {timedelta(seconds=time.time() - start_time)}"
)

0 comments on commit e5feef2

Please sign in to comment.