# Zeiterfassung
# Benutzerfunktionen

import os
import datetime

from definitions import *

# Benutzer anhand Verzeichnisse auflisten
def list_users():
    users = [d for d in os.listdir(userfolder) if os.path.isdir(os.path.join(userfolder, d))]
    return users

# Dateinamen bestimmen
def determine_filename(user, type="stamping"):
    if type == "stamping":
        year = str(datetime.datetime.now().year)
        month = str(datetime.datetime.now().month)
        completepath = userfolder + "/" + user + "/" + year + "-" + month + ".txt"
        return completepath

    elif type == "settings":
        completepath = userfolder +"/" + user + "/" + usersettingsfilename
        return completepath
    elif type == "photo":
        completepath = userfolder + "/" + user + "/" + photofilename
        return completepath
