Code Duplication    Length = 27-27 lines in 2 locations

tcod/libtcodpy.py 2 locations

@@ 943-969 (lines=27) @@
940
941
# handling keyboard input
942
def console_wait_for_keypress(flush):
943
    """Block until the user presses a key, then returns a new Key.
944
945
    Args:
946
        flush bool: If True then the event queue is cleared before waiting
947
                    for the next event.
948
949
    Returns:
950
        Key: A new Key instance.
951
    """
952
    k=Key()
953
    lib.TCOD_console_wait_for_keypress_wrapper(k.cdata, flush)
954
    return k
955
956
def console_check_for_keypress(flags=KEY_RELEASED):
957
    k=Key()
958
    lib.TCOD_console_check_for_keypress_wrapper(k.cdata, flags)
959
    return k
960
961
def console_is_key_pressed(key):
962
    return lib.TCOD_console_is_key_pressed(key)
963
964
# using offscreen consoles
965
def console_new(w, h):
966
    """Return an offscreen console of size: w,h."""
967
    return tcod.console.Console(w, h)
968
969
def console_from_file(filename):
970
    """Return a new console object from a filename.
971
972
    The file format is automactially determined.  This can load REXPaint `.xp`,
@@ 915-941 (lines=27) @@
912
913
def console_get_default_foreground(con):
914
    """Return this consoles default foreground color."""
915
    return Color._new_from_cdata(
916
        lib.TCOD_console_get_default_foreground(_cdata(con)))
917
918
def console_get_char_background(con, x, y):
919
    """Return the background color at the x,y of this console."""
920
    return Color._new_from_cdata(
921
        lib.TCOD_console_get_char_background(_cdata(con), x, y))
922
923
def console_get_char_foreground(con, x, y):
924
    """Return the foreground color at the x,y of this console."""
925
    return Color._new_from_cdata(
926
        lib.TCOD_console_get_char_foreground(_cdata(con), x, y))
927
928
def console_get_char(con, x, y):
929
    """Return the character at the x,y of this console."""
930
    return lib.TCOD_console_get_char(_cdata(con), x, y)
931
932
def console_set_fade(fade, fadingColor):
933
    lib.TCOD_console_set_fade(fade, fadingColor)
934
935
def console_get_fade():
936
    return lib.TCOD_console_get_fade()
937
938
def console_get_fading_color():
939
    return Color._new_from_cdata(lib.TCOD_console_get_fading_color())
940
941
# handling keyboard input
942
def console_wait_for_keypress(flush):
943
    """Block until the user presses a key, then returns a new Key.
944