Example #1
0
def add_eos_mission(file_paths, subject, project_path, wait=True):
    rel_paths = []
    for path in file_paths:
        rel_paths.append(version.updater.get_rel_path(path, project_path))

    if wait:
        time.sleep(len(file_paths) * 5)
    eos.add_eos_mission(module=eos.MODULE_BOCAI_HOME, file_relative_paths=rel_paths, subject=subject,
                        executors=[authUtil.get_user_name()], middle_path='/html', filePathsAbs=file_paths,
                        project_path=project_path)
Example #2
0
def postLegos(body, url):
    logging.info("legos save module...")
    headers = {
        'Connection': 'keep-alive',
        'pragma': 'no-cache',
        'Origin': 'http://legos.cm.com',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Cookie': 'oaname=' + authUtil.get_user_name()
    }
    conn = httplib.HTTPConnection("legos.cm.com")
    conn.request("POST", url, urllib.urlencode(body), headers)
    response = conn.getresponse()
    headers = response.getheaders()
    text = response.read()
    conn.close()
    return headers, text, response
Example #3
0
def postLegos(body, url):
    logging.info("legos save module...")
    headers = {
        'Connection': 'keep-alive',
        'pragma': 'no-cache',
        'Origin': 'http://legos.cm.com',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Cookie': 'oaname=' + authUtil.get_user_name()
    }
    conn = httplib.HTTPConnection("legos.cm.com")
    conn.request("POST", url, urllib.urlencode(body), headers)
    response = conn.getresponse()
    headers = response.getheaders()
    text = response.read()
    conn.close()
    return headers, text, response
Example #4
0
File: eos.py Project: jinker/tools
        subject = options.subject
        middlePath = '/web_app'
    elif options_type == 'pathFromInputPhp':
        logging.info(
            "Please input file relative path(multiple split by semicolon): \n")
        filePaths = inputUtil.raw_input_multi_line()

        subject = raw_input("Please input subject: \n").replace("\\", "/")
        middlePath = '/web_app'
    else:
        logging.info(
            "Please input file relative path(multiple split by semicolon): \n")
        filePaths = inputUtil.raw_input_multi_line()
        subject = raw_input("Please input subject: \n").replace("\\", "/")
        module = raw_input("Please input module: \n")

    paths = []
    for fileRelPath in filePaths:
        paths.append(fileRelPath.replace("\\", "/"))

    subject = subject.replace("\\", "/")

    add_eos_mission(module=module,
                    file_relative_paths=paths,
                    subject=subject,
                    executors=[authUtil.get_user_name()],
                    middle_path=middlePath,
                    begin=begin,
                    end=end,
                    filePathsAbs=filePathsAbs)
Example #5
0
    elif options_type == 'pathFromInput':
        logging.info("Please input file relative path(multiple split by semicolon): \n")
        filePaths = inputUtil.raw_input_multi_line()

        subject = raw_input("Please input subject: \n").replace("\\", "/")
        middlePath = '/html'
    elif options_type == 'pathFromCmdPhp':
        filePaths = options.fileRelativePaths
        subject = options.subject
        middlePath = '/web_app'
    elif options_type == 'pathFromInputPhp':
        logging.info("Please input file relative path(multiple split by semicolon): \n")
        filePaths = inputUtil.raw_input_multi_line()

        subject = raw_input("Please input subject: \n").replace("\\", "/")
        middlePath = '/web_app'
    else:
        logging.info("Please input file relative path(multiple split by semicolon): \n")
        filePaths = inputUtil.raw_input_multi_line()
        subject = raw_input("Please input subject: \n").replace("\\", "/")
        module = raw_input("Please input module: \n")

    paths = []
    for fileRelPath in filePaths:
        paths.append(fileRelPath.replace("\\", "/"))

    subject = subject.replace("\\", "/")

    add_eos_mission(module=module, file_relative_paths=paths, subject=subject, executors=[authUtil.get_user_name()],
                    middle_path=middlePath, begin=begin, end=end, filePathsAbs=filePathsAbs)