Friday, March 12, 2010

GNUmed has a webinterface - sort of

It took 10 hours, cherrypy and some good guessing but now it is there. Let me
introduce GNUmed's web interface.

I have repeated ad nauseum that GNUmed is so cool ( I mean well abstracted)
that there should not be any problem ripping out the wxpython interface and
replacing that by a web interface.

Because I suck at python and web frameworks it took ten hours to complete. I
hase used cherrypy and a stock GNUmed. It was not neccessary to add a single
line of code apart from a few lines for the html login page. Can you believe
that ?

GNUmed is so nicely seperated that I was able to reuse gmPG2, gmCLI and some
more middleware modules without changing any of them. I ripped out gmGuiMain
since this is mostly wxpython stuff, stole most of the code from gnumed.py and
gmAuthWidgets for the login stuff and put all this in gnumedweb.py.

What we have got now is a simple website that will ask for the backend
profile, the username and the password. It will the connect to a stock gnumed
database just as the the wxpython gui would. To prove that I did not make this
up it returns the database language for your login and shows it on a webpage.

Tell you what. If you want to try it install cherrypy for your operating
system, replace the original gnumed.py in the wxpython directory by the one I
have attached here and run the well know shell script gm-from-vcs.sh just as
you would for the wxpython gui. Open a webbrowser and go to 'localhost:8080'.
Put in the credentials and observe the output.

You need to have a version 13 (devel version) database. If you want to try it
with a v12 (stable ) database let me know and I will make a small change to
gnumed.py.

What's next ? This is a prototype only. It show that the existing GNUmed code
can be reused without rewriting it. One needs python skills and HTML and/or
some Javascript skills to hack up a nice user interface. Some Ajax won't hurt
either.



http://localhost:8080

Best regards,
Sebastian

No comments: