Пример #1
0
    def __init__(self, path, config):
        self.path = path
        self.config = config
        self.stdin_encoding = get_console_encoding(sys.stdin.encoding)
        self.lang = None
        # We will create a timestamp so that the setup will be completed in a specific interval
        self.timestamp = time()

        # TODO: probably unneeded
        self.yes = "yes"
        self.no = "no"
Пример #2
0
 def __init__(self, path, config):
     self.path = path
     self.config = config
     self.stdin_encoding = get_console_encoding(sys.stdin.encoding)
Пример #3
0
 def __init__(self, path, config):
     self.path = path
     self.config = config
     self.stdin_encoding = get_console_encoding(sys.stdin.encoding)
Пример #4
0
    smart_bytes,
    smart_text,
)
from module.utils import (
    formatSize,
    freeSpace,
    get_console_encoding,
)
from module.web.ServerThread import WebServer


CURRENT_VERSION = '0.4.9'

# TODO: Why is this required? Is it also required on Python 3?
if six.PY2:
    enc = get_console_encoding(sys.stdout.encoding)
    sys.stdout = getwriter(enc)(sys.stdout, errors='replace')

# TODO List
# - configurable auth system ldap/mysql
# - cron job like sheduler


def exceptHook(exc_type, exc_value, exc_traceback):
    logger = logging.getLogger("log")
    if issubclass(exc_type, KeyboardInterrupt):
        sys.__excepthook__(exc_type, exc_value, exc_traceback)
        return

    logger.error("<<< UNCAUGHT EXCEPTION >>>", exc_info=(exc_type, exc_value, exc_traceback))