This file is indexed.

/usr/lib/python2.7/dist-packages/examples/menutest.py is in python-starpy 1.0.1.0.git.20140806-1.

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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /usr/bin/env python
"""Sample application to test the menuing utility classes"""
from twisted.application import service, internet
from twisted.internet import reactor, defer
from starpy import manager, fastagi, error
import utilapplication
import menu
import os, logging, pprint, time

log = logging.getLogger( 'menutest' )

mainMenu = menu.Menu(
	prompt = '/home/mcfletch/starpydemo/soundfiles/menutest-toplevel',
	#prompt = 'houston',
	textPrompt = '''Top level of the menu test example
	
	Pressing Star will exit this menu at any time.
	Options zero and pound will exit with those options selected.
	Option one will start a submenu.
	Option two will start a digit-collecting sub-menu.
	We'll tell you if you make an invalid selection here.''',
	options = [
		menu.Option( option='0' ),
		menu.Option( option='#' ),
		menu.ExitOn( option='*' ),
		menu.SubMenu( 
			option='1',
			menu = menu.Menu(
				prompt = '/home/mcfletch/starpydemo/soundfiles/menutest-secondlevel',
				#prompt = 'atlantic',
				textPrompt = '''A second-level menu in the menu test example
				
				Pressing Star will exit this menu at any time.
				Options zero and pound will exit the whole menu with those options selected.
				We won't tell you if you make an invalid selection here.
				''',
				tellInvalid = False, # don't report incorrect selections
				options = [
					menu.Option( option='0' ),
					menu.Option( option='#' ),
					menu.ExitOn( option='*' ),
				],
			),
		),
		menu.SubMenu(
			option='2',
			menu = menu.CollectDigits(
				textPrompt = '''Digit collection example,
				Please enter three to 5 digits.
				''',
				soundFile = '/home/mcfletch/starpydemo/soundfiles/menutest-digits',
				#soundFile = 'extension',
				maxDigits = 5,
				minDigits = 3,
			),
		),
	],
)

class Application( utilapplication.UtilApplication ):
	"""Application for the call duration callback mechanism"""
	def onS( self, agi ):
		"""Incoming AGI connection to the "s" extension (start operation)"""
		log.info( """New call tracker""" )
		def onComplete( result ):
			log.info( """Final result: %r""", result )
			agi.finish()
		return mainMenu( agi ).addCallbacks( onComplete, onComplete )

APPLICATION = Application()

if __name__ == "__main__":
	logging.basicConfig()
	log.setLevel( logging.DEBUG )
	#manager.log.setLevel( logging.DEBUG )
	fastagi.log.setLevel( logging.DEBUG )
	menu.log.setLevel( logging.DEBUG )
	APPLICATION.handleCallsFor( 's', APPLICATION.onS )
	APPLICATION.agiSpecifier.run( APPLICATION.dispatchIncomingCall )
	from twisted.internet import reactor
	reactor.run()