So, there is lots of fun to had with web2py with pyQT. It just depends
on the end goal.
I embed web2py within an automation framework, which despite this and
a few other pieces, turns out to be pretty light on its feet (not a
huge footprint for users to download). So, doing this, web2py comes in
VERY handy both in and outside of the web context. the automation (aka
'blueLite') uses DAL to handle the data layer, completely. Since
blueLite is almost all python, it makes use of many features of
web2py, even outside of a browser. Also, since each instance of
blueLite has web2py within its folder structure, anyone making use of
blueLite, can also make use of web2py, the full webApp server. The
built in applications that come baked in, make good use of the
blueLite modules as well. once, I get the one-button-click deployement
working, well... imagine having a local web2py server sitting on
developers desktops. Distributed development efforts, with the right
applications, will gain a lot from a collaboration perspective.
This is what I tried this morning, with minimal effort. I can create a
pyQT application with different widgets in the mainWindow to handle
different scenarios. For example, I can have an interface to blueLite,
which by it self is headless, and I can manipulate and execute
different features of blueLite and provide data to them through this
UI. I can also, have a webView widget (which is just a browser
window). With this, I can have a dropdown menu (or anything really)
and have it start up and point to the local web2py server, or have
point to a remote server simply by choosing it in the drop-down menu.
By doing so, this becomes an easy-to-put-together desktop application
which makes use of a browser widget, but isn't a browser, because
users can't enter a URL. It will only navigate the web2py applications
(this is intentional, they can use a full browser to browse the net.
As Blackthorn points out, this would make a great DB viewer for users
who need to retrive data from either the local or remote DB. Querying
DBs (or what ever the action is) with buttons that execute sql queries
isn't a hard thing (thanks to Massimo's work), because I don't have to
use QT's built-in DB and TAble libraries, I can simply use the DAL as
I do with blueLite.
My plan is to start with this and see what comes of it. A good and
easy way would be to have that desktop app (bundled with blueLite and
web2py) and have it work in to ways. 1) with blueLite directly as a
desktop app (which already comes with web2py so I can use that to) and
2) still as a desktop app but through a webView widget, so I can
access web2py, the webAppserver. I can see where plugin_wiki would be
a great place to start since the work involved is just adding those
pages to the wiki and have them to whatever is needed, then have the
pyQT app point to those pages that display very well within this non-
browser browser application.
Again, minimal effort, great looking front that does indeed work well
with web2py.
Why not simply use pyjamas? Because I want to use web2py. web2py is a
full framework, pyjamas is not. I could use pyjamas with the app, but
then I would use it with web2py, and have pyQT use web2py to get to
pyjamas... (no real or immediate benefit there). So, in fact, web2py
will now be used in 3 separate environments. As the back end to a
headless automation framework, 2) as the great webApp sevrer it is and
3) as a bundled up backend service to a desktop desktop application.
Thanks,
Mart :)