Skip to content

Commit 8077df0

Browse files
committed
change a few private names
1 parent 63a0864 commit 8077df0

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

tdl/__init__.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ def __setitem__(self, key, bg):
251251
def __init__(self):
252252
self._cursor = (0, 0)
253253
self._scrollMode = 'error'
254-
self._fg = _format_color((255, 255, 255))
255-
self._bg = _format_color((0, 0, 0))
256-
self._blend = _lib.TCOD_BKGND_SET
254+
self._default_fg = _format_color((255, 255, 255))
255+
self._default_bg = _format_color((0, 0, 0))
256+
self._default_blend = _lib.TCOD_BKGND_SET
257257

258258
def _normalizePoint(self, x, y):
259259
"""Check if a point is in bounds and make minor adjustments.
@@ -353,9 +353,9 @@ def set_colors(self, fg=None, bg=None):
353353
@see: L{move}, L{print_str}
354354
"""
355355
if fg is not None:
356-
self._fg = _format_color(fg, self._fg)
356+
self._default_fg = _format_color(fg, self._default_fg)
357357
if bg is not None:
358-
self._bg = _format_color(bg, self._bg)
358+
self._default_bg = _format_color(bg, self._default_bg)
359359

360360
def print_str(self, string):
361361
"""Print a string at the virtual cursor.
@@ -382,7 +382,7 @@ def print_str(self, string):
382382
x = 0
383383
continue
384384
x, y = self._normalizeCursor(x, y)
385-
self.draw_char(x, y, char, self._fg, self._bg)
385+
self.draw_char(x, y, char, self._default_fg, self._default_bg)
386386
x += 1
387387
self._cursor = (x, y)
388388

@@ -414,7 +414,7 @@ def write(self, string):
414414

415415
for line in writeLines:
416416
x, y = self._normalizeCursor(x, y)
417-
self.draw_str(x, y, line[x:], self._fg, self._bg)
417+
self.draw_str(x, y, line[x:], self._default_fg, self._default_bg)
418418
y += 1
419419
x = 0
420420
y -= 1
@@ -447,7 +447,7 @@ def draw_char(self, x, y, char, fg=Ellipsis, bg=Ellipsis):
447447
"""
448448
#x, y = self._normalizePoint(x, y)
449449
_put_char_ex(self.tcod_console, x, y, _format_char(char),
450-
_format_color(fg, self._fg), _format_color(bg, self._bg), 1)
450+
_format_color(fg, self._default_fg), _format_color(bg, self._default_bg), 1)
451451

452452
def draw_str(self, x, y, string, fg=Ellipsis, bg=Ellipsis):
453453
"""Draws a string starting at x and y.
@@ -489,7 +489,7 @@ def draw_str(self, x, y, string, fg=Ellipsis, bg=Ellipsis):
489489
"""
490490

491491
x, y = self._normalizePoint(x, y)
492-
fg, bg = _format_color(fg, self._fg), _format_color(bg, self._bg)
492+
fg, bg = _format_color(fg, self._default_fg), _format_color(bg, self._default_bg)
493493
width, height = self.get_size()
494494
batch = [] # prepare a batch operation
495495
def _drawStrGen(x=x, y=y, string=string, width=width, height=height):
@@ -547,7 +547,7 @@ def draw_rect(self, x, y, width, height, string, fg=Ellipsis, bg=Ellipsis):
547547
@see: L{clear}, L{draw_frame}
548548
"""
549549
x, y, width, height = self._normalizeRect(x, y, width, height)
550-
fg, bg = _format_color(fg, self._fg), _format_color(bg, self._bg)
550+
fg, bg = _format_color(fg, self._default_fg), _format_color(bg, self._default_bg)
551551
char = _format_char(string)
552552
# use itertools to make an x,y grid
553553
# using ctypes here reduces type converstions later
@@ -595,7 +595,7 @@ def draw_frame(self, x, y, width, height, string, fg=Ellipsis, bg=Ellipsis):
595595
@see: L{draw_rect}, L{Window}
596596
"""
597597
x, y, width, height = self._normalizeRect(x, y, width, height)
598-
fg, bg = _format_color(fg, self._fg), _format_color(bg, self._bg)
598+
fg, bg = _format_color(fg, self._default_fg), _format_color(bg, self._default_bg)
599599
char = _format_char(string)
600600
if width == 1 or height == 1: # it's just a single width line here
601601
return self.draw_rect(x, y, width, height, char, fg, bg)
@@ -776,13 +776,13 @@ def getCover(x, length):
776776
self.blit(self, x, y, width, height, srcx, srcy)
777777
if uncoverX: # clear sides (0x20 is space)
778778
self.draw_rect(uncoverX[0], coverY[0], uncoverX[1], coverY[1],
779-
0x20, self._fg, self._bg)
779+
0x20, self._default_fg, self._default_bg)
780780
if uncoverY: # clear top/bottom
781781
self.draw_rect(coverX[0], uncoverY[0], coverX[1], uncoverY[1],
782-
0x20, self._fg, self._bg)
782+
0x20, self._default_fg, self._default_bg)
783783
if uncoverX and uncoverY: # clear corner
784784
self.draw_rect(uncoverX[0], uncoverY[0], uncoverX[1], uncoverY[1],
785-
0x20, self._fg, self._bg)
785+
0x20, self._default_fg, self._default_bg)
786786

