Beispiel #1
0
    def info(message, *args):
        """Display an informative message, prefixed with the plug-in name.

        :param str message: the message to log
        :param list[*] args: arguments of the `message` format string
        """
        Console.info(message % args, prefix=MODULE)
Beispiel #2
0
    def info(message, *args):
        """Display an informative message, prefixed with the plug-in name.

        :param str message: the message to log
        :param list[*] args: arguments of the `message` format string
        """
        Console.info(message % args, prefix=MODULE)
Beispiel #3
0
    def info(self, message):
        """Display an informative message.

        :param str message: the message to display
        """
        Console.info(message, prefix=SonarScannerProperties.CONSOLE_NAME)
Beispiel #4
0
SCRIPT_NAME = 'server.py'

# Default port value
DEFAULT_PORT = 8080

# Determine script path and check is different of default value
script_path = DEFAULT_SCRIPT_PATH
#  TO DO : Add handling when path is given via --server-dir

if not os.path.exists(script_path):
    repo_msg = script_path + ' repository does not exist'
    Console.error(repo_msg, prefix=MODULE)

else:
    msg = 'load script from ' + script_path + ' repository'
    Console.info(msg, prefix=MODULE)

    # Build server script full path
    server_script_path = os.path.join(script_path, SCRIPT_NAME)
    if os.path.exists(server_script_path):
        if os.path.isfile(server_script_path):
            try:
                port = DEFAULT_PORT
                if GNAThub.port():
                    port = GNAThub.port()
                msg_exec = 'execute ' + SCRIPT_NAME
                msg_exec = msg_exec + ' (PORT NUMBER: ' + str(port) + ')'
                Console.info(msg_exec, prefix=MODULE)
                html_dir = os.path.join(GNAThub.root(), 'html-report')
                os.environ["FLASK_RUN_PORT"] = str(port)
                os.environ["WEBUI_HTML_FOLDER"] = html_dir
Beispiel #5
0
SCRIPT_NAME = 'server.py'

# Default port value
DEFAULT_PORT = 8080

# Determine script path and check is different of default value
script_path = DEFAULT_SCRIPT_PATH
#  TO DO : Add handling when path is given via --server-dir

if not os.path.exists(script_path):
    repo_msg = script_path + ' repository does not exist'
    Console.error(repo_msg, prefix=MODULE)

else:
    msg = 'load script from ' + script_path + ' repository'
    Console.info(msg, prefix=MODULE)

    # Build server script full path
    server_script_path = os.path.join(script_path, SCRIPT_NAME)
    if os.path.exists(server_script_path):
        if os.path.isfile(server_script_path):
            try:
                port = DEFAULT_PORT
                if GNAThub.port():
                    port = GNAThub.port()

                msg_exec = 'execute ' + SCRIPT_NAME
                msg_exec = msg_exec + ' (PORT NUMBER: ' + str(port) + ')'
                Console.info(msg_exec, prefix=MODULE)
                execfile(server_script_path)
            except Exception as why: