# `EpicsDeviceNameValidator`

digraph inheritance5a44cfd90a { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "EpicsDeviceNameValidator" [URL="#taurus.core.epics.epicsvalidator.EpicsDeviceNameValidator",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="Validator for Epics device names. Apart from the standard named"]; "TaurusDeviceNameValidator" -> "EpicsDeviceNameValidator" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusDeviceNameValidator" [URL="taurus.core.taurusvalidator-TaurusDeviceNameValidator.html#taurus.core.taurusvalidator.TaurusDeviceNameValidator",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="Base class for Device name validators."]; }

class EpicsDeviceNameValidator(*p, **k)

  Validator for Epics device names. Apart from the standard named groups (scheme, authority, path, query and fragment), the following named groups are created:

  > - devname: device name (only empty string allowed for now)

  Note: brackets on the group name indicate that this group will only contain a string if the URI contains it.

  Import from `taurus.core.epics.epicsvalidator` as:

      from taurus.core.epics.epicsvalidator import EpicsDeviceNameValidator

  authority = '//'
  fragment = '(?!)'
  getNames(fullname, factory=None)

    Returns a tuple of three elements with (complete_name, normal_name, short_name) or None if no match is found. The definitions of each name are:

    - complete: the full URI allowing an unambiguous identification of the model within taurus (note: it must include the scheme).

    - normal: an unambiguous URI at the scheme level. Any parts that are optional and equal to the scheme’s default can be stripped. In particular, the scheme name is typically stripped for all schemes.

    - short: a short name (not necessarily a valid URI) useful for display in cases where ambiguity is tolerable.

    Example: In a tango system where the default TANGO_HOST is “foo:123” and a device “a/b/c” has been defined with alias “bar” and having an attribute called “d”, getNames would return:

    - for the authority:

          ('tango://foo:123', '//foo:123', 'foo:123')

    - for the device:

          ('tango://foo:123/a/b/c', 'a/b/c', 'bar')

          note: if foo:123 wasn't the default TANGO_HOST, the normal name
          would be '//foo:123/a/b/c'. Equivalent rules apply to Attribute
          normal names.

    - for the attribute:

          ('tango://foo:123/a/b/c/d', 'a/b/c/d', 'd')

          note: if foo123 wasn't the default TANGO_HOST, the normal name
          would be '//foo:123/a/b/c/d'

    > - for the attribute (assuming we passed #label):

    >       ('tango://foo:123/a/b/c/d#label',
    >        'a/b/c/d#label',
    >        'd#label')

    > - for the attribute (assuming we did not pass a conf key)::
    >     (‘tango://foo:123/a/b/c/d#’,

    >       ‘a/b/c/d#’, ‘d#’)

    Note: it must always be possible to construct the 3 names from a valid fullname* URI. If the given URI is valid but it is not the full name, it may still be possible in some cases to construct the 3 names, but it may involve using defaults provided by the scheme (which may require more computation than mere parsing the URI)

  path = '/(?P<devname>)'
  query = '(?!)'
  scheme = '(ca|epics)'