/usr/share/games/fretsonfire/game/FretsOnFire.py is in fretsonfire-game 1.3.110.dfsg2-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 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 | #!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#####################################################################
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä #
# #
# This program 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. #
# #
# This program 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 this program; if not, write to the Free Software #
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, #
# MA 02110-1301, USA. #
#####################################################################
"""
Main game executable.
"""
import sys
import os
# This trickery is needed to get OpenGL 3.x working with py2exe
if hasattr(sys, "frozen") and os.name == "nt":
import ctypes
from ctypes import util
sys.path.insert(0, "data/PyOpenGL-3.0.0a5-py2.5.egg")
sys.path.insert(0, "data/setuptools-0.6c8-py2.5.egg")
# Register the latin-1 encoding
import codecs
import encodings.iso8859_1
import encodings.utf_8
codecs.register(lambda encoding: encodings.iso8859_1.getregentry())
codecs.register(lambda encoding: encodings.utf_8.getregentry())
assert codecs.lookup("iso-8859-1")
assert codecs.lookup("utf-8")
from GameEngine import GameEngine
from MainMenu import MainMenu
import Log
import Config
import Version
import getopt
usage = """%(prog)s [options]
Options:
--verbose, -v Verbose messages
--play, -p [songName] Start playing the given song
""" % {"prog": sys.argv[0] }
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:], "vp:", ["verbose", "play="])
except getopt.GetoptError:
print usage
sys.exit(1)
songName = None
for opt, arg in opts:
if opt in ["--verbose", "-v"]:
Log.quiet = False
elif opt in ["--play", "-p"]:
songName = arg
while True:
config = Config.load(Version.appName() + ".ini", setAsDefault = True)
engine = GameEngine(config)
menu = MainMenu(engine, songName = songName)
engine.setStartupLayer(menu)
try:
import psyco
psyco.profile()
except:
Log.warn("Unable to enable psyco.")
try:
while engine.run():
pass
except KeyboardInterrupt:
pass
if engine.restartRequested:
Log.notice("Restarting.")
try:
# Determine whether were running from an exe or not
if hasattr(sys, "frozen"):
if os.name == "nt":
os.execl("FretsOnFire.exe", "FretsOnFire.exe", *sys.argv[1:])
else:
os.execl("./FretsOnFire", "./FretsOnFire", *sys.argv[1:])
else:
if os.name == "nt":
bin = "c:/python25/python"
else:
bin = "/usr/bin/python"
os.execl(bin, bin, "FretsOnFire.py", *sys.argv[1:])
except:
Log.warn("Restart failed.")
raise
break
else:
break
engine.quit()
|