This file is indexed.

/usr/share/pyshared/paste/webkit/FakeWebware/TaskKit/Task.py is in python-pastewebkit 1.0-7.

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
from MiscUtils import AbstractError


class Task:

	def __init__(self):
		""" Subclasses should invoke super for this method. """
		# Nothing for now, but we might do something in the future.
		pass

	def run(self):
		"""
		Override this method for you own tasks. Long running tasks can periodically 
		use the proceed() method to check if a task should stop. 
		"""
		raise AbstractError, self.__class__
	
		
	## Utility method ##	
	
	def proceed(self):
		"""
		Should this task continue running?
		Should be called periodically by long tasks to check if the system wants them to exit.
		Returns 1 if its OK to continue, 0 if its time to quit
		"""
		return self._handle._isRunning
		
		
	## Attributes ##
	
	def handle(self):
		"""
		A task is scheduled by wrapping a handler around it. It knows
		everything about the scheduling (periodicity and the like).
		Under normal circumstances you should not need the handler,
		but if you want to write period modifying run() methods, 
		it is useful to have access to the handler. Use it with care.
		"""
		return self._handle

	def name(self):
		"""
		Returns the unique name under which the task was scheduled.
		"""
		return self._name


	## Private method ##

	def _run(self, handle):
		"""
		This is the actual run method for the Task thread. It is a private method which
		should not be overriden.
		"""
		self._name = handle.name()
		self._handle = handle
		self.run()
		handle.notifyCompletion()