Where is the Document Root

72 views
Skip to first unread message

Terrence Brannon

unread,
Apr 4, 2013, 3:05:25 PM4/4/13
to mun...@googlegroups.com
I tried running the sample hello world

from muntjac.api import Application, Button, GridLayout, Label, Window


class HelloWorld(Application):

    def init(self):
        main = Window('Hello window')
        self.setMainWindow(main)

        main.addComponent(Label('Hello World!'))



if __name__ == '__main__':
    from muntjac.main import muntjac
    muntjac(HelloWorld, nogui=True, forever=True, debug=True)



but it cannot find various resources in /VAADIN even though they are unpacked in a directory that is slbling to the hello.py file;



[tbrannon@oc2417102872 muntjac-play]$ python hello.py
Serving at: http://localhost:8880/
WARNING:
=================================================================
Muntjac is running in DEBUG MODE.
Add productionMode=true to INI to disable debug features.
To show debug window, add ?debug to your application URL.
=================================================================
/usr/lib/python2.6/site-packages/Muntjac-_VERSION_-py2.6.egg/muntjac/terminal/gwt/server/abstract_application_servlet.py:1914: DeprecationWarning: deprecated
  warn("deprecated", DeprecationWarning)
/usr/lib/python2.6/site-packages/Muntjac-_VERSION_-py2.6.egg/muntjac/terminal/gwt/server/abstract_communication_manager.py:1644: DeprecationWarning: deprecated
  warn("deprecated", DeprecationWarning)
/usr/lib/python2.6/site-packages/Muntjac-_VERSION_-py2.6.egg/muntjac/application.py:613: DeprecationWarning: this method is called be the terminal implementation only and might be removed or moved in the future. Instead of overriding this method, add your L{IUriHandler} to a top level L{Window} (eg. getMainWindow().addUriHanler(handler) instead.
  "instead."), DeprecationWarning)
localhost.localdomain - - [04/Apr/2013 15:00:06] "GET / HTTP/1.1" 200 2641
INFO: Requested resource [/VAADIN/widgetsets/org.muntiacus.MuntjacWidgetSet/org.muntiacus.MuntjacWidgetSet.nocache.js] not found
localhost.localdomain - - [04/Apr/2013 15:00:06] "GET /VAADIN/widgetsets/org.muntiacus.MuntjacWidgetSet/org.muntiacus.MuntjacWidgetSet.nocache.js?1365102006001 HTTP/1.1" 404 0
INFO: Requested resource [/VAADIN/themes/reindeer/styles.css] not found
localhost.localdomain - - [04/Apr/2013 15:00:06] "GET /VAADIN/themes/reindeer/styles.css HTTP/1.1" 404 0
  C-c C-cTraceback (most recent call last):
  File "hello.py", line 16, in <module>
    muntjac(HelloWorld, nogui=True, forever=True, debug=True)
  File "/usr/lib/python2.6/site-packages/Muntjac-_VERSION_-py2.6.egg/muntjac/main.py", line 51, in muntjac
    httpd.serve_forever()
  File "/usr/lib64/python2.6/SocketServer.py", line 224, in serve_forever
    r, w, e = select.select([self], [], [], poll_interval)
KeyboardInterrupt
[tbrannon@oc2417102872 muntjac-play]$ ls -l
total 8
-rw-rw-r--. 1 tbrannon tbrannon  375 Apr  4 14:48 hello.py
drwxr-xr-x. 4 tbrannon tbrannon 4096 Jan 16  2012 VAADIN
[tbrannon@oc2417102872 muntjac-play]$ ls -l VAADIN/widgetsets/org.muntiacus.MuntjacWidgetSet/org.muntiacus.MuntjacWidgetSet.nocache.js
-rw-rw-r--. 1 tbrannon tbrannon 9728 Jan 14  2012 VAADIN/widgetsets/org.muntiacus.MuntjacWidgetSet/org.muntiacus.MuntjacWidgetSet.nocache.js
[tbrannon@oc2417102872 muntjac-play]$ ls -l VAADIN/themes/reindeer/styles.css
-rw-r--r--. 1 tbrannon tbrannon 144061 Sep  5  2011 VAADIN/themes/reindeer/styles.css
[tbrannon@oc2417102872 muntjac-play]$

Terrence Brannon

unread,
Apr 4, 2013, 3:08:56 PM4/4/13
to mun...@googlegroups.com
I figured it out by searching through the archives - you just set contextRoot like so:


from muntjac.api import Application, Button, GridLayout, Label, Window


class HelloWorld(Application):

    def init(self):
        main = Window('Hello window')
        self.setMainWindow(main)

        main.addComponent(Label('Hello World!'))


if __name__ == '__main__':
    from muntjac.main import muntjac
    muntjac(HelloWorld, nogui=True, forever=True, debug=True,
            contextRoot='/home/tbrannon/prg/muntjac-play'
    )

Richard Lincoln

unread,
Apr 4, 2013, 3:12:20 PM4/4/13
to mun...@googlegroups.com
I was just about to point that out before you replied. Let us know if
your have any more issues.

Richard

On 04/04/13 21:08, Terrence Brannon wrote:
> I figured it out by searching through the archives - you just set
> contextRoot like so:
>
> from muntjac.api import Application, Button, GridLayout, Label, Window
>
>
> class HelloWorld(Application):
>
> def init(self):
> main = Window('Hello window')
> self.setMainWindow(main)
>
> main.addComponent(Label('Hello World!'))
>
>
> if __name__ == '__main__':
> from muntjac.main import muntjac
> muntjac(HelloWorld, nogui=True, forever=True, debug=True,
> * contextRoot='/home/tbrannon/prg/muntjac-play'*
> --
> You received this message because you are subscribed to the Google
> Groups "muntjac" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to muntjac+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages