News for hackers. Stuff that matters.
Re:Python web application GUI toolkit by cjbprime on Sunday November 20, 2011 @07:21PM (#3259453)
It should not take 20 seconds to launch a barebones calculator, and another 5 to respond to clicking on a number.
Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:35PM (#3259472)
I just switched to a High-CPU EC2 instance. I hope it helps. Otherwise:

$ easy_install muntjac

$ muntjac

to run the demos locally.

Re:Python web application GUI toolkit by deafmetal on Monday November 21, 2011 @05:59AM (#3260705)
I'm getting an import error when i try to run muntjac locally.

from muntjac.terminal.gwt.server.paste_wsgi_servlet import PasteWsgiServlet File "/Library/Python/2.6/site-packages/Muntjac-1.0.0-py2.6.egg/muntjac/terminal/gwt/server/paste_wsgi_servlet.py", line 19, in <module>

ImportError: No module named HTTPServlet

Re:Python web application GUI toolkit by MetallicCloud on Sunday November 20, 2011 @07:36PM (#3259474)
I had a similar experience. Took around 5 seconds to launch, and around 10 seconds to get the result of me clicking 5 * 6. Much too slow.

- Chrome, i7, 4GB RAM

Re:Python web application GUI toolkit by bane on Sunday November 20, 2011 @07:33PM (#3259466)
Out of curiosity, what kind of rig are you running on?

On my four year old desktop it started in about 3 seconds and clicks on buttons do have a noticeable lag, but it's probably 1/3 to 1/2 a second.

Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:44PM (#3259485)
One issue is that the session gets unpickled/pickled with each request. When each of the samples has been run the pickled session files are ~2Mb.
Re:Python web application GUI toolkit by cjbprime on Sunday November 20, 2011 @07:37PM (#3259475)
> Out of curiosity, what kind of rig are you running on?

Quad-core i7 ThinkPad. I'm using Chrome (16), that might be relevant.

Re:Python web application GUI toolkit by nhebb on Monday November 21, 2011 @03:39AM (#3260459)
It's probably the HN load. I'm getting a "A server error occurred. Please contact the administrator." message for the calc app.
Re:Python web application GUI toolkit by endlessvoid94 on Sunday November 20, 2011 @07:48PM (#3259491)
First make it possible, then make it fast, then make it beautiful.

This is awesome -- don't let the haters say otherwise.

Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:52PM (#3259500)
Thanks. I'm not sure how it compares to Vaadin in terms of speed, but it does run on PyPy (and IronPython), which might help.
Re:Python web application GUI toolkit by antimora on Sunday November 20, 2011 @07:33PM (#3259467)
Sounds like a lot like Wicket (component based web ui). And honestly, I don't like this idea for the web. Web UI is not desktop UI. Make make both of them equivalent, one requires adding a special layer that converts API calls to HTML rendering, which can make things unnecessarily slow (as it was slow in Wicket, and it's also slow in Muntjac).
Re:Python web application GUI toolkit by mbell on Sunday November 20, 2011 @10:05PM (#3259788)
It depends heavily on how its implemented. I use primefaces[0] for java development and find it amazingly easy to build data based sites quickly, its also very fast. It uses jQuery UI for many components so it is very easy to extend / modify.

[0] http://www.primefaces.org

Re:Python web application GUI toolkit by dmk23 on Sunday November 20, 2011 @07:16PM (#3259448)
What would help a lot is to provide some detail on if/how this toolkit could be used with web frameworks like Django.

It would be awesome to be able to keep using Django models and expose them through Muntjac-based templates.

Could this be feasible? If yes, would be great to see some examples. If no, why?

Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:47PM (#3259488)
I don't know much about Django sadly. I can tell you that the ApplicationServlet is just a WSGI app and can be stacked accordingly.
Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:57PM (#3259515)
Currently only the server-side of Vaadin has been translated and Muntjac relies on the GWT compiled Java from Vaadin for the client code. The plan is to translate the rest and use Pyjamas to produce the JS. That way new components could be defined in Python.
Re:Python web application GUI toolkit by wkornewald on Monday November 21, 2011 @04:04AM (#3260509)
You might want to try django-mediagenerator for Pyjamas integration. We already have a pyjs filter. See [1] for an example of how to use pyjs with mediagenerator.

You should be prepared for lots of subtle pyjs bugs, though. The translation isn't perfect. One problem is that the Pyjamas team is replicating GWT, so they only need a small subset of Python's features. They also don't use more advanced features for performance reasons. This means that many code paths are practically untested.

[1] http://www.allbuttonspressed.com/blog/django/2010/11/Offline...

Re:Python web application GUI toolkit by dman on Sunday November 20, 2011 @07:06PM (#3259427)
Running the samples gives this currently - "A server error occurred. Please contact the administrator." Wanted to report this since being on the front page is precious and maybe you want to restart your server so that you dont lose the eyeballs.
Re:Python web application GUI toolkit by rwlincoln on Sunday November 20, 2011 @07:49PM (#3259494)
Thanks. I'm new to HN and didn't realise what this would do to my traffic. It is currently on EC2, but I had it working on GAE. Perhaps that would have helped with the scaling.
Re:Python web application GUI toolkit by __iivvoo__ on Monday November 21, 2011 @01:52AM (#3260269)
Python already has a similar framework with pluggable front-end toolkits (jquery, qooxdoo and zk): http://rctk.googlecode.com/

Performs reasonably well and very pythonic.

Re:Python web application GUI toolkit by sipefree on Sunday November 20, 2011 @08:55PM (#3259638)
Yuck!

The browser and server should work together elegantly in a modern asynchronous application, not force a paradigm that doesn't fit.

Re:Python web application GUI toolkit by sdiwakar on Sunday November 20, 2011 @09:06PM (#3259657)
Useful, especially if someone needed to do a quick and dirty 'webifying' of an older desktop based python app.

Keep up the good work!

Re:Python web application GUI toolkit by nvictor on Sunday November 20, 2011 @07:18PM (#3259449)
this is incredibly slow.

but on the bright side it got me to check on the original vaadin, which i found very interesting.

Re:Python web application GUI toolkit by lucian1900 on Sunday November 20, 2011 @08:08PM (#3259538)
This looks a lot like GWT/Pyjamas.
Re:Python web application GUI toolkit by oblique63 on Sunday November 20, 2011 @08:50PM (#3259620)
It's a port of Vaadin, which was built on top of GWT; so yes it should be a lot like GWT, though it doesn't seem to mention any use of Pyjamas unfortunately...
Re:Python web application GUI toolkit by gvsyn on Sunday November 20, 2011 @08:59PM (#3259647)
Er, the name could be a problem. Swap the first and last letters.
Re:Python web application GUI toolkit by sebkomianos on Monday November 21, 2011 @06:05AM (#3260715)
Please tell me it took you some time to work this out..
Re:Python web application GUI toolkit by gvsyn on Monday November 21, 2011 @06:28AM (#3260756)
After clearing up the spat drink yeah. Thought the deer had a k at the end... Oh well.
Re:Python web application GUI toolkit by samrat on Sunday November 20, 2011 @10:35PM (#3259846)
I really hope you make some tutorials too.