本文整理汇总了Python中log.LOG.critical方法的典型用法代码示例。如果您正苦于以下问题:Python LOG.critical方法的具体用法?Python LOG.critical怎么用?Python LOG.critical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log.LOG
的用法示例。
在下文中一共展示了LOG.critical方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: place_block
# 需要导入模块: from log import LOG [as 别名]
# 或者: from log.LOG import critical [as 别名]
def place_block(self, block, pos, ignore_top=True):
"""
Updates the board by placing `block` at the position `pos`.
"""
LOG.debug("Placing %s at %s" % (block, pos))
solid_squares = block.get_solid_squares()
heighest_columns = [0] * self.width
for (x,y) in solid_squares:
final_x, final_y = pos[0]+x, pos[1]+y
if ignore_top and final_y >= self.height:
continue
assert self.valid_position(final_x, final_y, ignore_top), \
"Trying to place %s outside the board limits! (%s)" % (block, pos)
if self.board[final_y][final_x] != None:
LOG.critical("Writing on (%d,%d), a position of the" % (final_x, final_y) + \
"board already filled, something wrong happend!")
self.board[final_y][final_x] = block
if final_y >= heighest_columns[final_x]:
heighest_columns[final_x] = final_y + 1
for (x, _) in solid_squares:
final_x = pos[0]+x
if heighest_columns[final_x] > self._column_heights[final_x]:
self._column_heights[final_x] = heighest_columns[final_x]