本文整理匯總了Python中rules.Rules.find_captures方法的典型用法代碼示例。如果您正苦於以下問題:Python Rules.find_captures方法的具體用法?Python Rules.find_captures怎麽用?Python Rules.find_captures使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rules.Rules
的用法示例。
在下文中一共展示了Rules.find_captures方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: rules_page
# 需要導入模塊: from rules import Rules [as 別名]
# 或者: from rules.Rules import find_captures [as 別名]
def rules_page(key = None):
page = Rules(dsn = app.config['dsn'])
if key == 1:
return page.open_page("piece_name")
elif key == 2:
return page.open_page("piece_move")
elif key == 3:
return page.open_page("special_move")
elif key == 4:
return page.open_page("the_rule")
elif key == 5:
return page.open_page("made_by")
elif key == 6:
return page.open_page("date")
elif key == 7:
return page.open_page("name")
elif key == 8:
return page.open_page("capture_direction")
elif key == 9:
return page.open_page("starting_place")
elif key == 10:
return page.open_page("can_start")
elif request.method == 'GET':
try:
return page.open_page()
except:
return page.init_table()
elif 'initializeTable' in request.form:
return page.init_table()
elif 'addpiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
special_move = request.form['special_move']
return page.add_piece(piece_name, piece_move, special_move)
elif 'addcapture' in request.form:
name = request.form['name']
capture_direction = request.form['capture_direction']
starting_place = request.form['starting_place']
can_start = request.form['can_start']
return page.add_capture(name, capture_direction, starting_place, can_start)
elif 'addrule' in request.form:
the_rule = request.form['the_rule']
made_by = request.form['made_by']
date = request.form['date']
return page.add_rule(the_rule, made_by, date)
elif 'deletepiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
return page.delete_piece(piece_name, piece_move)
elif 'deleterule' in request.form:
the_rule = request.form['the_rule']
return page.delete_rule(the_rule)
elif 'deletecapture' in request.form:
name = request.form['name']
return page.delete_capture(name)
elif 'findpiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
return page.find_pieces(piece_name, piece_move)
elif 'findrule' in request.form:
the_rule = request.form['the_rule']
return page.find_rules(the_rule)
elif 'findcapture' in request.form:
name = request.form['name']
return page.find_captures(name)
else:
return redirect(url_for('home_page'))