Code Duplication    Length = 27-27 lines in 2 locations

tcod/libtcodpy.py 2 locations

@@ 943-969 (lines=27) @@
940
941
def console_get_char_background(con, x, y):
942
    """Return the background color at the x,y of this console."""
943
    return Color._new_from_cdata(
944
        lib.TCOD_console_get_char_background(_cdata(con), x, y))
945
946
def console_get_char_foreground(con, x, y):
947
    """Return the foreground color at the x,y of this console."""
948
    return Color._new_from_cdata(
949
        lib.TCOD_console_get_char_foreground(_cdata(con), x, y))
950
951
def console_get_char(con, x, y):
952
    """Return the character at the x,y of this console."""
953
    return lib.TCOD_console_get_char(_cdata(con), x, y)
954
955
def console_set_fade(fade, fadingColor):
956
    lib.TCOD_console_set_fade(fade, fadingColor)
957
958
def console_get_fade():
959
    return lib.TCOD_console_get_fade()
960
961
def console_get_fading_color():
962
    return Color._new_from_cdata(lib.TCOD_console_get_fading_color())
963
964
# handling keyboard input
965
def console_wait_for_keypress(flush):
966
    """Block until the user presses a key, then returns a new Key.
967
968
    Args:
969
        flush bool: If True then the event queue is cleared before waiting
970
                    for the next event.
971
972
    Returns:
@@ 915-941 (lines=27) @@
912
    rectangle and the default foreground to draw the outline.
913
914
    fmt will be printed on the inside of the rectangle, word-wrapped.
915
    """
916
    lib.TCOD_console_print_frame(_cdata(con), x, y, w, h, clear, flag,
917
                                  _fmt_bytes(fmt))
918
919
def console_set_color_control(con, fore, back):
920
    """Configure :any:`color controls`.
921
922
    Args:
923
        con (int): :any:`Color control` constant to modify.
924
        fore (Union[Tuple[int, int, int], Sequence[int]]):
925
            An (r, g, b) sequence or Color instance.
926
        back (Union[Tuple[int, int, int], Sequence[int]]):
927
            An (r, g, b) sequence or Color instance.
928
    """
929
    lib.TCOD_console_set_color_control(_cdata(con), fore, back)
930
931
def console_get_default_background(con):
932
    """Return this consoles default background color."""
933
    return Color._new_from_cdata(
934
        lib.TCOD_console_get_default_background(_cdata(con)))
935
936
def console_get_default_foreground(con):
937
    """Return this consoles default foreground color."""
938
    return Color._new_from_cdata(
939
        lib.TCOD_console_get_default_foreground(_cdata(con)))
940
941
def console_get_char_background(con, x, y):
942
    """Return the background color at the x,y of this console."""
943
    return Color._new_from_cdata(
944
        lib.TCOD_console_get_char_background(_cdata(con), x, y))