Ejemplo n.º 1
0
from lino.etc.twisted import Resource


class Hello(Resource):
    #isLeaf = True
    def getChild(self, name, request):
        if name == '':
            return self
        return Resource.getChild(self, name, request)

    def render_GET(self, request):
        return """<html>
		<head>
		<title>Hello
		</title>
		</head>
      Hello, world!
		<p>I am located at %r
		<br>and postpath is %r.
		</html>""" % (request.prepath, request.postpath)


if __name__ == '__main__':
    db = demo.startup()
    resource = Hello()
    root = static.File(r't:\data\luc\www')
    root.putChild('hello', Hello())
    site = server.Site(root)
    reactor.listenTCP(8080, site)
    reactor.run()
Ejemplo n.º 2
0

class Hello(Resource):
   #isLeaf = True
	def getChild(self, name, request):
		if name == '':
			return self
		return Resource.getChild( self, name, request)

	def render_GET(self, request):
		return """<html>
		<head>
		<title>Hello
		</title>
		</head>
      Hello, world!
		<p>I am located at %r
		<br>and postpath is %r.
		</html>"""               % (request.prepath,request.postpath) 


if __name__ == '__main__':
	db = demo.startup()
	resource = Hello()
	root = static.File(r't:\data\luc\www')
	root.putChild('hello', Hello())
	site = server.Site(root)
	reactor.listenTCP(8080, site)
	reactor.run()

Ejemplo n.º 3
0
## This file is part of the Lino project.

## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## Lino is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
## License for more details.

## You should have received a copy of the GNU General Public License
## along with Lino; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

from lino.forms import gui

from lino.schemas.sprl import demo
from lino.schemas.sprl.tables import Partners

gui.parse_args()
#sess = demo.startup(ui=gui)
sess = demo.startup()
ds = sess.query(Partners, orderBy="name")

frm = gui.form(label="The first DataGrid Form")
frm.addDataGrid(ds)
frm.show()

Ejemplo n.º 4
0
"""
starts a medusa web server with Quixote, serving an adamo database
"""
if __name__ == "__main__":

    import os
    from quixote import enable_ptl
    enable_ptl()

    from lino.quix import default
    from lino.quix.serve import startServer

    from lino.schemas.sprl import demo

    #import webbrowser

    db = demo.startup(verbose=True)

    #webbrowser.open("http://localhost:8080",new=1)

    # serve.main(db)
    namespace = default.DatabaseNamespace(db)
    #default.setDatabase(db)
    configPath = os.path.dirname(default.__file__)
    startServer(namespace, db.getLabel(), configPath)
    #startServer(default,db.getLabel())
Ejemplo n.º 5
0
"""
starts a medusa web server with Quixote, serving an adamo database
"""
if __name__ == "__main__":
	
	import os
	from quixote import enable_ptl
	enable_ptl()

	from lino.quix import default 
	from lino.quix.serve import startServer

	from lino.schemas.sprl import demo

	#import webbrowser

	db = demo.startup(verbose=True)

	#webbrowser.open("http://localhost:8080",new=1)

	# serve.main(db)
	namespace = default.DatabaseNamespace(db)
	#default.setDatabase(db)
	configPath = os.path.dirname(default.__file__)
	startServer(namespace,db.getLabel(),configPath)
	#startServer(default,db.getLabel())