comparison MoinMoin/script/__init__.py @ 5704:bbb286a9c138

script: Added MoinScript._update_option_help(). script.import.wikipage: update the --page option help message.
author Pascal Volk <user@localhost.localdomain.org>
date Sun, 06 Jun 2010 18:48:02 +0000
parents 7cd4adbd6c50
children 7c6029d23a18
comparison
equal deleted inserted replaced
5703:7a226e00474b 5704:bbb286a9c138
169 self.parser.add_option( 169 self.parser.add_option(
170 "--page", dest="page", default='', 170 "--page", dest="page", default='',
171 help="wiki page name [default: all pages]" 171 help="wiki page name [default: all pages]"
172 ) 172 )
173 173
174 def _update_option_help(self, opt_string, help_msg):
175 """ Update the help string of an option. """
176 for option in self.parser.option_list:
177 if option.get_opt_string() == opt_string:
178 option.help = help_msg
179 break
180
174 def init_request(self): 181 def init_request(self):
175 """ create request """ 182 """ create request """
176 from MoinMoin.web.contexts import ScriptContext 183 from MoinMoin.web.contexts import ScriptContext
177 url = self.options.wiki_url or None 184 url = self.options.wiki_url or None
178 self.request = ScriptContext(url, self.options.page) 185 self.request = ScriptContext(url, self.options.page)