sirepo package¶
Subpackages¶
- sirepo.pkcli package
- Submodules
- sirepo.pkcli.admin module
- sirepo.pkcli.cookie module
- sirepo.pkcli.db module
- sirepo.pkcli.elegant module
- sirepo.pkcli.hellweg module
- sirepo.pkcli.jspec module
- sirepo.pkcli.myapp module
- sirepo.pkcli.rs4pi module
- sirepo.pkcli.service module
- sirepo.pkcli.shadow module
- sirepo.pkcli.srw module
- sirepo.pkcli.synergia module
- sirepo.pkcli.warppba module
- sirepo.pkcli.warpvnd module
- sirepo.pkcli.zgoubi module
- Module contents
- sirepo.runner package
- sirepo.template package
- Submodules
- sirepo.template.adm module
- sirepo.template.elegant module
- sirepo.template.elegant_command_importer module
- sirepo.template.elegant_command_parser module
- sirepo.template.elegant_common module
- sirepo.template.elegant_lattice_importer module
- sirepo.template.elegant_lattice_parser module
- sirepo.template.hellweg module
- sirepo.template.hellweg_dump_reader module
- sirepo.template.jspec module
- sirepo.template.line_parser module
- sirepo.template.myapp module
- sirepo.template.rs4pi module
- sirepo.template.sdds_util module
- sirepo.template.shadow module
- sirepo.template.srw module
- sirepo.template.srw_importer module
- sirepo.template.srwl_uti_brightness module
- sirepo.template.synergia module
- sirepo.template.template_common module
- sirepo.template.warppba module
- sirepo.template.warpvnd module
- sirepo.template.zgoubi module
- sirepo.template.zgoubi_importer module
- sirepo.template.zgoubi_parser module
- Module contents
Submodules¶
sirepo.api_auth module¶
sirepo.api_perm module¶
decorators for API permissions and the permissions themselves
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
class
sirepo.api_perm.
APIPerm
(*args, **kwds)[source]¶ Bases:
aenum.Flag
-
ALLOW_COOKIELESS_USER
= <APIPerm.ALLOW_COOKIELESS_USER: 1>¶
-
ALLOW_LOGIN
= <APIPerm.ALLOW_LOGIN: 2>¶
-
ALLOW_VISITOR
= <APIPerm.ALLOW_VISITOR: 4>¶
-
REQUIRE_USER
= <APIPerm.REQUIRE_USER: 8>¶
-
-
sirepo.api_perm.
ATTR
= 'api_perm'¶ decorator sets this attribute with an APIPerm
-
sirepo.api_perm.
allow_login
(func)¶
-
sirepo.api_perm.
allow_visitor
(func)¶
-
sirepo.api_perm.
require_user
(func)¶
sirepo.base_pkconfig module¶
Default config
copyright: | Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.beaker_compat module¶
sirepo.bluesky module¶
sirepo.celery_tasks module¶
sirepo.comsol_register module¶
sirepo.cookie module¶
User state management via an HTTP cookie
copyright: | Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
A mock cookie for pkcli
Bypasses the state where the cookie has not come back from the client. This is used by bluesky and testing only, right now.
sirepo.crystal module¶
Get polarizability from X0h server (http://x-server.gmca.aps.anl.gov/x0h.html). For details see http://x-server.gmca.aps.anl.gov/pub/Stepanov_CR_1991_08.pdf.
-
sirepo.crystal.
calc_bragg_angle
(d, energy_eV, n=1)[source]¶ Calculate Bragg angle from the provided energy and d-spacing.
Parameters: Returns: - the resulted dictionary with:
lamda (float): wavelength [nm]. bragg_angle (float): Bragg angle [rad]. bragg_angle_deg (float): Bragg angle [deg].
Return type:
-
sirepo.crystal.
get_crystal_parameters
(material, energy_eV, h, k, l)[source]¶ Obtain parameters for the specified crystal and energy.
Parameters: Returns: - crystal parameters:
d (float): interplanar spacing (d-spacing) [A]. xr0 (float): real part of the 0-th Fourier component of crystal’s polarizability. xi0 (float): imaginary part of the 0-th Fourier component of crystal’s polarizability. xrh (float): real part of the H-th Fourier component of crystal’s polarizability (Sigma polarization). xih (float): imaginary part of the H-th Fourier component of crystal’s polarizability (Sigma polarization). bragg_angle_deg (float): Bragg angle [deg].
Return type:
sirepo.exporter module¶
Export simulations in a single archive
copyright: | Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.feature_config module¶
List of features available
copyright: | Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
sirepo.feature_config.
cfg
= OrderedMapping(api_modules=(), rs4pi_dose_calc=False, sim_types=('srw', 'warppba', 'elegant', 'shadow', 'hellweg', 'warpvnd', 'rs4pi', 'jspec', 'synergia', 'myapp', 'adm', 'zgoubi'), srw=OrderedMapping(mask_in_toolbar=True), warpvnd=OrderedMapping(allow_3d_mode=True, display_test_boxes=True))¶ Configuration
sirepo.http_reply module¶
response generation
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.http_request module¶
request input parsing
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.hundli_console module¶
Hundli: a dog height and weight simulation engine
This is not technically part of Sirepo. It demonstrates a arbitrary 3rd party code, which Sirepo calls as an independent program.
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.importer module¶
Import a single archive
copyright: | Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
sirepo.importer.
do_form
(form)[source]¶ Self-extracting archive post
Parameters: form (flask.request.Form) – what to import Returns: data Return type: dict
sirepo.mpi module¶
Run Python processes in background
copyright: | Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.oauth module¶
sirepo.server module¶
sirepo.simulation_db module¶
Simulation database
copyright: | Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
sirepo.simulation_db.
JSON_SUFFIX
= '.json'¶ Json files
-
sirepo.simulation_db.
RESOURCE_FOLDER
= local('/home/docs/checkouts/readthedocs.org/user_builds/sirepo/checkouts/latest/sirepo/package_data')¶ The root of the pkresource tree (package_data)
-
sirepo.simulation_db.
SCHEMA_COMMON
= {u'appInfo': {u'warpvnd': {u'shortName': u'Warp VND', u'longName': u'Warp VND'}, u'zgoubi': {u'shortName': u'ZGOUBI', u'longName': u'ZGOUBI'}, u'jspec': {u'shortName': u'JSPEC', u'longName': u'JSPEC'}, u'rs4pi': {u'shortName': u'RS4PI', u'longName': u'RS4PI'}, u'elegant': {u'shortName': u'Elegant', u'longName': u'elegant'}, u'srw': {u'shortName': u'SRW', u'longName': u'Synchrotron Radiation Workshop'}, u'myapp': {u'shortName': u'MyApp', u'longName': u'MyApp'}, u'shadow': {u'shortName': u'SHADOW', u'longName': u'SHADOW'}, u'adm': {u'shortName': u'Sirepo Admin', u'longName': u'Sirepo Admin'}, u'synergia': {u'shortName': u'Synergia', u'longName': u'Synergia'}, u'warppba': {u'shortName': u'Warp PBA', u'longName': u'Warp PBA'}, u'hellweg': {u'shortName': u'Hellweg', u'longName': u'Hellweg'}}, u'common': {u'cookies': {u'getStarted': {u'name': u'strt', u'value': u'a'}, u'login': {u'timeout': 1, u'name': u'login', u'value': u'a'}, u'listView': {u'valType': u'b', u'name': u'lv', u'value': False}, u'firstVisit': {u'name': u'1st_vis', u'value': u'a'}}, u'staticFiles': {u'externalLibs': {u'css': [u'bootstrap-3.3.7.min.css', u'bootstrap-colxl.css', u'bootstrap-toggle.min.css', u'katex.min.css', u'cookieconsent.min.css'], u'js': [u'angular.min.js', u'jquery-2.2.4.min.js', u'cookieconsent.min.js']}, u'sirepoLibs': {u'css': [u'sirepo.css'], u'js': [u'sirepo.js']}}, u'enum': {u'ColorMap': [[u'grayscale', u'grayscale'], [u'viridis', u'viridis'], [u'afmhot', u'afmhot'], [u'coolwarm', u'coolwarm'], [u'jet', u'jet']]}, u'localRoutes': {u'simulationsFolder': {u'route': u'/simulations/:folderPath?', u'config': {u'controller': u'SimulationsController as simulations', u'templateUrl': u'/static/html/simulations.html'}}, u'notFound': {u'route': u'/not-found', u'config': {u'templateUrl': u'/static/html/not-found.html'}}, u'forbidden': {u'route': u'/forbidden', u'config': {u'templateUrl': u'/static/html/forbidden.html'}}, u'notAuthorized': {u'route': u'/missing-cookies', u'config': {u'templateUrl': u'/static/html/not-authorized.html'}}, u'loggedOut': {u'route': u'/logged-out', u'config': {u'controller': u'LoggedOutController as loggedOut', u'templateUrl': u'/static/html/logged-out.html'}}, u'source': {u'route': u'/source/:simulationId'}, u'simulations': {u'route': u'/simulations', u'config': {u'controller': u'SimulationsController as simulations', u'templateUrl': u'/static/html/simulations.html'}, u'isDefault': True}, u'notFoundCopy': {u'route': u'/copy-session/:simulationIds/:section', u'config': {u'controller': u'NotFoundCopyController as notFoundCopy', u'templateUrl': u'/static/html/copy-session.html'}}}, u'notifications': {u'getStarted': {u'content': u'', u'active': True, u'cookie': u'getStarted', u'name': u'getStarted'}, u'login': {u'content': u'', u'active': False, u'delay': 1, u'cookie': u'login', u'name': u'login'}}, u'dynamicFiles': {u'externalLibs': {u'js': [u'angular-cookies.min.js', u'angular-route.min.js', u'bootstrap-3.3.7.min.js', u'bootstrap-toggle.min.js', u'ngDraggable.js', u'stacktrace-0.6.4.js', u'colorbar.js', u'canvg-and-dependencies.js', u'FileSaver.js', u'Blob.js', u'canvas-toBlob.js', u'd3-3.5.9.min.js', u'fontdetect-0.3.js', u'ie10-viewport-bug-workaround.js', u'katex.min.js']}, u'sirepoLibs': {u'js': [u'sirepo-common.js', u'sirepo-components.js', u'sirepo-plotting.js', u'sirepo-plotting-vtk.js', u'sirepo-geometry.js']}, u'libURLs': [u'/user-state']}, u'model': {u'simFolder': {u'name': [u'Folder Name', u'SafePath'], u'parent': [u'Parent Folder', u'UserFolder']}, u'simulation': {u'notes': [u'Notes', u'Text', u''], u'documentationUrl': [u'Documentation URL', u'OptionalString', u''], u'folder': [u'Folder', u'UserFolder'], u'name': [u'Name', u'SimulationName']}}, u'view': {u'simFolder': {u'advanced': [u'name', u'parent'], u'title': u'New Folder'}, u'simulation': {u'advanced': [u'name', u'folder', u'notes'], u'title': u'Simulation'}, u'simDoc': {u'model': u'simulation', u'advanced': [u'documentationUrl'], u'title': u'Simulation Documentation'}}, u'constants': {u'oneDayMillis': 86400000, u'clientCookie': u'sirepo_cookie_js'}, u'appModes': {u'default': {u'localRoute': u'source', u'includeMode': False}}}, u'customErrors': {u'404': {u'url': u'not-found.html', u'msg': u'File Not Found', u'route': u'notFound'}, u'403': {u'url': u'forbidden.html', u'msg': u'Forbidden', u'route': u'forbidden'}, u'401': {u'url': u'not-authorized.html', u'msg': u'Missing Cookies', u'route': u'notAuthorized'}, u'422': {u'url': u'srw-magnet-file-error.html', u'msg': u'Invalid Magnet File'}, u'502': {u'url': u'server-error.html', u'msg': u'Proxy Error'}, u'500': {u'url': u'server-error.html', u'msg': u'Server Error'}}, u'productInfo': {u'shortName': u'Sirepo', u'longName': u'Sirepo'}, u'route': {u'importFile': u'/import-file/?<simulation_type>', u'getApplicationData': u'/get-application-data/?<filename>', u'userState': u'/user-state', u'robotsTxt': u'/robots.txt', u'copyNonSessionSimulation': u'/copy-non-session-simulation', u'downloadFile': u'/download-file/<simulation_type>/<simulation_id>/<filename>', u'favicon': u'/favicon.ico', u'simulationSchema': u'/simulation-schema', u'pythonSource': u'/python-source/<simulation_type>/<simulation_id>/?<model>/?<report>', u'blueskyAuth': u'/bluesky-auth', u'copySimulation': u'/copy-simulation', u'updateFolder': u'/update-folder', u'listSimulations': u'/simulation-list', u'homePage': u'/about', u'findByName': u'/find-by-name/<simulation_type>/<application_mode>/<simulation_name>', u'oauthLogin': u'/login/<simulation_type>/<oauth_type>', u'simulationFrame': u'/simulation-frame/<frame_id>', u'comsol': u'/comsol', u'uploadFile': u'/upload-file/<simulation_type>/<simulation_id>/<file_type>', u'errorLogging': u'/error-logging', u'srUnit': u'/ srunit', u'deleteFile': u'/delete-file', u'oauthAuthorized': u'/oauth-authorized/<oauth_type>', u'listFiles': u'/file-list/<simulation_type>/<simulation_id>/<file_type>', u'srwLight': u'/light', u'saveSimulationData': u'/save-simulation', u'downloadDataFile': u'/download-data-file/<simulation_type>/<simulation_id>/<model>/<frame>/?<suffix>', u'runStatus': u'/run-status', u'importArchive': u'/import-archive', u'simulationData': u'/simulation/<simulation_type>/<simulation_id>/<pretty>/?<section>', u'deleteSimulation': u'/delete-simulation', u'runSimulation': u'/run-simulation', u'staticFile': u'/static/*<path_info>', u'getServerData': u'/get-server-data/?<id>', u'exportArchive': u'/export-archive/<simulation_type>/<simulation_id>/<filename>', u'comsolRegister': u'/comsol-register', u'newSimulation': u'/new-simulation', u'oauthLogout': u'/logout/<simulation_type>', u'runCancel': u'/run-cancel', u'root': u'/<simulation_type>'}, 'version': '20181220.231326'}¶ Schema common values, e.g. version
-
sirepo.simulation_db.
SIMULATION_DATA_FILE
= 'sirepo-data.json'¶ Simulation file name is globally unique to avoid collisions with simulation output
-
sirepo.simulation_db.
STATIC_FOLDER
= local('/home/docs/checkouts/readthedocs.org/user_builds/sirepo/checkouts/latest/sirepo/package_data/static')¶ Where server files and static files are found
-
sirepo.simulation_db.
app_version
()[source]¶ Force the version to be dynamic if running in dev channel
Returns: chronological version Return type: str
-
sirepo.simulation_db.
celery_queue
(data)[source]¶ Which queue to execute simulation in
Parameters: data (dict) – simulation parameters Returns: celery queue name Return type: str
-
sirepo.simulation_db.
cfg
= OrderedMapping(nfs_sleep=0.5, nfs_tries=10)¶ configuration
-
sirepo.simulation_db.
default_data
(sim_type)[source]¶ New simulation base data
Parameters: sim_type (str) – simulation type Returns: simulation data Return type: dict
-
sirepo.simulation_db.
delete_simulation
(simulation_type, sid)[source]¶ Deletes the simulation’s directory.
-
sirepo.simulation_db.
fixup_old_data
(data, force=False)[source]¶ Upgrade data to latest schema and updates version.
Parameters: Returns: upgraded data bool: True if data changed
Return type:
-
sirepo.simulation_db.
generate_json
(data, pretty=False)[source]¶ Convert data to JSON to be send back to client
Use only for responses. Use :func:write_json to save. :param data: what to format :type data: dict :param pretty: pretty print [False] :type pretty: bool
Returns: formatted data Return type: str
-
sirepo.simulation_db.
hack_nfs_write_status
(status, run_dir)[source]¶ Verify status file exists before writing.
NFS doesn’t propagate files immediately so there is a race condition when the celery worker starts. This file handles this case.
Parameters: - status (str) – pending, running, completed, canceled
- run_dir (py.path) – where to write the file
-
sirepo.simulation_db.
init_by_server
(app)[source]¶ Avoid circular import by explicit call from sirepo.server.
Parameters: app (Flask) – flask instance
-
sirepo.simulation_db.
is_parallel
(data)[source]¶ Is this report a parallel (long) simulation?
Parameters: data (dict) – report and models Returns: True if parallel job Return type: bool
-
sirepo.simulation_db.
job_id
(data)[source]¶ A Job is a simulation and report name.
A jid is words and dashes.
Parameters: data (dict) – extract sid and report Returns: unique name Return type: str
-
sirepo.simulation_db.
json_filename
(filename, run_dir=None)[source]¶ Append JSON_SUFFIX if necessary and convert to str
Parameters: - filename (py.path or str) – to convert
- run_dir (py.path) – which directory to joing
Returns: filename.json
Return type: py.path
-
sirepo.simulation_db.
lib_dir_from_sim_dir
(sim_dir)[source]¶ Path to lib dir from simulation dir
Parameters: sim_dir (py.path) – simulation dir Returns: directory name Return type: py.path
-
sirepo.simulation_db.
move_user_simulations
(to_uid)[source]¶ Moves all non-example simulations for the current session into the target user’s dir.
-
sirepo.simulation_db.
open_json_file
(sim_type, path=None, sid=None, fixup=True)[source]¶ Read a db file and return result
Parameters: Returns: data
Return type: Raises: CopyRedirect
– if the simulation is in another user’s
-
sirepo.simulation_db.
parse_sid
(data)[source]¶ Extract id from data
Parameters: data (dict) – models or request Returns: simulationId from data Return type: str
-
sirepo.simulation_db.
parse_sim_ser
(data)[source]¶ Extract simulationStatus from data
Parameters: data (dict) – models or request Returns: simulationSerial Return type: int
-
sirepo.simulation_db.
poll_seconds
(data)[source]¶ Client poll period for simulation status
TODO(robnagler) needs to be encapsulated
Parameters: data (dict) – must container report name Returns: number of seconds to poll Return type: int
-
sirepo.simulation_db.
prepare_simulation
(data)[source]¶ Create and install files, update parameters, and generate command.
Copies files into the simulation directory (
run_dir
). Updates the parameters indata
and save. Generate the pkcli command to pass to task runner.Parameters: data (dict) – report and model parameters Returns: pkcli command, simulation directory Return type: list, py.path
-
sirepo.simulation_db.
read_json
(filename)[source]¶ Read data from json file
Parameters: filename (py.path or str) – will append JSON_SUFFIX if necessary Returns: json converted to python Return type: object
-
sirepo.simulation_db.
read_result
(run_dir)[source]¶ Read result data file from simulation
Parameters: run_dir (py.path) – where to find output Returns: result or describes error Return type: dict
-
sirepo.simulation_db.
read_simulation_json
(sim_type, *args, **kwargs)[source]¶ Calls open_json_file and fixes up data, possibly saving
Parameters: sim_type (str) – simulation type Returns: simulation data Return type: data (dict)
-
sirepo.simulation_db.
read_status
(run_dir)[source]¶ Read status from simulation dir
Parameters: run_dir (py.path) – where to read
-
sirepo.simulation_db.
report_info
(data)[source]¶ Read the run_dir and return cached_data.
Only a hit if the models between data and cache match exactly. Otherwise, return cached data if it’s there and valid.
Parameters: data (dict) – parameters identifying run_dir and models or reportParametersHash Returns: report parameters and hashes Return type: Dict
-
sirepo.simulation_db.
save_simulation_json
(data, do_validate=True)[source]¶ Prepare data and save to json db
Parameters: data (dict) – what to write (contains simulationId)
-
sirepo.simulation_db.
sim_data_file
(sim_type, sim_id)[source]¶ Simulation data file name
Parameters: Returns: simulation path
Return type: py.path.local
-
sirepo.simulation_db.
simulation_dir
(simulation_type, sid=None)[source]¶ Generates simulation directory from sid and simulation_type
Parameters:
-
sirepo.simulation_db.
simulation_lib_dir
(simulation_type)[source]¶ String name for user library dir
Parameters: simulation_type – which app is this for Returns: directory name Return type: py.path
-
sirepo.simulation_db.
simulation_run_dir
(data, remove_dir=False)[source]¶ Where to run the simulation
Parameters: Returns: directory to run
Return type: py.path
-
sirepo.simulation_db.
static_file_path
(file_dir, file_name)[source]¶ Absolute path to a static file For requesting static files (hence a public interface)
Parameters: Returns: absolute path of the file
Return type: py.path
-
sirepo.simulation_db.
tmp_dir
()[source]¶ Generates new, temporary directory
Returns: directory to use for temporary work Return type: py.path
-
sirepo.simulation_db.
uid_from_dir_name
(dir_name)[source]¶ Extra user id from user_dir_name
Parameters: dir_name (py.path) – must be top level user dir or sim_dir Returns: user id Return type: str
-
sirepo.simulation_db.
user_dir_name
(uid=None)[source]¶ String name for user name
Parameters: uid (str) – properly formated user name (optional) Returns: directory name Return type: py.path
-
sirepo.simulation_db.
validate_serial
(req_data)[source]¶ Verify serial in data validates
Parameters: req_data (dict) – request with serial and possibly models Returns: None if all ok, or json response (bad) Return type: object
-
sirepo.simulation_db.
verify_app_directory
(simulation_type)[source]¶ Ensure the app directory is present. If not, create it and add example files.
-
sirepo.simulation_db.
write_json
(filename, data)[source]¶ Write data as json to filename
Parameters: filename (py.path or str) – will append JSON_SUFFIX if necessary
sirepo.sirepo_console module¶
SiRepo front-end command line for pykern.pkcli
.
Example:
copyright: | Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
sirepo.srunit module¶
Support for unit tests
copyright: | Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
sirepo.srunit.
flask_client
(cfg=None)[source]¶ Return FlaskClient with easy access methods.
Creates a new run directory every test file so can assume sharing of state on the server within a file (module).
Two methods of interest: sr_post and sr_get.
Parameters: cfg (dict) – extra configuration for reset_state_for_testing Returns: for local requests to Flask server Return type: FlaskClient
-
sirepo.srunit.
server
= None¶ import sirepo.server
sirepo.uri_router module¶
Handles dispatching of uris to server.api_* functions
copyright: | Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
-
exception
sirepo.uri_router.
NotFound
(log_fmt, *args, **kwargs)[source]¶ Bases:
exceptions.Exception
Raised to indicate page not found exception (404)
-
sirepo.uri_router.
init
(app, uwsgi)[source]¶ Convert route map to dispatchable callables
Initializes _uri_to_route and adds a single flask route (_dispatch) to dispatch based on the map.
Parameters: - app (Flask) – flask app
- uwsgi (WSGIApp) – uwsgi server object (or None)
-
sirepo.uri_router.
register_api_module
()[source]¶ Add caller_module to the list of modules which implements apis.
The module must have methods: api_XXX which do not collide with other apis.
-
sirepo.uri_router.
srunit_uri
= None¶ route for sirepo.srunit
sirepo.util module¶
Utilities for requests
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |
Module contents¶
sirepo package
copyright: | Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved. |
---|---|
license: | http://www.apache.org/licenses/LICENSE-2.0.html |