# Path: FabLabKasse/shopping/backend/abstract.py
# def float_to_decimal(number, digits):
#     """
#     convert float to decimal with rounding and strict error tolerances
# 
#     If the given number cannot be represented as decimal with an error
#     within 1/1000 of the last digit, :exc:`ValueError` is raised.
# 
#     :param number: a float that is nearly equal to a decimal number
#     :type number: float | Decimal
#     :param digits: number of decimal places of the resulting value (max. 9)
#     :type digits: int
# 
#     :raise: ValueError
# 
#     >>> float_to_decimal(1.424, 3)
#     Decimal('1.424')
#     >>> float_to_decimal(0.7, 1)
#     Decimal('0.7')
#     """
# 
#     # conversion is guaranteed to be accurate at 1e12 for 0 digits
#     # larger values are maybe not correctly represented in a float, so we are careful here
#     assert isinstance(digits, int)
#     assert 0 <= digits < 10, "invalid number of digits"
#     result = Decimal(int(round(number * (10 ** digits)))) / (10 ** digits)
#     if not abs(number) < 10 ** (10 + digits):
#         raise ValueError("cannot precisely convert such a large float to Decimal")
#     if not abs(float(result) - float(number)) < (10 ** -(digits + 3)):
#         raise ValueError("attempted inaccurate conversion from {0} to {1}".format(repr(number), repr(result)))
#     return result
# 
# 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 codecs
import logging
import sqlite3
from PyQt4 import QtCore, Qt
from decimal import Decimal
from datetime import datetime
from faucardStates import Status, Info
from MagPosLog import MagPosLog
from ..shopping.backend.abstract import float_to_decimal
    from magpos import magpos, codes
    from dinterface import magpos, codes
from FabLabKasse import scriptHelper
from ConfigParser import ConfigParser
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#




try:                    # Test if interface is available
except ImportError as e:     # Load Dummy otherwise
    print e




# Path: FabLabKasse/shopping/backend/abstract.py
# def float_to_decimal(number, digits):
#     """
#     convert float to decimal with rounding and strict error tolerances
# 
#     If the given number cannot be represented as decimal with an error
#     within 1/1000 of the last digit, :exc:`ValueError` is raised.
# 
#     :param number: a float that is nearly equal to a decimal number
#     :type number: float | Decimal
#     :param digits: number of decimal places of the resulting value (max. 9)
#     :type digits: int
# 
#     :raise: ValueError
# 
#     >>> float_to_decimal(1.424, 3)
#     Decimal('1.424')
#     >>> float_to_decimal(0.7, 1)
#     Decimal('0.7')
#     """
# 
#     # conversion is guaranteed to be accurate at 1e12 for 0 digits
#     # larger values are maybe not correctly represented in a float, so we are careful here
#     assert isinstance(digits, int)
#     assert 0 <= digits < 10, "invalid number of digits"
#     result = Decimal(int(round(number * (10 ** digits)))) / (10 ** digits)
#     if not abs(number) < 10 ** (10 + digits):
#         raise ValueError("cannot precisely convert such a large float to Decimal")
#     if not abs(float(result) - float(number)) < (10 ** -(digits + 3)):
#         raise ValueError("attempted inaccurate conversion from {0} to {1}".format(repr(number), repr(result)))
#     return result
# 
# 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: FabLabKasse/faucardPayment/FAUcardPaymentThread.py
import codecs
import logging
import sqlite3
from PyQt4 import QtCore, Qt
from decimal import Decimal
from datetime import datetime
from faucardStates import Status, Info
from MagPosLog import MagPosLog
from ..shopping.backend.abstract import float_to_decimal
    from magpos import magpos, codes
    from dinterface import magpos, codes
from FabLabKasse import scriptHelper
from ConfigParser import ConfigParser

#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#




try:                    # Test if interface is available
except ImportError as e:     # Load Dummy otherwise
    print e




class FAUcardThread(QtCore.QObject):