HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/local/qcloud/monitor/barad/comm/constant.py
import os
import sys

#queue define
QUEUE_TO_DISPATCHER = 0x01
QUEUE_TO_EXECUTOR = 0x02

PLUGIN_CONFIG_PATH = None 
COMMON_CONFIG_PATH = None

BIND_MODE_TCP = 0
BIND_MODE_UDP = 1
BIND_MODE_UNIX = 2

class ErrorCode(object):
    SUCC = 0x0
    MSG_TYPE_ERROR = 1000
    REQUEST_DECODE_ERROR = 1001
    HTTP_SEND_ERROR = 1002
    HTTP_RESPONSE_ERROR = 1003
    QUEUE_FULL_ERROR = 1004
    pass

#addtional path
def add_path():
    additional_path = [
                   "/../",
                   "/../comm/",
                   "/../plugin/base/",
                   "/../lib/",
                   "/../plugin/dispatcher/",
                   "/../plugin/collector/"
                   ]
    base_path = os.path.dirname(__file__) if __name__ != '__main__' else os.getcwd()
    for path in additional_path:
        ab_path = os.path.abspath(base_path + path)
        if ab_path not in sys.path:
            '''
                use our own lib first, then the system
            '''
            if path == "/../lib/":
                sys.path.insert(0, ab_path)
            else:
                sys.path.append(ab_path)
    
    global PLUGIN_CONFIG_PATH
    PLUGIN_CONFIG_PATH = os.path.abspath(base_path + '/../etc/plugin.ini')
    global COMMON_CONFIG_PATH
    COMMON_CONFIG_PATH = os.path.abspath(base_path + '/../etc/config.ini')
    global PLUGIN_REGION_PATH
    PLUGIN_REGION_PATH = os.path.abspath(base_path + '/../etc/region.json')

add_path()