-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAppRun
executable file
·110 lines (89 loc) · 2.94 KB
/
AppRun
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
#!/usr/bin/env python
import sys, os
import logging
import optparse
import findrox; findrox.version(2, 0, 5)
import rox
from rox import choices, options
import constants
choices.migrate('ROX-Session', constants.site)
rox.setup_app_options('ROX-Session', 'Options', constants.site)
import logout
import log
import session
o_i18n_translation = options.Option('i18n_translation', 'None')
rox.app_options.notify()
if o_i18n_translation.value == 'None':
langs = None
else:
langs = [o_i18n_translation.value]
__builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'), languages = langs)
log_level = None
test_mode = False
descr = _("If ROX-Session is already managing your session then display\n" \
"the logout window. If not, offer to make ROX-Session your\n" \
"session manager for future sessions.\n\n" \
"\nThe latest version can be found at:\n" \
"\thttp://rox.sourceforge.net\n" \
"\nCopyright (C) 2005 Thomas Leonard.\n"
"ROX-Session comes with ABSOLUTELY NO WARRANTY,\n"
"to the extent permitted by law.\n"
"You may redistribute copies of ROX-Session\n"
"under the terms of the GNU General Public License.\n"
"For more information about these matters, see the file named COPYING."
"\nReport bugs to <[email protected]>.")
version = "0.31"
parser=optparse.OptionParser(prog='ROX-Session', description=descr,
version=version)
parser.add_option('-t', '--test', action='store_true')
parser.add_option('-w', '--wait', action='store_true',
help='simply wait until run again (internal use)')
parser.add_option ('--install', action='store_true',
help='make ROX-Session your session manager')
parser.add_option('--setup', action='store_true',
help='configure initial environment and apps')
parser.add_option('--options', action='store_true',
help='show options dialog')
parser.add_option('--messages', action='store_true',
help='show the message log window')
parser.add_option('-v', '--verbose', action='store_true')
options, args=parser.parse_args()
if args:
print >>sys.stderr, 'Unexpected arguments:', ' '.join(args)
print >>sys.stderr, 'use --help for usage'
sys.exit(1)
# Check for options that modify our behaviour
if options.test:
test_mode = True
constants.session_service += '-test'
if options.verbose:
logger = logging.getLogger()
if log_level == logging.INFO:
log_level = logging.DEBUG
else:
log_level = logging.INFO
logger.setLevel(log_level)
logging.info("Set verbose logging")
# Now check for options that trigger actions
if options.wait:
import main
main.manage_session(test_mode)
sys.exit(0)
elif options.install:
import setup
setup.setup()
sys.exit(0)
elif options.setup:
import AutoStart
sys.exit(0)
elif options.options:
import interactive
interactive.show_options()
sys.exit(0)
elif options.messages:
import interactive
interactive.show_messages()
sys.exit(0)
# Must be interactive mode
import interactive
interactive.setup_or_logout()