Here are the examples of the python api stringparser.Parser taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Example 1
Project: lantz Source File: processors.py
@classmethod
def to_callable(cls, obj):
if isinstance(obj, str):
return Parser(obj)
raise TypeError('parse_params argument must be a string or a callable, '
'not {}'.format(obj))
0
Example 2
def add_property(self, name, default_value, getter_pair, setter_triplet,
specs):
"""Add property to channel
:param name: property name
:param default_value: default value as string
:param getter_pair: (query, response)
:param setter_triplet: (query, response, error)
:param specs: specification of the Property
"""
self._properties[name] = ChannelProperty(self, name,
default_value, specs)
if getter_pair:
query, response = getter_pair
self._getters['__default__'][to_bytes(query)] = name, response
if setter_triplet:
query, response, error = setter_triplet
self._setters.append((name,
stringparser.Parser(query),
to_bytes(response),
to_bytes(error)))
0
Example 3
def add_property(self, name, default_value, getter_pair, setter_triplet,
specs):
"""Add property to device
:param name: property name
:param default_value: default value as string
:param getter_pair: (query, response)
:param setter_triplet: (query, response, error)
:param specs: specification of the Property
"""
self._properties[name] = Property(name, default_value, specs)
if getter_pair:
query, response = getter_pair
self._getters[to_bytes(query)] = name, response
if setter_triplet:
query, response, error = setter_triplet
self._setters.append((name,
stringparser.Parser(query),
to_bytes(response),
to_bytes(error)))