summaryrefslogtreecommitdiff
path: root/reconfigure/items/resolv.py
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:26 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:26 +0200
commitff1408420159488a106492ccd11dd234967029b6 (patch)
tree473420cee1c5229a427ec4cafead1aa6c0a26800 /reconfigure/items/resolv.py
Imported Upstream version 0.1.29
Diffstat (limited to 'reconfigure/items/resolv.py')
-rw-r--r--reconfigure/items/resolv.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/reconfigure/items/resolv.py b/reconfigure/items/resolv.py
new file mode 100644
index 0000000..dd9a009
--- /dev/null
+++ b/reconfigure/items/resolv.py
@@ -0,0 +1,19 @@
+from reconfigure.nodes import Node, PropertyNode
+from reconfigure.items.bound import BoundData
+
+
+class ResolvData (BoundData):
+ pass
+
+
+class ItemData (BoundData):
+ def template(self):
+ return Node('line', children=[
+ Node('token', children=[PropertyNode('value', 'nameserver')]),
+ Node('token', children=[PropertyNode('value', '8.8.8.8')]),
+ ])
+
+
+ResolvData.bind_collection('items', item_class=ItemData)
+ItemData.bind_property('value', 'name', path=lambda x: x.children[0])
+ItemData.bind_property('value', 'value', path=lambda x: x.children[1])