openquake.server package¶
Subpackages¶
Submodules¶
openquake.server.dbserver module¶
- class openquake.server.dbserver.DbServer(db, address, num_workers=5)[source]¶
Bases:
object
A server collecting the received commands into a queue
openquake.server.manage module¶
openquake.server.middleware module¶
- class openquake.server.middleware.LoginRequiredMiddleware(get_response)[source]¶
Bases:
object
Middleware that requires a user to be authenticated to view any page other than LOGIN_URL. Exemptions to this requirement can be specified in settings via a list of regular expressions in LOGIN_EXEMPT_URLS.
Requires authentication middleware and template context processors to be loaded. You’ll get an error if they aren’t.
openquake.server.settings module¶
openquake.server.urls module¶
openquake.server.utils module¶
- openquake.server.utils.check_webserver_running(url='http://localhost:8800', max_retries=30)[source]¶
Returns True if a given URL is responding within a given timeout.
- openquake.server.utils.get_acl_on(request)[source]¶
Returns True if ACL should be honorated, returns otherwise False.
- openquake.server.utils.get_user(request)[source]¶
Returns the users from request if authentication is enabled, otherwise returns the default user (from settings, or as reported by the OS).
- openquake.server.utils.get_valid_users(request)[source]¶
” Returns a list of users based on groups membership. Returns a list made of a single user when it is not member of any group.
- openquake.server.utils.is_superuser(request)[source]¶
Without authentication (settings.LOCKDOW is false) every user is considered a superuser, otherwise look at the attribute request.user.is_superuser.
openquake.server.views module¶
- openquake.server.views.DEFAULT_EXPORT_TYPE = 'xml'¶
For exporting calculation outputs, the client can request a specific format (xml, geojson, csv, etc.). If the client does not specify give them (NRML) XML by default.
- openquake.server.views.aelo_callback(job_id, job_owner_email, outputs_uri, inputs, exc=None)[source]¶
- openquake.server.views.save_pik(job, dirname)[source]¶
Save a LogContext object in pickled format; returns the path to it
- openquake.server.views.store(request_files, ini, calc_id)[source]¶
Store the uploaded files in calc_dir and select the job file by looking at the .ini extension.
- Returns
full path of the ini file