First cut of user CLI API 

Raising exceptions in this user driven API needs some thought and probably an uniform collection of exception classes. Future.
On Dec 5, 2014, at 12:07 AM, Thomas A Caswell <notifications@github.com<mailto:notifications@github.com>> wrote:


In ophyd/userapi/cli_api.py:

> +  :param positioner: A single positioner or a collection of positioners to move
> +  :param limits: A single tupple or a collection of tuples for the form (+ve, -ve) limits.
> +
> +  """
> +
> +  print('')
> +
> +  for p in positioner:
> +    if not isinstance(p, EpicsMotor):
> +      raise ValueError("Positioners must be EpicsMotors to set limits")
> +
> +  for p,lim in zip(positioner, limits):
> +    lim1 = max(lim)
> +    lim2 = min(lim)
> +    if not caput(p._record + ".HLM", lim1):
> +      raise Exception("Unable to set limits for %s", p.name)


Should define a custom exception class for this

—
Reply to this email directly or view it on GitHub<https://github.com/NSLS-II/ophyd/pull/23/files#r21355709>.