# Path: FabLabKasse/scriptHelper.py
# def setupLogging(logfile):
# def setupSigInt():
#     def sigint(num, frame):
# def setupGraphicalExceptHook():
#     def myNewExceptionHook(exctype, value, tb):
# def getConfig(path="./"):
# def getDB():
#     def __init__(self, name):
# class FileLock(object):


import os
import sys
import subprocess
import time
import shutil
from FabLabKasse import scriptHelper
        return True
    except OSError:
        return False


def main():
    SHUTDOWN_LOCKFILE = "/tmp/fablabkasse-shutdown"
    while file_exists(SHUTDOWN_LOCKFILE):
        # This is a workaround for bug https://github.com/spanezz/nodm/issues/5 in the nodm display manager.
        # The lockfile must be in /tmp and not in /run/user because is cleared early during shutdown.
        # This is not a security issue because we don't change the contents of that file, we only touch it.
        # If another user creates that file, this blocks FabLabKasse but is harmless otherwise.
        print("Waiting for system to finish shutdown. Lockfile {} still exists.".format(SHUTDOWN_LOCKFILE))
        time.sleep(1)
    currentDir = os.path.dirname(__file__) + "/"
    os.chdir(currentDir)
    currentDir = os.getcwd() + "/"
    os.chdir(currentDir + "/FabLabKasse/")

    if "--example" in sys.argv:
        # load example config
        # test that there is no config.ini yet
        if file_exists("config.ini"):
            print("Warning: Configuration FabLabKasse/config.ini already exists, will not overwrite it.")
            if "--only-load-config" not in sys.argv:
                print("You can just start run.py without the --example argument to make this message disappear.")
                time.sleep(2)
        else:
            print("loading example configuration file. edit FabLabKasse/config.ini to change. You do not need the --example parameter later.")
            shutil.copyfile("config.ini.example", "config.ini")

# Path: FabLabKasse/scriptHelper.py
# def setupLogging(logfile):
# def setupSigInt():
#     def sigint(num, frame):
# def setupGraphicalExceptHook():
#     def myNewExceptionHook(exctype, value, tb):
# def getConfig(path="./"):
# def getDB():
#     def __init__(self, name):
# class FileLock(object):


# Path: run.py
import os
import sys
import subprocess
import time
import shutil
from FabLabKasse import scriptHelper

        return True
    except OSError:
        return False


def main():
    SHUTDOWN_LOCKFILE = "/tmp/fablabkasse-shutdown"
    while file_exists(SHUTDOWN_LOCKFILE):
        # This is a workaround for bug https://github.com/spanezz/nodm/issues/5 in the nodm display manager.
        # The lockfile must be in /tmp and not in /run/user because is cleared early during shutdown.
        # This is not a security issue because we don't change the contents of that file, we only touch it.
        # If another user creates that file, this blocks FabLabKasse but is harmless otherwise.
        print("Waiting for system to finish shutdown. Lockfile {} still exists.".format(SHUTDOWN_LOCKFILE))
        time.sleep(1)
    currentDir = os.path.dirname(__file__) + "/"
    os.chdir(currentDir)
    currentDir = os.getcwd() + "/"
    os.chdir(currentDir + "/FabLabKasse/")

    if "--example" in sys.argv:
        # load example config
        # test that there is no config.ini yet
        if file_exists("config.ini"):
            print("Warning: Configuration FabLabKasse/config.ini already exists, will not overwrite it.")
            if "--only-load-config" not in sys.argv:
                print("You can just start run.py without the --example argument to make this message disappear.")
                time.sleep(2)
        else:
            print("loading example configuration file. edit FabLabKasse/config.ini to change. You do not need the --example parameter later.")
            shutil.copyfile("config.ini.example", "config.ini")

    if "--only-load-config" in sys.argv: