Example #1
0
def form(form_id, label, title):
    trel = Trello()
    conf = Confluence()
    """
    makes form
    options is a dict?
    possible dec num of params?
    """
    # headers: is label neccesary?
    form = '<form id="{}">'.format(form_id)
    label = '<label for="{}">{}</label>'.format(label, title)

    # generalize below using "for options in options_list"
    resp = trel.get_a_on_b(a='lists', b='boards', b_id=board_id)
    lists = { l['name'] : l['id'] for l in resp }
    html += select('trello', 'trelloList', lists)

    spaces = conf.get_spaces()
    html += select('confluence', 'confSpace', spaces)
    html += button('submit', 'mod-primary', 'Create Page!')

    # close form
    html += '</form>'

    html += '<script src="{}"></script>'.format('./js/modal.js')
    
    pprint(html)
    return html
Example #2
0
def main():
    args = parse_args()

    client = NotionClient(token_v2=os.environ.get("NOTION_TOKEN"))

    parent_page = client.get_block(args.notion_page)

    confluence = Confluence(
        args.confluence_url,
        HTTPBasicAuth(
            os.environ.get("CONFLUENCE_API_USERNAME"),
            os.environ.get("CONFLUENCE_API_TOKEN"),
        ),
    )

    exporter = Confluence2Notion(confluence, parent_page)
    with concurrent.futures.ThreadPoolExecutor(
            max_workers=args.concurrency) as executor:
        executor.map(exporter.write_space, confluence.get_spaces())