本文整理汇总了Python中aquilon.worker.processes.DSDBRunner.del_city方法的典型用法代码示例。如果您正苦于以下问题:Python DSDBRunner.del_city方法的具体用法?Python DSDBRunner.del_city怎么用?Python DSDBRunner.del_city使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aquilon.worker.processes.DSDBRunner
的用法示例。
在下文中一共展示了DSDBRunner.del_city方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render
# 需要导入模块: from aquilon.worker.processes import DSDBRunner [as 别名]
# 或者: from aquilon.worker.processes.DSDBRunner import del_city [as 别名]
def render(self, session, logger, city, **arguments):
dbcity = get_location(session, city=city)
name = dbcity.name
country = dbcity.country.name
fullname = dbcity.fullname
plenary = PlenaryCity(dbcity, logger=logger)
CommandDelLocation.render(self, session=session, name=city,
type='city', **arguments)
session.flush()
key = plenary.get_remove_key()
try:
lock_queue.acquire(key)
plenary.remove(locked=True)
dsdb_runner = DSDBRunner(logger=logger)
dsdb_runner.del_city(name, country, fullname)
dsdb_runner.commit_or_rollback()
except:
plenary.restore_stash()
raise
finally:
lock_queue.release(key)
return
示例2: render
# 需要导入模块: from aquilon.worker.processes import DSDBRunner [as 别名]
# 或者: from aquilon.worker.processes.DSDBRunner import del_city [as 别名]
def render(self, session, logger, city, **arguments):
dbcity = get_location(session, city=city)
name = dbcity.name
country = dbcity.country.name
fullname = dbcity.fullname
plenary = Plenary.get_plenary(dbcity, logger=logger)
CommandDelLocation.render(self, session=session, name=city,
type='city', **arguments)
session.flush()
with plenary.get_key():
try:
plenary.remove(locked=True)
dsdb_runner = DSDBRunner(logger=logger)
dsdb_runner.del_city(name, country, fullname)
dsdb_runner.commit_or_rollback()
except:
plenary.restore_stash()
raise
return