This file is indexed.

/usr/share/doc/python-soya-doc/examples/pudding-console-1.py is in python-soya-doc 0.14-2.

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

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
66
67
68
69
70
71
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- indent-tabs-mode: t -*-


import sys, os

import soya
import soya.pudding as pudding
import soya.pudding.sysfont

soya.init()
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))

# initialise pudding
pudding.init()

# with a little code borred from pygame we can get a decent list of the system fonts
print "Available fonts are :", pudding.sysfont.get_fonts()

myfont = soya.Font(pudding.sysfont.SysFont('serif, freeserif'), 15, 15 )
print "Choosen font :", myfont

scene = soya.World()

sword_model = soya.Model.get("sword")
sword = soya.Body(scene, sword_model)
sword.x = 1
sword.rotate_y(90.0)

# one line rotation :)
sword.advance_time = lambda p: sword.rotate_y(5.*p)

camera = soya.Camera(scene)
camera.z = 2

# we use a special root widget as a small compatability layer
root = pudding.core.RootWidget(width = 640, height = 480)
soya.set_root_widget(root)

panel = pudding.control.Panel(root, left = 10, top = 10, label = "console")
panel.right = 10
panel.bottom = 100
panel.anchors = pudding.ANCHOR_ALL

msg = """pudding version : %s
---------------------------------
most of layout of this page is done using anchors.
type text and press enter to "send"
see how you can only type when the mouse is over the console window?

we also use the wrap flag to wrap really long lines.. you know that reminds me of a time when my great great grandmother was showing my uncle how to suck eggs...

also checkout pudding.sysfont as it can query available system fonts.

now go make a soya pudding :)

""" % pudding.__revision__

console = pudding.control.Console(panel, left=10, top=30, initial = msg)
console.right=10
console.bottom=10
console.anchors = pudding.ANCHOR_ALL
console.output.font = myfont

root.add_child(camera)

# we need to do this to force the layout to refresh
root.on_resize()

pudding.main_loop.MainLoop(scene).main_loop()