This file is indexed.

/usr/bin/pyscript is in python-pyscript 0.6.1-4.

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
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#! /usr/bin/python

import sys, getopt, os, traceback
import tempfile
from pyscript.version import version as versionNum

def usage():
    print """Usage:
    pyscript [options] file.py

    options:
    [-h/--help]                Print usage information and exit
    [-V/--version]             Print version information and exit
    [-o/--output=outputFile]   Specify an alternative output file name
    [-l/--logfile=logFile]     Specify an alternative log file name
    """

def version():
    print "This is pyscript version %s" % (versionNum,)
    print "For more information see http://pyscript.sourceforge.net\n"

#---------------------------------------------------------------------
# Handle options
#---------------------------------------------------------------------

try:
    opts, args = getopt.getopt(sys.argv[1:], "hVo:l:d", 
	    ["help", "version", "output=", "logfile="])
except getopt.GetoptError:
    # print help information and exit:
    usage()
    sys.exit(2)

logFile = "pyscript.log"

DEBUG=False
globals={}
for o, a in opts:
    if o in ("-h", "--help"):
        usage()
        sys.exit()
    if o in ("-V", "--version"):
	version()
	sys.exit()
    if o in ("-o", "--output"):
        globals['output']=a
    elif o in ("-l", "--logfile"):
        logFile=a
    elif o in ("-d",):
        DEBUG=True
        
if len(args) != 1:
    usage()
    sys.exit()

# print some pretty info
version()

#---------------------------------------------------------------------
# Set up log file
#---------------------------------------------------------------------

# redirect stdout and stderr to file
# keep a copy
save_err = sys.stderr

# open the log file
#tempfile.template="pyscript-"
#logFile = tempfile.mktemp(".log")

if logFile=="-":
    log=sys.stdout
else:
    log = open(logFile,"w")
    print "Log file is",logFile

sys.stderr = log

#---------------------------------------------------------------------
# look for ~/.pyscript
#---------------------------------------------------------------------

# now see about importing the defaults from .pyscript/defaults.py
HOME = os.path.expandvars("$HOME")

# if $HOME/.pyscript directory exists, append this to the python path
# this is so that user defined libs can be imported
if os.path.isdir(HOME+'/.pyscript'):
    sys.path.append(HOME+'/.pyscript')

if os.path.isfile(HOME+'/.pyscript/defaults.py'):
    # try $HOME/.pyscript/defaults.py
    execfile(HOME+'/.pyscript/defaults.py',globals)
else:
    print "No user defaults file found."

print "Executing script..."

#---------------------------------------------------------------------
# now run the script
#---------------------------------------------------------------------
try:
    execfile(args[0],globals)
except:
    divider="-"*60+'\n'

    sys.stderr.write("Exception in user code:\n")
    sys.stderr.write(divider)
    traceback.print_exc(file=sys.stderr)
    sys.stderr.write(divider)

    sys.stdout.write("Exception in user code:\n")
    sys.stdout.write(divider)
    traceback.print_exc(file=sys.stdout)
    sys.stdout.write(divider)
    print "Further clues may be found in the log file:",logFile
else:
    # clean up a bit
    sys.stderr = save_err
    if logFile!="-":
        log.close()
        if not DEBUG:
            print "Removing log file"
            os.remove(logFile)
            print "Removing temp files"
	    tempfiles = ("temp.aux", "temp.dvi", "temp.log", "temp.ps",
			"temp.tex", "temp1.aux", "temp1.dvi", "temp1.eps",
			"temp1.log", "temp1.tex")
	    for tmpfile in tempfiles:
		if os.path.exists(tmpfile):
		    os.remove(tmpfile)
    print "Done!"