Move more pyglet imports in renderer.py
import datetime
-from pyglet.text import Label
-from pyglet.window import Window
from s2clientprotocol import score_pb2 as score_pb
from sc2.position import Point2
@@ -25,9 +23,6 @@ class Renderer:
self._text_time = None
async def render(self, observation):
- # pylint: disable=C0415
- from pyglet.image import ImageData
-
render_data = observation.observation.render_data
map_size = render_data.map.size
@@ -42,6 +37,11 @@ class Renderer:
minimap_pitch = -minimap_width * 3
if not self._window:
+ # pylint: disable=C0415
+ from pyglet.image import ImageData
+ from pyglet.text import Label
+ from pyglet.window import Window
+
self._window = Window(width=map_width, height=map_height)
self._window.on_mouse_press = self._on_mouse_press
self._window.on_mouse_release = self._on_mouse_release
