Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(22)  |  Derive(0)  |  Import(0)

src/k/a/karesansui-HEAD/karesansui/lib/parser/base/xml_like_conf_parser.py   karesansui(Download)
        dop.addconf('__',{})
        if action == "delete":
            dop.add('__',new_key,val)
            dop.delete('__',new_key)
        elif action == "set":
            dop.set('__',new_key,val)
        else:
            dop.add('__',new_key,val)

src/k/a/karesansui-HEAD/karesansui/lib/parser/hosts.py   karesansui(Download)
    dop = DictOp()
    dop.addconf("dum",parser.read_conf())
    dop.add("dum",['key'],['value',[['comment foo','comment bar'],'comment hoge']])
    print dop.cdp_get("dum",['key'])
    print dop.cdp_get_pre_comment("dum",['key'])

src/k/a/karesansui-HEAD/karesansui/lib/parser/collectd.py   karesansui(Download)
    ##########################################################
    # 'Foo foo' を追加(設定値リスト形式モードよる addメソッド)
    dop.add("dum",["Foo"],["foo",[["comment foo1","comment foo2"],"comment foo3"]])
    #print dop.cdp_get("dum",["Foo"])
    #print dop.cdp_get_pre_comment("dum",["Foo"])

src/k/a/karesansui-HEAD/karesansui/lib/parser/staticroute.py   karesansui(Download)
                except:
                    pass
                dop.add("__",[target],gateway)
 
                if action == "delete":
 
        if len(orders) != 0:
            dop.add("__",['@ORDERS'],orders)
 
        return dop.getconf("__")
                        index = cnt
 
                    dop.add("__",["ADDRESS%d" % index],ipaddr)
                    if action == "delete":
                        dop.delete("__",["ADDRESS%d" % index])
                    orders.insert(cnt*3+0,["ADDRESS%d" % index])
 
                    dop.add("__",["NETMASK%d" % index],netmask)
                    orders.insert(cnt*3+1,["NETMASK%d" % index])
 
                    dop.add("__",["GATEWAY%d" % index],gateway)
                    if action == "delete":
                        dop.delete("__",["GATEWAY%d" % index])

src/k/a/karesansui-HEAD/karesansui/lib/parser/modprobe_conf.py   karesansui(Download)
    new_key   = '/path/to/include/file1'
    new_value = ''   # valueを空にセットする
    dop.add("dum",["include",new_key],new_value)
    # コメントにするなら
    dop.comment("dum",["include",new_key])
 
    new_key   = '/path/to/include/file2'
    new_value = ''   # valueを空にセットする
    dop.add("dum",["include",new_key],new_value)
    new_key   = 'eth3'
    new_value = 'foobar'
    dop.add("dum",["alias",new_key],new_value)
    # コメントにするなら
    dop.comment("dum",["alias",new_key])
 
    new_key   = "snd-hda-intel"
    new_value = "{ /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-hda-intel"
    dop.add("dum",["remove",new_key],new_value)

src/k/a/karesansui-HEAD/karesansui/lib/parser/collectdplugin.py   karesansui(Download)
    ##########################################################
    # 'Foo foo' を追加(設定値リスト形式モードよる addメソッド)
    dop.add("dum",[new_plugin_name,"Foo"],["foo",[["comment foo1","comment foo2"],"comment foo3"]])
 
    # 'Bar bar' を追加(設定値文字列形式モードによる cdp_setメソッド)

src/k/a/karesansui-HEAD/karesansui/lib/parser/network.py   karesansui(Download)
    dop = DictOp()
    dop.addconf("dum",parser.read_conf())
    dop.add("dum","NETWORK","1.0.0.0")
    dop.add("dum","NETWORK2","1.0.0.0")
    dop.delete("dum","NETWORK")

src/k/a/karesansui-HEAD/karesansui/lib/parser/iscsid.py   karesansui(Download)
    dop = DictOp()
    dop.addconf("dum",parser.read_conf())
    dop.add("dum",['key'],['value',[['','comment mae1','comment mae2'],'comment ato']])
    dop.comment("dum",['node.session.iscsi.FastAbort'])
    dop.uncomment("dum",['node.session.iscsi.FastAbort'])

src/k/a/karesansui-HEAD/karesansui/lib/parser/resolv.py   karesansui(Download)
    dop.comment("dum","search")
    dop.comment("dum","nameserver")
    dop.add("dum","domain","example.com localdomain")
    conf = dop.getconf("dum")
    parser.write_conf(conf,dryrun=True)