File: print-arg-types.py

package info (click to toggle)
gnome-python-desktop 2.32.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,548 kB
  • sloc: sh: 10,214; xml: 8,851; ansic: 3,428; python: 1,457; makefile: 664
file content (12 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
import argtypes

class GnomePrintReturnCodeArg(argtypes.IntArg):
    def write_return(self, ptype, ownsreturn, info):
        info.varlist.add('GnomePrintReturnCode', 'ret')
	info.codeafter.append('    if (pygnomeprint_check_error(ret))\n'
			      '        return NULL;\n'
			      '    Py_INCREF(Py_None);\n'
			      '    return Py_None;')

argtypes.matcher.register('GnomePrintReturnCode', GnomePrintReturnCodeArg())