Just uploaded a new OMHE library (Python)

8 views
Skip to first unread message

Alan

unread,
Jul 1, 2010, 2:28:40 PM7/1/10
to OMHE
Hey y'all I just uploaded a new OMHE library and parsing utility (in
Python). I rewrote it from scratch. Much better now in my opinion.
It only fully supports a handful of commands right now, but I'll be
adding more. By "fully support" I mean it validates the syntax and
reports errors if something is wrong.

Basicaly to add validation to a command simply define a validator
function in the omhevalidators.py. It should either return a dict of
the parsed subparts of the command, or raise an error. I've define
custom error classes for this purpose. Other than that just add the
validator into the validation dictionary in the main parseomhe.py file
and you're good to go. For example:


self.validator_dict={
'bp': bp_validator,
'bloodpressure': bp_validator,
.
.
.
'the_omhe_command':
the_command's_validation_function
}


I plan to write some unit tests too. This will make sure she's
seaworthy.

I'm sure all you fellow geeks know that 'git' is what all the cool
kids are using so I pushed this to git. I'll link it on the GogleCode
site so we can keep the main site there but I'll be pushing python-
based updates to github.

Here is the link: http://github.com/aviars/python-omhe


I hope everyone has a great 4th of July weekend.

-Alan
Reply all
Reply to author
Forward
0 new messages