/usr/share/vitables/run-vitables.py is in vitables 2.1-1.
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 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""This is the launcher script for the ViTables application."""
from __future__ import print_function
# Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved
# Copyright (C) 2008-2011 Vicent Mas. All rights reserved
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Author: Vicent Mas - vmas@vitables.org
__docformat__ = 'restructuredtext'
import locale
from optparse import OptionParser
import sys
import os.path
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from PyQt4 import QtGui
def main(args):
"""The application launcher.
First of all, translators are loaded. Then the GUI is shown and the events
loop is started.
"""
app = QtGui.QApplication(args)
# These imports must be done after the QApplication has been instantiated
from vitables.vtapp import VTApp
from vitables.preferences import vtconfig
# Specify the organization's Internet domain. When the Internet
# domain is set, it is used on Mac OS X instead of the organization
# name, since Mac OS X applications conventionally use Internet
# domains to identify themselves
app.setOrganizationDomain('vitables.org')
app.setOrganizationName('ViTables')
app.setApplicationName('ViTables')
app.setApplicationVersion(vtconfig.getVersion())
config = vtconfig.Config()
# Localize the application using the system locale
# numpy seems to have problems with decimal separator in some locales
# (catalan, german...) so C locale is always used for numbers.
locale.setlocale(locale.LC_ALL, '')
locale.setlocale(locale.LC_NUMERIC, 'C')
language = locale.getlocale()[0]
# Future translations (if any) will use resource files
# vt_translator = QTranslator()
# vt_translator.load('vitables_%s' % language, config.translations_dir)
# qt_translator = QTranslator()
# qt_translator.load('qt_%s' % language, config.translations_dir)
# app.installTranslator(vt_translator)
# app.installTranslator(qt_translator)
# Parse the command line
parser = OptionParser(prog='vitables', version=vtconfig.getVersion(),
usage='''%prog [options] [h5file]''')
parser.add_option('-m', '--mode', dest='mode', choices=['r', 'a'],
help='mode access for a database', metavar='MODE')
parser.add_option('-d', '--dblist', dest='dblist',
help='a file with the list of databases to be open', metavar='h5list')
parser.set_defaults(mode='a', dblist='')
(options, h5files) = parser.parse_args()
if options.dblist:
# Other options and positional arguments are silently ignored
options.mode = ''
h5files = []
# Start the application
del config
vtapp = VTApp(mode=options.mode, dblist=options.dblist, h5files=h5files)
vtapp.gui.show()
app.exec_()
if __name__ == '__main__':
# How to run in Mac OS X
if (sys.platform == 'darwin'
and not sys.executable.endswith('MacOS/Python')
and getattr(sys, 'frozen', None) != 'macosx_app'):
# When running this script under Mac OS X from the command line
# (but not as an app), the ``pythonw`` interpreter must be used
# instead of the ordinary ``python``.
os.execvp('pythonw', ['pythonw', __file__] + sys.argv[1:])
main(sys.argv)
|