This package contains a graphical user interface for the openmdao framework.
Bases: cmd.Cmd
Object which knows how to load a model and provides a command line interface and various methods to access and modify that model.
Called on an input line when the command prefix is not recognized. In that case we execute the line as Python code.
delete file from project returns False if file was not found, otherwise returns True
Returns True if the given file (assumed to be a file in the project) has classes that have been instantiated in the current process. Note that this doesn’t keep track of removes/deletions, so if an instance was created earlier and then deleted, it will still be reported.
get list of source variables, destination variables and the connections between them
get the container with the specified pathname returns the container and the name of the root object
get the structure of the specified assembly, or of the global namespace if no pathname is specified, consisting of the list of components and the connections between them (i.e. the dataflow)
Have to override this because base class version strips the lines, making multi-line Python commands impossible.
Bases: object
Object that keeps track of a collection of files (i.e. a directory) and optionally publishes an update when the collection is modified
delete file in working directory returns False if file was not found, otherwise returns True
create directory in working directory (does nothing if directory already exists)
Bases: openmdao.gui.handlers.ReqHandler
shut it down, try to close the browser window
Bases: openmdao.gui.handlers.ReqHandler
lets users log into the application simply by specifying a nickname, which is then saved in a cookie.
Bases: openmdao.gui.handlers.ReqHandler
lets users log out of the application simply by deleting the nickname cookie
Bases: tornado.web.StaticFileHandler
retrieve docs for a plugin
Bases: openmdao.gui.handlers.ReqHandler
Add a project to the project database. This extracts the project file into a directory under the users projects directory.
Bases: openmdao.gui.handlers.ReqHandler
delete a project
Bases: openmdao.gui.handlers.ReqHandler
get/set project details
Bases: openmdao.gui.handlers.ReqHandler
download a copy of the project
Bases: openmdao.gui.handlers.ReqHandler
get project list
Bases: openmdao.gui.handlers.ReqHandler
create a new (empty) project
Bases: openmdao.gui.handlers.ReqHandler
addon installation utility Eventually we will probably wrap the OpenMDAO plugin functions to work through here.
Bases: openmdao.gui.handlers_workspace.ReqHandler
get the command, send it to the cserver, return response
Bases: openmdao.gui.handlers_workspace.ReqHandler
add, get, or remove a component
Bases: openmdao.gui.handlers_workspace.ReqHandler
get connections between two components in an assembly
Bases: openmdao.gui.handlers_workspace.ReqHandler
get the structure of the specified assembly, or of the global namespace if no pathname is specified, consisting of the list of components and the connections between them (i.e. the dataflow)
Bases: openmdao.gui.handlers_workspace.ReqHandler
if a filename is POSTed, have the cserver execute the file otherwise just run() the project
Bases: openmdao.gui.handlers_workspace.ReqHandler
get/set the specified file/folder
Bases: openmdao.gui.handlers_workspace.ReqHandler
get a list of the users files in JSON format
Bases: openmdao.gui.handlers_workspace.ReqHandler
POST: get a new model (delete existing console server) GET: get JSON representation of the model
Bases: openmdao.gui.handlers_workspace.ReqHandler
get the data for a slotable object (including components)
Bases: openmdao.gui.handlers_workspace.ReqHandler
return the url of the zmq outstream server,
Bases: openmdao.gui.handlers_workspace.ReqHandler
GET: open a websocket server to supply updated valaues for the specified variable
Bases: openmdao.gui.handlers_workspace.ReqHandler
GET: start up an empty workspace and prepare to load a project.
POST: commit the current project
Bases: openmdao.gui.handlers_workspace.ReqHandler
GET: load model fom the given project archive, or reload remembered project for session if no file given
Bases: openmdao.gui.handlers_workspace.ReqHandler
POST: revert back to the most recent commit of the project
Bases: openmdao.gui.handlers_workspace.ReqHandler
GET: tell the server to publish the specified topic/variable
Bases: openmdao.gui.handlers_workspace.ReqHandler
return the url of the zmq publisher server
Bases: openmdao.gui.handlers_workspace.ReqHandler
replace a component
Bases: openmdao.gui.handlers.ReqHandler
render the base template
Bases: openmdao.gui.handlers_workspace.ReqHandler
initialize the server manager & render the workspace
Bases: openmdao.gui.handlers_workspace.ReqHandler
get hierarchy of package/types to populate the Palette
Bases: openmdao.gui.handlers_workspace.ReqHandler
file upload utility
Bases: openmdao.gui.handlers_workspace.ReqHandler
GET: get a value for the given pathname TODO: combine with ComponentHandler? handle Containers as well?
Bases: openmdao.gui.handlers_workspace.ReqHandler
get a command to set a variable, send it to the cserver, return response
Bases: openmdao.gui.handlers_workspace.ReqHandler
render the workspace
OpenMDAO GUI
This graphical user interface for OpenMDAO is implemented as a web application.
Running this file will start a tornado web server on a local port and open a browser on that port. An up-to-date version of Chrome or Firefox with support for WebSockets is required.
Bases: tornado.web.Application
openmdao web application extends tornado web app with URL mappings, settings and server manager
Bases: openmdao.main.factory.Factory
A Factory that watches a Project directory and dynamically keeps the set of available types up-to-date as project files change.
If this factory is removed from the FactoryManager during execution, this function will stop the watchdog observer thread.
The Projects object provides a basic interface for interacting with the project database used by the GUI.
Bases: object
Get a dictionary containing the fields for a project id.
Get a dictionary containing the fields that belong to a project with a specific path.
Return a list of dictionaries for all projects owned by the user. Each dictionary contains all fields for that project id.
Update metadate modification time-stamp for project_id, setting ‘modified’ to the current time/date.
Insert a new row into the project database.
Predict what the next auto-inserted rowid will be. This is here because the GUI handlers need to know the project_id even before the row is inserted.
Ref: http://caines.ca/blog/programming/sessions-in-tornado (27 OCT/09)
In case anyone’s interested, here’s my sessions.py that I use for doing a pickle-based session (stored as a file in a directory of your choosing) in Tornado. Feel free to use it however you please. If I write something more scalable one day, I’ll post it too.
Usage: In your application script, settings[“session_secret”] = ‘some secret password!!’ settings[“session_dir”] = ‘sessions’ # the directory to store sessions in application.session_manager = session.TornadoSessionManager(settings[“session_secret”], settings[“session_dir”])
In your RequestHandler (probably in __init__), self.session = session.TornadoSession(self.application.session_manager, self)
After that, you can use it like this (in get(), post(), etc): self.session[‘blah’] = 1234 self.save() blah = self.session[‘blah’]
etc.
the basic session mechanism is this: * take some data, pickle it, store it somewhere. * assign an id to it. run that id through a HMAC (NOT just a hash function) to prevent tampering. * put the id and HMAC output in a cookie. * when you get a request, load the id, verify the HMAC. if it matches, load the data from wherever you put it and depickle it.
Bases: dict
A Session is basically a dict with a session_id and an hmac_digest string to verify access rights
Bases: object
SessionManager handles the cookie and file read/writes for a Session
Bases: openmdao.gui.session.Session
A TornadoSession is a Session object for use in Tornado
Bases: openmdao.gui.session.SessionManager
A TornadoSessionManager is a SessionManager that is specifically for use in Tornado, using Tornado’s cookies
utility functions used by openmdao gui
create a nested dictionary for a file structure with names relative to the starting directory.
Look for an executable given a list of the possible names
launch web browser on specified port try to use preferred browser if specified, fall back to default (chrome will launch in “app mode”)
Return a document node contains a directory tree for the path. modified version of: http://code.activestate.com/recipes/305313-xml-directory-tree/
Bases: object
creates and keeps track of ZMQ servers for the given class
get the output socket web server for the server associated with an id, create one if none exists
get the url of the output socket for the server associated with an id
get the publisher socket web server for the server associated with an id, create one if none exists
Bases: tornado.web.Application
a web application that serves a ZMQStream over a WebSocket
Bases: tornado.websocket.WebSocketHandler
a handler that forwards output from a ZMQStream to a WebSocket
Bases: object
runs an http server that serves a ZMQStream over a WebSocket