/usr/lib/python2.6/site-packages/stevedore/example
NameSizeModeActions
base.py5330644editdlrm
base.pyc11780644editdlrm
fields.py9390644editdlrm
fields.pyc13790644editdlrm
load_as_driver.py8020644editdlrm
load_as_driver.pyc10560644editdlrm
load_as_extension.py8610644editdlrm
load_as_extension.pyc12990644editdlrm
setup.py13640644editdlrm
setup.pyc14860644editdlrm
simple.py5260644editdlrm
simple.pyc10020644editdlrm
__init__.py00644editdlrm
__init__.pyc1480644editdlrm
Edit: /usr/lib/python2.6/site-packages/stevedore/example/fields.py (939B)
import textwrap from stevedore.example import base class FieldList(base.FormatterBase): """Format values as a reStructuredText field list. For example:: : name1 : value : name2 : value : name3 : a long value will be wrapped with a hanging indent """ def format(self, data): """Format the data and return unicode text. :param data: A dictionary with string keys and simple types as values. :type data: dict(str:?) """ for name, value in sorted(data.items()): full_text = ': {name} : {value}'.format( name=name, value=value, ) wrapped_text = textwrap.fill( full_text, initial_indent='', subsequent_indent=' ', width=self.max_width, ) yield wrapped_text + '\n'