mirror of
https://github.com/Xevion/phototag.git
synced 2026-01-31 08:25:08 -06:00
24 lines
573 B
Python
24 lines
573 B
Python
import os
|
|
import sys
|
|
import configparser
|
|
|
|
SCRIPT_ROOT = os.path.dirname(os.path.realpath(__file__))
|
|
CONFIG_DIR = os.path.join(SCRIPT_ROOT, "config")
|
|
CONFIG_PATH = os.path.join(CONFIG_DIR, "config.ini")
|
|
config = configparser.ConfigParser()
|
|
|
|
|
|
def quicksave():
|
|
with open(CONFIG_PATH, "w+") as file:
|
|
config.write(file)
|
|
|
|
|
|
if not os.path.exists(CONFIG_PATH):
|
|
if not os.path.exists(CONFIG_DIR):
|
|
os.makedirs(CONFIG_DIR)
|
|
config["google"] = {"credentials": ""}
|
|
quicksave()
|
|
else:
|
|
with open(CONFIG_PATH, "r") as file:
|
|
config.read_file(file)
|