1
# -*- coding: utf-8 -*-
2
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
3
# $Id: options.py 447 2005-07-22 17:45:33Z aafshar $
4
#Copyright (c) 2005 Ali Afshar aafshar@gmail.com
6
#Permission is hereby granted, free of charge, to any person obtaining a copy
7
#of this software and associated documentation files (the "Software"), to deal
8
#in the Software without restriction, including without limitation the rights
9
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
#copies of the Software, and to permit persons to whom the Software is
11
#furnished to do so, subject to the following conditions:
13
#The above copyright notice and this permission notice shall be included in
14
#all copies or substantial portions of the Software.
16
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
''' Default configuration options '''
29
import ConfigParser as configparser
35
''' Returns the path of the application named name using 'which'. '''
36
p = os.popen('which %s' % name)
40
if 'command not found' in w:
49
Default global configuration.
51
dirs_group = reg.add_group('directories',
52
'Locations of directories pida will use.')
54
dirs_user = dirs_group.add('user',
55
registry.CreatingDirectory,
56
os.path.expanduser('~/.pida'),
57
'The base per-user directory')
59
# This takes a bit of work
60
prefix = __file__.split('lib', 1)[0]
61
dirs_libs = dirs_group.add('shared',
63
os.path.join(prefix, 'share', 'pida'),
64
'The shared library directory.')
66
dirs_sock = dirs_group.add('socket',
67
registry.CreatingDirectory,
68
os.path.join(dirs_user._default, '.sockets'),
69
'Where Pida will start Unix Domain Sockets')
72
file_group = reg.add_group('files',
73
'Location of files Pida will use.')
75
file_icon = file_group.add('icon_data',
76
registry.MustExistFile,
77
os.path.join(dirs_libs._default, 'icons.dat'),
78
'Location of the icons file')
80
file_proj = file_group.add('project_data',
82
os.path.join(dirs_user._default, 'pida.projects'),
83
'Location of the project data file.')
85
file_log = file_group.add('log',
87
os.path.join(dirs_user._default, 'pida.log'),
88
'Location of the log file.')
90
file_shrt = file_group.add('shortcut_data',
92
os.path.join(dirs_user._default, 'pida.shortcuts'),
93
'Location of the shortcuts data file.')
96
# ### External command options
97
coms_group = reg.add_group('commands',
98
'Paths to external commands used by Pida')
101
coms_gvim = coms_group.add('vim',
104
'Path to Gvim (may be set as /path/to/vim -g).')
106
coms_cvim = coms_group.add('console_vim',
109
'Path to console Vim')
111
coms_evim = coms_group.add('evim',
114
'Path to the modeless (easy) Vim version.')
116
coms_emacs = coms_group.add('xemacs',
121
coms_pyth = coms_group.add('python',
124
'Path to the Python interpreter.')
126
coms_shel = coms_group.add('shell',
129
'The path to your preferred shell.')
131
coms_brow = coms_group.add('browser',
134
'The path to your preferred browser.')
136
coms_pdoc = coms_group.add('pydoc',
139
'The path to the pydoc program.')
141
logs_group = reg.add_group('log',
144
log_level = logs_group.add('level',
147
'The default logging level (10=debug, 50=critical)')
149
log_level.adjustment = (10, 50, 10)
151
lay_group = reg.add_group('layout', 'Thigs to do with layout')
153
lay_max = lay_group.add('start_maximised',
156
'Whether Pida will start Maximized')
158
lay_vert = lay_group.add('vertical_split',
161
'Whether to split the view vertically (requires restart).')
163
lay_embd = lay_group.add('embedded_mode',
166
'Determines whether Pida will start Vim embedded.')
168
lay_term = lay_group.add('terminal_under_editor',
171
'Determines whther the terminal will appear underneath the editor')
173
lay_status = lay_group.add('status_bar',
176
'Whether a status bar will be shown')
178
core_group = reg.add_group('components',
179
'Choose which components to use.')
181
core_editor = core_group.add('editor',
184
'The editor Pida will use')
186
core_editor.choices = ['vim', 'culebra']
188
if __name__ == '__main__':