Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 529 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 529 Bytes

A wrapper for Python's config parser

You can create a config file:

[basis]
user = sunhf
time = 2012-12-31
memo =

[BowtIE]
# case insensitive for section name

path = /usr/bin/bowtie
Index = /mnt/Storage/sync/hg19

And then use it like this:

from meta import Section, Base
class Conf(Base):
    basis = Section(["user", "time"])
    bowtie = Section(["path", "index"])

cf = Conf("rule.conf")

print cf.basis
print cf.basis.user
print cf.basis.time

print cf.bowtie
print cf.bowtie.path
print cf.bowtie.index