Example #1
0
def find_data_test():
    bps_file = bps.read(path + rf)

    d = bps_file.find('section').find('key')
    print(d.key + ":" + d.value)

    bps.write(bps_file, path + wf)
Example #2
0
def section_exists_test():
    bps_file = bps.read(path + rf)

    print(bps_file.exists('section'))
    print(bps_file.exists('section2'))

    bps.write(bps_file, path + wf)
Example #3
0
def data_exists_test():
    bps_file = bps.read(path + rf)

    print(bps_file.find('section').exists('key'))
    print(bps_file.find('section').exists('key2'))

    bps.write(bps_file, path + wf)
Example #4
0
def find_section_test():
    bps_file = bps.read(path + rf)

    s = bps_file.find('section')
    print(s.name)
    for d in s.find_all():
        print(d.key + ":" + d.value)
    print("\n")

    bps.write(bps_file, path + wf)
Example #5
0
def rw_test():
    bps_file = bps.read(path + rf)

    for s in bps_file.find_all():
        print(s.name)
        for d in s.find_all():
            print(d.key + ":" + d.value)
        print("\n")

    bps.write(bps_file, path + wf)
Example #6
0
def remove_section_test():
    bps_file = bps.read(path + rf)

    print(bps_file.remove('section'))

    bps.write(bps_file, path + wf)
Example #7
0
def remove_data_test():
    bps_file = bps.read(path + rf)

    print(bps_file.find('section').remove('key'))

    bps.write(bps_file, path + wf)