This file is indexed.

/usr/share/pyshared/pyx/canvasitem.py is in python-pyx 0.12.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2002-2007 Jörg Lehmann <joergl@users.sourceforge.net>
# Copyright (C) 2002-2007 André Wobst <wobsta@users.sourceforge.net>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PyX is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PyX; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

class canvasitem:

    """Base class for everything which can be inserted into a canvas"""

    def bbox(self):
        """return bounding box of canvasitem"""
        # TODO: we either should raise a NotImplementedError here or return
        # an empty bounding box instance, as adding empty to a bouding box is
        # allowed. (We could also alter the merging behavior of bboxes to allow
        # None. Currently, canvasitem instances not overwriting this bbox method
        # lead to an error.)
        pass

    def processPS(self, file, writer, context, registry, bbox):
        """process canvasitem by writing the corresponding PS code to file and
        by updating context, registry as well as bbox

        - the PS code corresponding to the canvasitem has to be written in the
          stream file, which provides a write(string) method
        - writer is the PSwriter used for the output
        - context is an instance of pswriter.context which is used for keeping 
          track of the graphics state (current linewidth, colorspace and font))
        - registry is used for tracking resources needed by the canvasitem
        - bbox has to be updated to include the bounding box of the canvasitem
        """
        raise NotImplementedError()

    def processPDF(self, file, writer, context, registry, bbox):
        """process canvasitem by writing the corresponding PDF code to file and
        by updating context, registry as well as bbox

        - the PDF code corresponding to the canvasitem has to be written in the
          stream file, which provides a write(string) method
        - writer is the PDFwriter used for the output, which contains properties
          like whether streamcompression is used
        - context is an instance of pdfwriter.context which is used for keeping
          track of the graphics state, in particular for the emulation of PS 
          behaviour regarding fill and stroke styles, for keeping track of the
          currently selected font as well as of text regions.
        - registry is used for tracking resources needed by the canvasitem
        - bbox has to be updated to include the bounding box of the canvasitem
        """
        raise NotImplementedError()