def main():
    config = utils.read_file_json("./config.json")
    file_path = "{}gitlab-{}.json".format(utils.end_with(config["save-path"],"/"), config["gitlab"]["projId"])
    mapped_json = map_gl_to_trl(config, utils.read_file_json(file_path))
    migrate_issues(config, mapped_json)
    save_path = utils.end_with(config["save-path"],"/") + "gitlab-trello-{}.json".format(config["gitlab"]["projId"])
    utils.write_file_json(save_path, mapped_json)
Example #2
0
def main():
    config = utils.read_file_json('./config.json')
    export_data = utils.read_file_json(config['export'] + os.sep + 'export.json')
    target = 'glo'   # TODO: Make CLI

    if target == 'glo':
        Glo_Importer(config['glo']).import_boards(export_data)
    else:
        raise Exception("Unsupported target '{}'".format(target))
Example #3
0
def main():
    config = utils.read_file_json("./config.json")
    proj_url = utils.end_with(config["gitlab"]["url"],
                              "/") + config["gitlab"]["projId"] + "/"
    gitlab_json = get_gitlab_json(proj_url, config["gitlab"]["token"])
    save_path = utils.end_with(config["save-path"],
                               "/") + "gitlab-{}.json".format(
                                   config["gitlab"]["projId"])
    utils.write_file_json(save_path, gitlab_json)
Example #4
0
def append_configuration(new_data):
    if not path.exists(CONFIG_PATH):
        utils.log(
            "{} not found. Creating new config file...".format(CONFIG_PATH))
        utils.write_file_json(CONFIG_PATH, [])
    elif get_configuration(new_data["name"]):
        utils.log("ERROR: Configuration already exists by this name.")
        exit(1)
    utils.write_file_json(CONFIG_PATH,
                          utils.read_file_json(CONFIG_PATH) + [new_data])
    return new_data
Example #5
0
def main():
    exported = {}
    config = utils.read_file_json("./config.json")
    boards, out_path = config['boards'], config['export']
    target = 'trello'   # TODO: Make CLI

    if target == 'trello':
        exported = export_trello(config['trello'], boards, out_path)
    else:
        raise Exception("Unsupported target '{}'".format(target))
    
    utils.write_file_json("{}{}export.json".format(out_path, os.sep), exported)
Example #6
0
def main():
    config = utils.read_file_json("./config.json")
    creds = {
        "key": config["trello"]["apiKey"],
        "token": config["trello"]["token"]
    }
    board_url = utils.end_with(config["trello"]["url"],
                               "/") + "boards/" + config["trello"]["boardId"]
    trl_json = get_trl_json(board_url, creds)
    save_path = utils.end_with(config["save-path"],
                               "/") + "trello-{}.json".format(
                                   config["trello"]["boardId"])
    utils.write_file_json(save_path, trl_json)
Example #7
0
def get_config(path):
    return utils.read_file_json(path)
Example #8
0
def read_schema(fp):
    try:
        return utils.read_file_json(fp)
    except:
        print("Could not read schema at " + fp)
Example #9
0
def get_configuration(name):
    for cfg in utils.read_file_json(CONFIG_PATH):
        if cfg["name"] == name: return cfg
    return None
Example #10
0
def get_config(path):
    config = utils.read_file_json(path)
    config["schemaDirectory"] = config["schemaDirectory"].replace('/',os.sep).replace('\\',os.sep)
    return config