Code review comment for lp:~om26er/ubuntu-weather-app/db_stab2

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

32 + db_dir = "~/.local/share/com.ubuntu.weather/Databases/"
33 + db_file = "34e1e542f2f083ff18f537b07a380071.sqlite"
34 + db_path = os.path.expanduser(db_dir + db_file)
35 +
36 + if not os.path.exists(db_path):
37 + subprocess.check_call([
38 + "mkdir",
39 + "-p",
        You need the module path
40 + "~/.local/share/com.ubuntu.weather/"])
41 + shutil.copytree("ubuntu_weather_app/databases/", db_dir)

Approximation...
db_dir = "~/.local/share/com.ubuntu.weather/Databases/"
db_file = "34e1e542f2f083ff18f537b07a380071.sqlite"
db_path = os.path.join(os.path.expanduser(db_dir, db_file))
if not os.path.exists(db_path):
    # it's what we want
    os.makedirs(db_dir)
    # you'll need the python module location
    shutil.copytree("ubuntu_weather_app/Databases/", db_dir)

review: Needs Fixing

« Back to merge proposal