Lines 145-150
class MirrorSelect(object):
Link Here
|
145 |
self.output.white(" interactive:"), |
145 |
self.output.white(" interactive:"), |
146 |
" # mirrorselect -i -r", |
146 |
" # mirrorselect -i -r", |
147 |
)) |
147 |
)) |
|
|
148 |
|
149 |
def set_servers(option, opt_str, value, parser): |
150 |
set_servers.user_configured = True |
151 |
setattr(parser.values, option.dest, value) |
152 |
|
148 |
parser = OptionParser( |
153 |
parser = OptionParser( |
149 |
formatter=ColoredFormatter(self.output), description=desc, |
154 |
formatter=ColoredFormatter(self.output), description=desc, |
150 |
version='Mirrorselect version: %s' % version) |
155 |
version='Mirrorselect version: %s' % version) |
Lines 236-243
class MirrorSelect(object):
Link Here
|
236 |
"-q", "--quiet", action="store_const", const=0, dest="verbosity", |
241 |
"-q", "--quiet", action="store_const", const=0, dest="verbosity", |
237 |
help="Quiet mode") |
242 |
help="Quiet mode") |
238 |
group.add_option( |
243 |
group.add_option( |
239 |
"-s", "--servers", action="store", type="int", default=1, |
244 |
"-s", "--servers", action="callback", callback=set_servers, |
240 |
help="Specify Number of servers for Automatic Mode " |
245 |
type="int", default=1, help="Specify Number of servers for Automatic Mode " |
241 |
"to select. this is only valid for download mirrors. " |
246 |
"to select. this is only valid for download mirrors. " |
242 |
"If this is not specified, a default of 1 is used.") |
247 |
"If this is not specified, a default of 1 is used.") |
243 |
group.add_option( |
248 |
group.add_option( |
Lines 271-277
class MirrorSelect(object):
Link Here
|
271 |
if options.rsync and not (options.interactive or options.all_mirrors): |
276 |
if options.rsync and not (options.interactive or options.all_mirrors): |
272 |
self.output.print_err('rsync servers can only be selected with -i or -a') |
277 |
self.output.print_err('rsync servers can only be selected with -i or -a') |
273 |
|
278 |
|
274 |
if options.servers and options.all_mirrors: |
279 |
if options.all_mirrors and hasattr(set_servers, 'user_configured'): |
275 |
self.output.print_err('Choose at most one of -s or -a') |
280 |
self.output.print_err('Choose at most one of -s or -a') |
276 |
|
281 |
|
277 |
if options.interactive and ( |
282 |
if options.interactive and ( |