Mercurial > piecrust2
diff piecrust/sources/interfaces.py @ 576:0c74a6c4533d
sources: Add code to support "interactive" metadata acquisition.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 19 Dec 2015 18:07:21 -0800 |
parents | f130365568ff |
children | 4850f8c21b6e |
line wrap: on
line diff
--- a/piecrust/sources/interfaces.py Sat Dec 19 18:06:16 2015 -0800 +++ b/piecrust/sources/interfaces.py Sat Dec 19 18:07:21 2015 -0800 @@ -23,7 +23,7 @@ raise NotImplementedError() -class IListableSource: +class IListableSource(object): """ Defines the interface for a source that can be iterated on in a hierarchical manner, for use with the `family` data endpoint. """ @@ -37,7 +37,7 @@ raise NotImplementedError() -class IPreparingSource: +class IPreparingSource(object): """ Defines the interface for a source whose pages can be created by the `chef prepare` command. """ @@ -48,3 +48,17 @@ raise NotImplementedError() +class InteractiveField(object): + TYPE_STRING = 0 + TYPE_INT = 1 + + def __init__(self, name, field_type, default_value): + self.name = name + self.field_type = field_type + self.default_value = default_value + + +class IInteractiveSource(object): + def getInteractiveFields(self): + raise NotImplementedError() +