[BlackBerry-Python] Design question re BlackBird (browser-based app inspector tool for Tart)

Jerónimo Barraco Mármol jerobarraco at yahoo.com.ar
Fri Nov 8 20:13:00 EST 2013


1st sorry for the delay.

1) is an awesome idea. i want to implement something like that for my app too but that means i can only contribute/help/rant if its not dependent exclusively on tart structure. Something implemented fully on python could be an interesting alternative because it could be shared, recycled at other projects and receive help from outer groups.

Which leads me to point:
2) i dont like reinventing the wheel and i bet there are many many python inspectors. ie i work using rpdb (https://pypi.python.org/pypi/rpdb/) well actually winpdb, which comes with a nice interface and is compatible with many products (ie commercial ides (jaycharm)) rpdb can be run and launched without interface too. the winpdb window is for the client.

also using the "decoupled module" technique could be interesting in case the module gets a considerable size or the user just wants to "strip" the debugging.

ps: on bottle.py: i work using tornado, and i find the best is just to dont use templates or complicated stuff, just static html+js and do all the communication over json, which has the advantage that is also usable on new interfaces or as an api.


regards


------------------------------
Peter Hansen  escribió el lun, 23 sep 2013 11:24 ART:

>So I spent the weekend learning WebSockets and implementing a proof-of-concept for "BlackBird". This is to be a "web inspector" type of utility that you can run in your browser to monitor the status of an app running on a device, poke at it, watch the log output, view live thread activity, maybe run Pdb in post-mortem mode, get an interactive Python console running in the context of the app, and probably even a JavaScript console running in the context of the QML as well. And just about anything else we can imagine.
>
>My first stab at this uses bottle.py (a decent little web micro-framework) with its own simple templating language to serve up some CSS, HTML, and JS to your browser. The client code can use the WebSocket API to connect back to the app, where I've hacked on top of bottle and WSGI an async WebSocket handler hooked into the app with a Queue. It even works. ;-)
>
>My question is whether that's an appropriate architecture. I'm now thinking it might make more sense to keep the web-server part out of the app, and have it be local to your dev environment, where you'd maybe just run "tart blackbird" and it would launch a local server (and your browser, opening it at the starting page). Same code could be used (bottle + templates etc) but it wouldn't be in the app. The app would have only the WebSocket service running, and none of the web stuff.
>
>With the existing model, you can connect from any browser any time... the app hosts everything itself.  The disadvantage is if the app fails, you can't get your initial connection so there's no web page to view.
>
>With the alternate approach, you need to run the server somewhere yourself, but it would let you load the BlackBird web app whether or not your app was running, and could act independently of it. For example, you could possibly do some degree of post-mortem analysis of failures even if the app had crashed, like on the latest log entries that were received. It could auto-reconnect to the app once it restarted, but preserve the older data as well, maybe even using WebStorage to persist it.
>
>Thoughts?
>
>-Peter
>
>P.S. BlackBird comes from the old rhyme "Four and twenty blackbirds, baked in a 'Py'..."  ;-) It seemed appropriate when I was first picturing it as a set of diagnostic tools (24 of them?) "baked" into a Tart app...  http://en.wikipedia.org/wiki/Sing_a_Song_of_Sixpence
>_______________________________________________
>BlackBerry-Python mailing list
>BlackBerry-Python at engcorp.com
>http://www.engcorp.com/mailman/listinfo/blackberry-python



More information about the BlackBerry-Python mailing list