本文整理汇总了Python中karesansui.lib.dict_op.DictOp.order方法的典型用法代码示例。如果您正苦于以下问题:Python DictOp.order方法的具体用法?Python DictOp.order怎么用?Python DictOp.order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karesansui.lib.dict_op.DictOp
的用法示例。
在下文中一共展示了DictOp.order方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: preprint_r
# 需要导入模块: from karesansui.lib.dict_op import DictOp [as 别名]
# 或者: from karesansui.lib.dict_op.DictOp import order [as 别名]
# </Plugin>
dop.cdp_set("dum",["Plugin","foobar","Option1"],"true")
dop.cdp_set("dum",["Plugin","foobar","Option2"],"false")
dop.cdp_set("dum",["Plugin","foobar","View","hoge","SubOpt1"],"gege")
dop.cdp_set_pre_comment("dum",["Plugin","foobar","View","hoge","SubOpt1"],["","pre comment"])
dop.cdp_set_post_comment("dum",["Plugin","foobar","View","hoge","SubOpt1"],"post")
# 'LoadPlugin target_replace' の値を取得
key = ["LoadPlugin","target_hoge"]
dop.insert_order("dum",key)
value = dop.cdp_get("dum",key)
preprint_r(value)
# 'LoadPlugin target_replace' の設定順を取得
key = ["LoadPlugin","target_hoge"]
num = dop.order("dum",key)
print num
# '<Plugin foobar>' を 'LoadPlugin target_hoge' の前にする
key = ["Plugin","foobar"]
dop.insert_order("dum",key,num)
# '<Plugin foobar>' を 'LoadPlugin target_hoge' の後に変更する
dop.change_order("dum",key,num+1)
# 'Foo' を 'Bar' の後に変更する
num = dop.order("dum",['Foo'])
dop.change_order("dum",['Bar'],num+1)
print dop.get("dum",['@ORDERS'])
# 配列確認