[FRPythoneers] Introduction: Me and my pet project ( attempt #3 )

David J W frpythoneerslist at ominian.net
Sat Jan 23 23:15:54 MST 2010

    So quick introduction:  My name is David and I've been partially lurking
on the Front range Python list for a few years now.   About me, I think I
have a pretty normal background for the software developer/engineer
 background, wrote my first program in basic as a kid then somewhere around
my teen's and I decided I wanted to be a game developer so I taught myself
c/c++.   Mysteriously I didn't end up being a game developer but ended up
writing a lot of business software... I think this story holds true for a
lot of people.   That said I started learning/using Python 2.4 in 2007 and
have found it difficult to find any serious fault with the language itself,
plus because of the enforced whitespace markup and the BDFL's style of
language design it's hard to accidentally write abomination-ware.

    A personnel running joke for me has been the following.  I've been on
teams that have created fail-safe mission critical applications, naively
developed an enterprise grade MVC framework from scratch ( such a bad idea
in retrospect ), helped refactor large scale applications, and the point is
I am pretty comfortable in complicated projects or environments.  Inversely,
like an idiot savant that can recite from memory the first 1000 digits of PI
but can't tie his shoes, I have had a running short list of web app's I
would like to write from start to finish. Longest standing project has been
some sort of text based adventure and then the more recent has been to make
a blog.  Neither is really complicated or poses a problem with
implementation but it seems like a day after I start working on these two
projects something bigger/better comes up and I quickly forget about it.
Alas I started this month with the thought, I am going to write a web based
text adventure in my spare time but ended up having more fun writing the
platform for the game.

Project: WebMud ( possibly going to be remained pymethius as a work play on
Python  & Prometheus )

   Which leads to my current pet project. I wanted to write a Ajax driven
multi-user dungeon game ( preferably text-based ).  I made a list of
features it would need, then worked backwards to figure out how to implement

   To create a near-real time responsive base, I decided I needed a comet (
http://en.wikipedia.org/wiki/Comet_(programming) ) driven framework.  Comet
was then promptly replaced by web sockets (
http://en.wikipedia.org/wiki/Web_Sockets ) which allowed event driven
communication between client & server.  First major problem was that all of
the Python based MVC frameworks don't really support web sockets out of the
box without some serious hacking ( WSGI app's are great but I don't know any
that work specifically in async. environments )   Doing a lot more research
I stumbled upon the ultimate solution with Orbited ( http://orbited.org/ )  as
the middleman.

   Since Orbited also provides a simple static content web server to boot,
that resolved a requirement for a static content server.  Which brought
around the idea of using twisted to provide application logic in the form of
a hybrid JSON-RPC server.  The best way I can explain this is to walk
through how the project works:

User goes to the site hosting the project using the latest generation
browser ( Firefox 3.5, Chrome, latest Safari, MSIE 8 ) and loads up a blank
webpage with ExtJS plus support libraries that implements the JSON-RPC
protocol in Javascript.
On document ready the Client via connects to a firewalled JSON-RPC server
via Orbited.
On connect, WebMud currently sends a request back to the client to load the
Auth module. *1
Client dynamically loads the specified module.
Client side Auth is a self starting module, using ExtJS, it shows a standard
username/password dialog box.
When the user clicks login via the Auth dialog, this is translated out to a
request and is handled by a corresponding authority handler on the server
On success, the server side authority handler escalates the user's
privileges and tells the client to load it's system console app, which I
modeled after this (
http://www.extjs.com/deploy/dev/examples/desktop/desktop.html )  *2
As soon as the system console is loaded, the core client logic notifies the
server and the server spits out a series of requests in one transaction,
giving the client a list of other modules to load.

>From this point on, the user has a start menu and web desktop, any module
previously granted can be run like it was a desktop app.*3

Tying the above in with HTML 5's local/session storage to track UI
preferences ( size, position ) and some miscellaneous details and you've got
a mostly rock solid platform to build event driven web apps.

*1 Eventually the server can defer/delay client logins based on load or tell
the client to connect to a different application server entirely.
*2  As soon as a client connects, it is bestowed anonymous user rights which
currently means the Auth module & basic Auth handler.  The process of
login/escalation deletes the anonymous user instance class and replaces it
with an appropriate type ( normal user, admin user, application XYZ user,
etc ).
*3 Because of how RPC services are exposed to the user, as a on demand
created delegate structure, it would be very difficult if not impossible for
a malicious user to access a handler it hasn't been granted permission to
access... the handler instance doesn't exist for that user's scope.

  So far everything above has been implemented and is in a stable Alpha, I
am currently hashing out a model system and pulling the application tier of
logic out of the server package itself and into it's own package.  Also in
progress is a proof of concept idea a potential client/employer gave me
about making a web based text editor/file system manager that ultimately
would allow a person to write a c/c++ source file then have it compiled by a
batch processor.  That's 100% separated from WebMud ( my project's name,
name already used by many other abandoned projects ) which leaves me with
the thought to ultimately open source the platform but before I did I was
hoping to fill it out some more and bring it up to professional grade. That
said,  anyone interested in collaborating with me?

    David W.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.community.tummy.com/pipermail/frpythoneers/attachments/20100123/97217bab/attachment.html>

More information about the FRPythoneers mailing list