Skip to content

Commit

Permalink
2008-06-20 Tim Waugh <[email protected]>
Browse files Browse the repository at this point in the history
        * cupsppd.c (Group_repr): New method.
        (cups_GroupType): Set repr function.

git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pycups/trunk@321 e7545f15-59ab-4934-8816-61942c173d0f
  • Loading branch information
twaugh committed Jun 20, 2008
1 parent 553136c commit 2daafca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2008-06-20 Tim Waugh <[email protected]>

* cupsppd.c (Group_repr): New method.
(cups_GroupType): Set repr function.

* cupsppd.c (Option_repr): New method.
(cups_OptionType): Set repr function.

Expand Down
14 changes: 12 additions & 2 deletions cupsppd.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ Option_repr (Option *self)
{
ppd_option_t *option = self->option;
if (!option)
return PyString_FromFormat ("<cups.Option>");
return PyString_FromString ("<cups.Option>");

return PyString_FromFormat ("<cups.Option %s=%s>",
option->keyword, option->defchoice);
Expand Down Expand Up @@ -1025,6 +1025,16 @@ Group_dealloc (Group *self)
self->ob_type->tp_free ((PyObject *) self);
}

static PyObject *
Group_repr (Group *self)
{
ppd_group_t *group = self->group;
if (!group)
return PyString_FromString ("<cups.Group>");

return PyString_FromFormat ("<cups.Group %s>", group->name);
}

///////////
// Group // ATTRIBUTES
///////////
Expand Down Expand Up @@ -1145,7 +1155,7 @@ PyTypeObject cups_GroupType =
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
(reprfunc)Group_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
Expand Down

0 comments on commit 2daafca

Please sign in to comment.