Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_locations():
"""
As workspace has changed, locations also should be updated
If the user already has set a location, do not alter it
"""
# update logs location
if not Settings.log_location:
Settings.log_location = localize_path("logs")
# update database location
if not Settings.database_location:
Settings.database_location = localize_path("db", "instapy.db")
# update chromedriver location
if not Settings.chromedriver_location:
Settings.chromedriver_location = localize_path(
"assets", Settings.specific_chromedriver)
if (not Settings.chromedriver_location
or not path_exists(Settings.chromedriver_location)):
Settings.chromedriver_location = localize_path("assets",
"chromedriver")
def update_locations():
"""
As workspace has changed, locations also should be updated
If the user already has set a location, do not alter it
"""
# update logs location
if not Settings.log_location:
Settings.log_location = localize_path("logs")
# update database location
if not Settings.database_location:
Settings.database_location = localize_path("db", "instapy.db")
# update chromedriver location
if not Settings.chromedriver_location:
Settings.chromedriver_location = localize_path(
"assets", Settings.specific_chromedriver)
if (not Settings.chromedriver_location
or not path_exists(Settings.chromedriver_location)):
Settings.chromedriver_location = localize_path("assets",
"chromedriver")
# update logs location
if not Settings.log_location:
Settings.log_location = localize_path("logs")
# update database location
if not Settings.database_location:
Settings.database_location = localize_path("db", "instapy.db")
# update chromedriver location
if not Settings.chromedriver_location:
Settings.chromedriver_location = localize_path(
"assets", Settings.specific_chromedriver)
if (not Settings.chromedriver_location
or not path_exists(Settings.chromedriver_location)):
Settings.chromedriver_location = localize_path("assets",
"chromedriver")
As workspace has changed, locations also should be updated
If the user already has set a location, do not alter it
"""
# update logs location
if not Settings.log_location:
Settings.log_location = localize_path("logs")
# update database location
if not Settings.database_location:
Settings.database_location = localize_path("db", "instapy.db")
# update chromedriver location
if not Settings.chromedriver_location:
Settings.chromedriver_location = localize_path(
"assets", Settings.specific_chromedriver)
if (not Settings.chromedriver_location
or not path_exists(Settings.chromedriver_location)):
Settings.chromedriver_location = localize_path("assets",
"chromedriver")