787787
def clear(self, fg=Ellipsis, bg=Ellipsis):
788788
"""Clears the entire L{Console}/L{Window}.
@@ -960,8 +960,8 @@ def _translate(self, x, y):
960960
def clear(self, fg=Ellipsis, bg=Ellipsis):
961961
# inherit docstring
962962
assert fg is not None and bg is not None, 'Can not use None with clear'
963-
fg = _format_color(fg, self._fg)
964-
bg = _format_color(bg, self._bg)
963+
fg = _format_color(fg, self._default_fg)
964+
bg = _format_color(bg, self._default_bg)
965965
_lib.TCOD_console_set_default_foreground(self.tcod_console,
966966
_to_tcod_color(fg)[0])
967967
_lib.TCOD_console_set_default_background(self.tcod_console,
@@ -1114,9 +1114,9 @@ def clear(self, fg=Ellipsis, bg=Ellipsis):
11141114
# inherit docstring
11151115
assert fg is not None and bg is not None, 'Can not use None with clear'
11161116
if fg is Ellipsis:
1117-
fg = self._fg
1117+
fg = self._default_fg
11181118
if bg is Ellipsis:
1119-
bg = self._bg
1119+
bg = self._default_bg
11201120
self.draw_rect(0, 0, None, None, 0x20, fg, bg)
11211121

11221122
def _set_char(self, x, y, char=None, fg=None, bg=None, bgblend=1):
@@ -1134,28 +1134,28 @@ def _set_batch(self, batch, *args, **kargs):
11341134
def draw_char(self, x, y, char, fg=Ellipsis, bg=Ellipsis):
11351135
# inherit docstring
11361136
if fg is Ellipsis:
1137-
fg = self._fg
1137+
fg = self._default_fg
11381138
if bg is Ellipsis:
1139-
bg = self._bg
1139+
bg = self._default_bg
11401140
self.parent.draw_char(self._range_x[x], self._range_y[y], char, fg, bg)
11411141

11421142
def draw_rect(self, x, y, width, height, string, fg=Ellipsis, bg=Ellipsis):
11431143
# inherit docstring
11441144
x, y, width, height = self._normalizeRect(x, y, width, height)
11451145
if fg is Ellipsis:
1146-
fg = self._fg
1146+
fg = self._default_fg
11471147
if bg is Ellipsis:
1148-
bg = self._bg
1148+
bg = self._default_bg
11491149
self.parent.draw_rect(self._range_x[x], self._range_y[y], width, height,
11501150
string, fg, bg)
11511151

11521152
def draw_frame(self, x, y, width, height, string, fg=Ellipsis, bg=Ellipsis):
11531153
# inherit docstring
11541154
x, y, width, height = self._normalizeRect(x, y, width, height)
11551155
if fg is Ellipsis:
1156-
fg = self._fg
1156+
fg = self._default_fg
11571157
if bg is Ellipsis:
1158-
bg = self._bg
1158+
bg = self._default_bg
11591159
self.parent.draw_frame(self._range_x[x], self._range_y[y], width, height,
11601160
string, fg, bg)
11611161

0 commit comments

Comments
 (0)