Skip to content

Commit a4b5622

Browse files
committed
Changed waveform wording to application where appropriate
1 parent ff9ee17 commit a4b5622

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

model/domain.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __str__(self):
4848
return "Not able to launch waveform '%s'. %s" % (self.name, self.msg)
4949

5050

51-
class WaveformReleaseError(Exception):
51+
class ApplicationReleaseError(Exception):
5252
def __init__(self, name='Unknown', msg=''):
5353
self.name = name
5454
self.msg = msg
@@ -107,7 +107,7 @@ def find_app(self, app_id=None):
107107
for app in apps:
108108
if app._get_identifier() == app_id:
109109
return app
110-
raise ResourceNotFound('waveform', app_id)
110+
raise ResourceNotFound('application', app_id)
111111

112112
def find_component(self, app_id, comp_id=None):
113113
app = self.find_app(app_id)
@@ -181,7 +181,7 @@ def release(self, app_id):
181181
app.releaseObject()
182182
return app_id
183183
except Exception, e:
184-
raise WaveformReleaseError(app_id, str(e))
184+
raise ApplicationReleaseError(app_id, str(e))
185185

186186
def available_apps(self):
187187
_dom = self.get_domain_info()
@@ -222,23 +222,23 @@ def locate_by_path(path, path_type):
222222
Locates a redhawk object with the given path, and path type.
223223
Returns the object + remaining path:
224224
225-
wf, opath = locate(ipath, 'waveform')
225+
comp, opath = locate(ipath, 'component')
226226
227227
228228
Valid path types are:
229-
'waveform' - [ domain id, waveform-id ]
230-
'component' - [ domain id, waveform-id, component-id ]
229+
'application' - [ domain id, application-id ]
230+
'component' - [ domain id, application-id, component-id ]
231231
'device-mgr' - [ domain id, device-manager-id ]
232232
'device' - [ domain id, device-manager-id, device-id ]
233233
'''
234234
domain = Domain(path[0])
235-
if path_type == 'waveform':
235+
if path_type == 'application':
236236
return domain.find_app(path[1]), path[2:]
237237
elif path_type == 'component':
238238
return domain.find_component(path[1], path[2]), path[3:]
239239
elif path_type == 'device-mgr':
240240
return domain.find_device_manager(path[1]), path[2:]
241241
elif path_type == 'device':
242242
return domain.find_device(path[1], path[2]), path[3:]
243-
raise ValueError("Bad path type %s. Must be one of waveform, component, device-mgr or device" % path_type)
243+
raise ValueError("Bad path type %s. Must be one of application, component, device-mgr or device" % path_type)
244244

pyrest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import os
2222

2323
from rest.domain import DomainInfo, DomainProperties
24-
from rest.waveform import Waveforms
24+
from rest.application import Applications
2525
from rest.component import Component, ComponentProperties
2626
from rest.devicemanager import DeviceManagers
2727
from rest.device import Devices, DeviceProperties
@@ -44,8 +44,8 @@
4444
_ID = r'/([^/]+)'
4545
_LIST = r'/?'
4646
_DOMAIN_PATH = r'/redhawk/rest/domains'
47-
_WAVEFORM_PATH = _DOMAIN_PATH + _ID + r'/applications'
48-
_COMPONENT_PATH = _WAVEFORM_PATH + _ID + r'/components'
47+
_APPLICATION_PATH = _DOMAIN_PATH + _ID + r'/applications'
48+
_COMPONENT_PATH = _APPLICATION_PATH + _ID + r'/components'
4949
_DEVICE_MGR_PATH = _DOMAIN_PATH + _ID + r'/deviceManagers'
5050
_DEVICE_PATH = _DEVICE_MGR_PATH + _ID + r'/devices'
5151
_PROPERTIES_PATH = r'/properties'
@@ -72,12 +72,12 @@ def __init__(self, *args, **kwargs):
7272
(_DOMAIN_PATH + _ID + _PROPERTIES_PATH + _LIST, DomainProperties, dict(redhawk=redhawk)),
7373
(_DOMAIN_PATH + _ID + _PROPERTIES_PATH + _ID, DomainProperties, dict(redhawk=redhawk)),
7474

75-
# Waveforms
76-
(_WAVEFORM_PATH + _LIST, Waveforms, dict(redhawk=redhawk)),
77-
(_WAVEFORM_PATH + _ID, Waveforms, dict(redhawk=redhawk)),
78-
(_WAVEFORM_PATH + _ID + _PORT_PATH + _LIST, PortHandler, dict(kind='waveform')),
79-
(_WAVEFORM_PATH + _ID + _PORT_PATH + _ID, PortHandler, dict(kind='waveform')),
80-
(_WAVEFORM_PATH + _ID + _BULKIO_PATH, BulkIOWebsocketHandler, dict(kind='waveform', _ioloop=_ioloop)),
75+
# Applications
76+
(_APPLICATION_PATH + _LIST, Applications, dict(redhawk=redhawk)),
77+
(_APPLICATION_PATH + _ID, Applications, dict(redhawk=redhawk)),
78+
(_APPLICATION_PATH + _ID + _PORT_PATH + _LIST, PortHandler, dict(kind='application')),
79+
(_APPLICATION_PATH + _ID + _PORT_PATH + _ID, PortHandler, dict(kind='application')),
80+
(_APPLICATION_PATH + _ID + _BULKIO_PATH, BulkIOWebsocketHandler, dict(kind='application', _ioloop=_ioloop)),
8181

8282
# Components
8383
(_COMPONENT_PATH + _LIST, Component, dict(redhawk=redhawk)),

rest/waveform.py renamed to rest/application.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
# along with this program. If not, see http://www.gnu.org/licenses/.
1919
#
2020
"""
21-
Rest handlers for Waveforms
21+
Rest handlers for Applications
2222
2323
Classes:
24-
Waveforms -- Get info, launch and release
24+
Applications -- Get info, launch and release
2525
"""
2626

2727
from tornado import gen
@@ -32,7 +32,7 @@
3232
import json
3333

3434

35-
class Waveforms(JsonHandler, PropertyHelper, PortHelper):
35+
class Applications(JsonHandler, PropertyHelper, PortHelper):
3636
@gen.coroutine
3737
def get(self, domain_name, app_id=None):
3838

@@ -49,10 +49,10 @@ def get(self, domain_name, app_id=None):
4949
'properties': self.format_properties(app._properties)
5050
}
5151
else:
52-
wfs = yield self.redhawk.get_application_list(domain_name)
53-
avail = yield self.redhawk.get_available_applications(domain_name)
52+
apps = yield self.redhawk.get_application_list(domain_name)
53+
wfs = yield self.redhawk.get_available_applications(domain_name)
5454

55-
info = {'applications': wfs, 'waveforms': avail}
55+
info = {'applications': apps, 'waveforms': wfs}
5656

5757
self._render_json(info)
5858

@@ -80,7 +80,7 @@ def post(self, domain_name, app_id=None):
8080
app = yield self.redhawk.get_application(domain_name, app_id)
8181
app.start()
8282

83-
self._render_json({'launched': app_id, 'waveforms': apps})
83+
self._render_json({'launched': app_id, 'applications': apps})
8484

8585
@gen.coroutine
8686
def put(self, domain_name, app_id=None):
@@ -101,4 +101,4 @@ def delete(self, domain_name, app_id):
101101
yield self.redhawk.release_application(domain_name, app_id)
102102
apps = yield self.redhawk.get_application_list(domain_name)
103103

104-
self._render_json({'released': app_id, 'waveforms': apps})
104+
self._render_json({'released': app_id, 'applications': apps})

0 commit comments

Comments
 (0)