Mercurial > kallithea
comparison rhodecode/config/setup_rhodecode.py @ 2919:29630805893d beta
Implemented proposed changes from pull request #77
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 11 Oct 2012 20:56:01 +0200 |
parents | 5893414dea91 |
children |
comparison
equal
deleted
inserted
replaced
2918:ce8572f45c85 | 2919:29630805893d |
---|---|
48 parser.add_option('--name', | 48 parser.add_option('--name', |
49 action='store', | 49 action='store', |
50 dest='section_name', | 50 dest='section_name', |
51 default=None, | 51 default=None, |
52 help='The name of the section to set up (default: app:main)') | 52 help='The name of the section to set up (default: app:main)') |
53 parser.add_option('--force-yes', | |
54 action='store_true', | |
55 dest='force_ask', | |
56 default=None, | |
57 help='Force yes to every question') | |
58 parser.add_option('--force-no', | |
59 action='store_false', | |
60 dest='force_ask', | |
61 default=None, | |
62 help='Force no to every question') | |
53 | 63 |
54 def command(self): | 64 def command(self): |
55 config_spec = self.args[0] | 65 config_spec = self.args[0] |
56 section = self.options.section_name | 66 section = self.options.section_name |
57 if section is None: | 67 if section is None: |
59 config_spec, section = config_spec.split('#', 1) | 69 config_spec, section = config_spec.split('#', 1) |
60 else: | 70 else: |
61 section = 'main' | 71 section = 'main' |
62 if not ':' in section: | 72 if not ':' in section: |
63 plain_section = section | 73 plain_section = section |
64 section = 'app:'+section | 74 section = 'app:' + section |
65 else: | 75 else: |
66 plain_section = section.split(':', 1)[0] | 76 plain_section = section.split(':', 1)[0] |
67 if not config_spec.startswith('config:'): | 77 if not config_spec.startswith('config:'): |
68 config_spec = 'config:' + config_spec | 78 config_spec = 'config:' + config_spec |
69 if plain_section != 'main': | 79 if plain_section != 'main': |