Sunday 24 March 2013

Web interface fun

After a good look at what web frameworks were available for python I came to the conclusion that cherrypy was the est option for what I wanted. Its small and lightweight and easy to work with and doesn't seam to mind too much about the parallel process required to keep the machine well looked after. To generate the pages, I started with Mako but I didn't like the fact that when variable it was expecting wasn't passed to it it would throw an error. Therefore I moved to Jinja2. Much better.

So far  have the basics covered; connecting and disconnecting and initializing the machine, uploading and selecting files and choosing which one to load as well as a simple self updating page that sits in an iframe tag that shows the position of the machine.

So we are getting there...

Wednesday 13 March 2013

Well that sounded easier in my head

After much reading up on Django, which is a very nice web framework indeed and I can see why it has taken off, I have found one small problem: Web server are meant to serve many users. Although this is blindingly obvious it does mean the django doesn't like the idea of a process running in the background and then call on it from time to time. I am sure it's possible and i can think of a number of messy ways that might work but I have yet to work out how to do it neatly. I see now why lasaur used bottle. Maybe I'll look at that route....

Wednesday 6 March 2013

A slight change of mind.

While I have been fiddeling with pyGTK I have found that debugging can be a bit of a problem as the GTK backend seams to handle errors silently and doesn't like pyscripter breakpoints. Further more, one of the things i want to add later is networkability so you can control your machines using a lan or over Wifi. I have been wondering for a while about how best to do this and then I came across this. And loe and behold that's what they have done. Their system works on the bottle web server and lots of javascript. I think we can go 1 better here and use Django and html5 and then for the icing on the cake, WebGL to provide a 3D representation of the program we are running and the machine it is running on.

There are actually lots of advantages to using a web interface. Its portable across systems, since all you need to use it is a machine with a browser. The user can be any distance from the machine they are using. It can be made to look like any other system with a bit of coding and a css script.

Books have been ordered. Tutorials are being read. Threading code is being rewritten. Soon something good should be produced.