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)
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))
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)
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
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)
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)
def get_config(path): return utils.read_file_json(path)
def read_schema(fp): try: return utils.read_file_json(fp) except: print("Could not read schema at " + fp)
def get_configuration(name): for cfg in utils.read_file_json(CONFIG_PATH): if cfg["name"] == name: return cfg return None
def get_config(path): config = utils.read_file_json(path) config["schemaDirectory"] = config["schemaDirectory"].replace('/',os.sep).replace('\\',os.sep) return config