Skip to content

Commit

Permalink
fix (time.clock() is deprecated, use time.perf_counter() instead, cha…
Browse files Browse the repository at this point in the history
…nge_terrain_widget could not get tile to texture mapper)
  • Loading branch information
Trilarion committed Sep 14, 2020
1 parent aa21089 commit c4967a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, screen, column, row):
x = i % self.COLUMNS_IN_A_ROW

scene_utils.put_pixmap_in_tile_center(self.scene,
self.scene.scenario.get_tile_to_texture_mapper().get_pixmap_of_type(
screen.scenario.get_tile_to_texture_mapper().get_pixmap_of_type(
i), x, y, 1)

def mousePressEvent(self, event):
Expand Down
6 changes: 3 additions & 3 deletions source/imperialism_remake/server/server_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ def scenario_preview(self, scenario_file_name):
A client got a message on the constants.C.SCENARIO_PREVIEW channel. In the message should be a scenario file name
(key = 'scenario'). Assemble a preview and send it back.
"""
t0 = time.clock()
t0 = time.perf_counter()

# TODO existing? can be loaded?
scenario = ServerScenario.from_file(scenario_file_name)
logger.info('reading of the file took {}s'.format(time.clock() - t0))
logger.info('reading of the file took {}s'.format(time.perf_counter() - t0))

preview = {'scenario': scenario_file_name}

Expand Down Expand Up @@ -265,6 +265,6 @@ def scenario_preview(self, scenario_file_name):
nations_map[row * columns + column] = nation_id
preview['map'] = nations_map

logger.info('generating preview took {}s'.format(time.clock() - t0))
logger.info('generating preview took {}s'.format(time.perf_counter() - t0))

return preview

0 comments on commit c4967a6

Please sign in to comment.