Skip to content

Commit c7b2aab

Browse files
Remove long deprecated run_control_script2 (#420)
1 parent 75fe1a2 commit c7b2aab

File tree

3 files changed

+2
-44
lines changed

3 files changed

+2
-44
lines changed

docs/developer/site_config.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -169,36 +169,3 @@ additional site-info settable from the site's parser.
169169
.. note::
170170
For examples calling these commandline arguments see
171171
:ref:`ocs_agent_cmdline_examples`.
172-
173-
174-
Control Clients and the Site Config
175-
===================================
176-
177-
As of this writing, Control Clients do not store configuration in the
178-
SCF. But there is an interim interface available for Control Clients
179-
to access the Site Configuration, with the usual command-line
180-
overrides. Control Clients that use the ``run_control_script``
181-
function to launch can instead use ``run_control_script2``, which
182-
behaves as follows:
183-
184-
.. autofunction:: ocs.client_t.run_control_script2
185-
:noindex:
186-
187-
The control client script might look something like this (see also
188-
river_ctrl.py in the examples):
189-
190-
.. code-block:: python
191-
192-
def my_script(app, pargs):
193-
from ocs import client_t
194-
195-
# We've added a --target option.
196-
# Construct the full agent address.
197-
agent_addr = '%s.%s' % (pargs.address_root, pargs.target)
198-
199-
# Create a ProcessClient for the process 'acq'.
200-
cw = client_t.ProcessClient(app, agent_addr, 'acq')
201-
202-
print('Starting a data acquisition process...')
203-
d1 = yield cw.start()
204-
#...

example/nonblocking_ops/example_ctrl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def my_script(app, parser_args, target=None):
3434
# We don't pass a parser in, so it will be auto-generated and
3535
# populated from the command line. We hard-code our one argument,
3636
# the target agent instance_id.
37-
client_t.run_control_script2(my_script, target='example1')
37+
client_t.run_control_script(my_script, target='example1')

ocs/client_t.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99

1010
from autobahn.wamp.types import ComponentConfig
1111
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
12-
import deprecation
13-
14-
15-
@deprecation.deprecated(
16-
deprecated_in='v0.6.1',
17-
details="Renamed to run_control_script"
18-
)
19-
def run_control_script2(*args, **kwargs):
20-
run_control_script(*args, **kwargs)
2112

2213

2314
def run_control_script(function, parser=None, *args, **kwargs):
@@ -53,7 +44,7 @@ def run_control_script(function, parser=None, *args, **kwargs):
5344
from ocs import client_t, site_config
5445
parser = site_control.add_arguments() # initialized ArgParser
5546
parser.add_option('--target') # Options for this client
56-
client_t.run_control_script2(my_script, parser=parser)
47+
client_t.run_control_script(my_script, parser=parser)
5748
5849
In the my_script function, use parser_args.target to get the
5950
target.

0 commit comments

Comments
 (0)