Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 169 additions & 156 deletions pyipptool/core.py

Large diffs are not rendered by default.

310 changes: 72 additions & 238 deletions pyipptool/schemas.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pyipptool/templates/ipp/group_tuple.pt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<tal:block tal:define="item_template item_template|field.widget.item_template;">
<b tal:replace="python: 'GROUP %s' % field.name.replace('_', '-')"/>
<tal:block tal:repeat="child field"
tal:replace="child.render_template(item_template)"/>
</tal:block>
4 changes: 0 additions & 4 deletions pyipptool/templates/ipp/tuple.pt

This file was deleted.

15 changes: 2 additions & 13 deletions pyipptool/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ def serialize(self, field, cstruct=None, readonly=False):
return 'FILE {}'.format(cstruct)


class IPPGroupWidget(Widget):
def serialize(self, field, cstruct=None, readonly=False):
name = field.name
while field.parent is not None:
field = field.parent
value = getattr(field.schema, name)
if value is colander.null:
return ''
return 'GROUP {}'.format(value)


class IPPAttributeWidget(Widget):
def serialize(self, field, cstruct=None, readonly=False):
if cstruct is colander.null:
Expand All @@ -55,8 +44,8 @@ class IPPBodyWidget(MappingWidget):
item_template = 'ipp/item'


class IPPTupleWidget(SequenceWidget):
readonly_template = 'ipp/tuple'
class IPPGroupWidget(SequenceWidget):
readonly_template = 'ipp/group_tuple'
template = readonly_template
item_template = 'ipp/item'

Expand Down
2 changes: 1 addition & 1 deletion tests/test_async_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def do_POST(self):
wrapper.config['cups_uri'] = 'http://localhost:%s/' % PORT

request = get_subscriptions_form.render(
{'operation_attributes':
{'operation_attributes_tag':
{'printer_uri': 'http://localhost:%s/printers/fake' % PORT}}
)

Expand Down
227 changes: 125 additions & 102 deletions tests/test_form.py

Large diffs are not rendered by default.

Loading