unused variables
This commit is contained in:
@@ -1183,11 +1183,6 @@ class Interpolation(Statement):
|
||||
|
||||
warper = warpers.get(self.warper, self.warper)
|
||||
|
||||
if trans.atl.animation:
|
||||
st_or_at = trans.at
|
||||
else:
|
||||
st_or_at = trans.st
|
||||
|
||||
# Special case `pause 0` to always display a frame. This is intended to
|
||||
# support single-frame animations that shouldn't skip.
|
||||
force_frame = bool(state is None and self.warper == "pause" and self.duration == 0 and renpy.config.atl_one_frame)
|
||||
|
||||
@@ -303,7 +303,6 @@ def show_display_say(who, what, who_args={}, what_args={}, window_args={},
|
||||
layer = renpy.config.say_layer
|
||||
|
||||
tag = screen
|
||||
index = 0
|
||||
|
||||
if multiple:
|
||||
|
||||
|
||||
@@ -1545,7 +1545,7 @@ class Input(renpy.text.text.Text): # @UndefinedVariable
|
||||
if self.caret_pos > 0:
|
||||
space_pos = 0
|
||||
for item in re.finditer(r"\s+", self.content[:self.caret_pos]):
|
||||
start, end = item.span()
|
||||
_start, end = item.span()
|
||||
if end != self.caret_pos:
|
||||
space_pos = end
|
||||
self.caret_pos = space_pos
|
||||
|
||||
@@ -460,7 +460,7 @@ def before_interact(roots):
|
||||
|
||||
# Finally, mark the current widget as the focused widget, and
|
||||
# all other widgets as unfocused.
|
||||
for f, n, screen, modal in fwn:
|
||||
for f, n, screen, _modal in fwn:
|
||||
if f is not current:
|
||||
renpy.display.screen.push_current_screen(screen)
|
||||
try:
|
||||
|
||||
+4
-4
@@ -585,7 +585,7 @@ class Context(renpy.object.Object):
|
||||
if developer and self.next_node:
|
||||
self.check_stacks()
|
||||
|
||||
except renpy.game.CONTROL_EXCEPTIONS as e:
|
||||
except renpy.game.CONTROL_EXCEPTIONS:
|
||||
|
||||
# An exception ends the current translation.
|
||||
self.translate_interaction = None
|
||||
@@ -612,7 +612,7 @@ class Context(renpy.object.Object):
|
||||
raise
|
||||
except renpy.game.CONTROL_EXCEPTIONS as ce:
|
||||
raise ce
|
||||
except Exception as ce:
|
||||
except Exception:
|
||||
reraise(exc_info[0], exc_info[1], exc_info[2])
|
||||
|
||||
node = self.next_node
|
||||
@@ -943,10 +943,10 @@ def run_context(top):
|
||||
|
||||
return rv
|
||||
|
||||
except renpy.game.RestartContext as e:
|
||||
except renpy.game.RestartContext:
|
||||
continue
|
||||
|
||||
except renpy.game.RestartTopContext as e:
|
||||
except renpy.game.RestartTopContext:
|
||||
if top:
|
||||
continue
|
||||
|
||||
|
||||
+2
-2
@@ -2830,7 +2830,7 @@ def load_string(s, filename="<string>"):
|
||||
context.init_phase = True
|
||||
renpy.game.contexts.append(context)
|
||||
|
||||
for prio, node in initcode: # @UnusedVariable
|
||||
for _prio, node in initcode: # @UnusedVariable
|
||||
if isinstance(node, renpy.ast.Node):
|
||||
renpy.game.context().run(node)
|
||||
else:
|
||||
@@ -3226,7 +3226,7 @@ def list_files(common=False):
|
||||
|
||||
rv = [ ]
|
||||
|
||||
for dir, fn in renpy.loader.listdirfiles(common): # @ReservedAssignment
|
||||
for _dir, fn in renpy.loader.listdirfiles(common): # @ReservedAssignment
|
||||
if fn.startswith("saves/"):
|
||||
continue
|
||||
|
||||
|
||||
+1
-1
@@ -265,7 +265,7 @@ def index_archives():
|
||||
if archive_handled == True:
|
||||
break
|
||||
|
||||
for dir, fn in listdirfiles(): # @ReservedAssignment
|
||||
for _dir, fn in listdirfiles(): # @ReservedAssignment
|
||||
lower_map[unicodedata.normalize('NFC', fn.lower())] = fn
|
||||
|
||||
for fn in remote_files:
|
||||
|
||||
@@ -638,8 +638,6 @@ def IF_statement(l, loc):
|
||||
|
||||
rv = None
|
||||
|
||||
entries = [ ]
|
||||
|
||||
condition = l.require(l.python_expression)
|
||||
l.require(':')
|
||||
l.expect_eol()
|
||||
|
||||
+1
-1
@@ -750,7 +750,7 @@ class SLDisplayable(SLBlock):
|
||||
for i in self.positional:
|
||||
const = min(self.constant, analysis.is_constant_expr(i))
|
||||
|
||||
for k, v in self.keyword:
|
||||
for _k, v in self.keyword:
|
||||
const = min(self.constant, analysis.is_constant_expr(v))
|
||||
|
||||
if self.keyword_exist("id"):
|
||||
|
||||
+1
-1
@@ -1936,7 +1936,7 @@ class Text(renpy.display.core.Displayable):
|
||||
|
||||
layout = Layout(self, width, height, renders, size_only=True, drawable_res=True)
|
||||
|
||||
xpos, ypos, xanchor, yanchor, xoffset, yoffset, subpixel = rv
|
||||
xpos, ypos, xanchor, _yanchor, xoffset, yoffset, subpixel = rv
|
||||
rv = (xpos, ypos, xanchor, layout.baseline, xoffset, yoffset, subpixel)
|
||||
return rv
|
||||
|
||||
|
||||
@@ -945,7 +945,7 @@ def detect_user_locale():
|
||||
if isinstance(locale_name, bytes):
|
||||
locale_name = locale_name.decode("utf-8")
|
||||
|
||||
local_name = locale_name.replace("-", "_")
|
||||
locale_name = locale_name.replace("-", "_")
|
||||
else:
|
||||
locale_name = locale.getdefaultlocale()
|
||||
if locale_name is not None:
|
||||
|
||||
@@ -311,7 +311,7 @@ class DialogueFile(object):
|
||||
if self.notags:
|
||||
s = notags_filter(s)
|
||||
|
||||
what = combine_filter(s)
|
||||
# what = combine_filter(s)
|
||||
|
||||
if self.escape:
|
||||
s = quote_unicode(s)
|
||||
|
||||
+2
-2
@@ -400,7 +400,7 @@ def context_enter(w):
|
||||
if isinstance(renpy.ui.stack[-1], renpy.ui.Many) and renpy.ui.stack[-1].displayable is w: # type: ignore
|
||||
return
|
||||
|
||||
raise Exception("%r cannot be used as a context manager.", type(w).__name__)
|
||||
raise Exception("{} cannot be used as a context manager.".format(type(w).__name__))
|
||||
|
||||
|
||||
def context_exit(w):
|
||||
@@ -526,7 +526,7 @@ class Wrapper(renpy.object.Object):
|
||||
try:
|
||||
w = self.function(*args, **keyword)
|
||||
except TypeError as e:
|
||||
etype, e, tb = sys.exc_info()
|
||||
_etype, e, tb = sys.exc_info()
|
||||
|
||||
if tb.tb_next is None:
|
||||
e.args = (e.args[0].replace("__call__", "ui." + self.name),) # type: ignore
|
||||
|
||||
Reference in New Issue
Block a user