How to use the domdiv.main function in domdiv

To help you get started, we’ve selected a few domdiv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sumpfork / dominiontabs / tests / carddb_tests.py View on Github external
def test_expansion_description_card_order():
    # test that the expansions cards lists cards
    # in alphabetical order, like they are printed,
    # and that accents don't matter
    options = main.parse_opts(
        [
            "--expansions",
            "Hinterlands",
            "--expansion-dividers",
            "--language",
            "fr",
            "--only-type-any",
            "Expansion",
        ]
    )
    options = main.clean_opts(options)
    options.data_path = "."
    cards = main.read_card_data(options)
    cards = main.filter_sort_cards(cards, options)
    card_names = [c.strip() for c in cards[0].description.split("|")]
    # The 26 french card names of the Hinterlands expansion should be sorted as if no accent
github sumpfork / dominiontabs / tests / layout_tests.py View on Github external
def test_horizontal():
    # should be the default
    options = main.parse_opts([])
    assert options.orientation == "horizontal"
    main.calculate_layout(options)
    assert options.numDividersHorizontal == 2
    assert options.numDividersVertical == 3
    assert options.dividerWidth == 9.1 * cm
    assert options.labelHeight == 0.9 * cm
    assert options.dividerHeight == 5.9 * cm + options.labelHeight
github sumpfork / dominiontabs / tests / layout_tests.py View on Github external
def test_set_icon():
    options = main.parse_opts([])
    options = main.clean_opts(options)
    assert options.set_icon == ["tab"]

    options = main.parse_opts(["--set-icon=tab"])
    options = main.clean_opts(options)
    assert options.set_icon == ["tab"]

    options = main.parse_opts(["--set-icon=body-top"])
    options = main.clean_opts(options)
    assert options.set_icon == ["body-top"]

    options = main.parse_opts(["--set-icon=hide"])
    options = main.clean_opts(options)
    assert options.set_icon == ["hide"]

    options = main.parse_opts(["--set-icon=tab", "--set-icon=body-top"])
    options = main.clean_opts(options)
    assert set(options.set_icon) == {"tab", "body-top"}
github sumpfork / dominiontabs / tests / carddb_tests.py View on Github external
def test_cardread():
    num_cards_expected = 647

    options = main.parse_opts([])
    options.data_path = "."
    cards = main.read_card_data(options)
    assert len(cards) == num_cards_expected
    valid_cardsets = {
        u"base",
        u"dominion1stEdition",
        u"dominion2ndEdition",
        u"dominion2ndEditionUpgrade",
        u"intrigue1stEdition",
        u"intrigue2ndEdition",
        u"intrigue2ndEditionUpgrade",
        u"seaside",
        u"alchemy",
        u"prosperity",
        u"cornucopia extras",
        u"cornucopia",
github sumpfork / dominiontabs / do_release.py View on Github external
def doit(args, main):
    args = args + " --outfile " + prefix + main + postfix
    args = args.split()
    fname = args[-1]
    print(args)
    print(":::Generating " + fname)
    options = domdiv.main.parse_opts(args)
    options = domdiv.main.clean_opts(options)
    domdiv.main.generate(options)
    return fname
github sumpfork / dominiontabs / do_release.py View on Github external
def doit(args, main):
    args = args + " --outfile " + prefix + main + postfix
    args = args.split()
    fname = args[-1]
    print(args)
    print(":::Generating " + fname)
    options = domdiv.main.parse_opts(args)
    options = domdiv.main.clean_opts(options)
    domdiv.main.generate(options)
    return fname
github sumpfork / dominiontabs / do_release.py View on Github external
def doit(args, main):
    args = args + " --outfile " + prefix + main + postfix
    args = args.split()
    fname = args[-1]
    print(args)
    print(":::Generating " + fname)
    options = domdiv.main.parse_opts(args)
    options = domdiv.main.clean_opts(options)
    domdiv.main.generate(options)
    return fname