Home | History | Annotate | Download | only in distutils

Lines Matching full:option

21     two is necessary because option values might come from the outside
80 # Some commands define a 'self.force' option to ignore file
120 # (command-line, option file, etc.) has been processed
123 # controlled by the command's various option values
140 This is always called as late as possible, ie. after any option
142 done. Thus, this is the place to code option dependencies: if
159 for (option, _, _) in self.user_options:
160 option = option.translate(longopt_xlate)
161 if option[-1] == "=":
162 option = option[:-1]
163 value = getattr(self, option)
164 self.announce(indent + "%s = %s" % (option, value),
196 # -- Option validation methods -------------------------------------
199 # NB. the general philosophy here is to ensure that a particular option
203 # option into conformance, raise DistutilsOptionError. Thus, command
209 def _ensure_stringlike(self, option, what, default=None):
210 val = getattr(self, option)
212 setattr(self, option, default)
216 "'%s' must be a %s (got `%s`)" % (option, what, val)
219 def ensure_string(self, option, default=None):
220 """Ensure that 'option' is a string; if not defined, set it to
223 self._ensure_stringlike(option, "string", default)
225 def ensure_string_list(self, option):
226 """Ensure that 'option' is a list of strings. If 'option' is
231 val = getattr(self, option)
235 setattr(self, option, re.split(r',\s*|\s+', val))
250 (option, val)
253 def _ensure_tested_string(self, option, tester,
255 val = self._ensure_stringlike(option, what, default)
258 ("error in '%s' option: " + error_fmt) % (option, val)
260 def ensure_filename(self, option):
261 """Ensure that 'option' is the name of an existing file."""
262 self._ensure_tested_string(option, os.path.isfile,
266 def ensure_dirname(self, option):
267 self._ensure_tested_string(option, os.path.isdir,
282 option values in some other command object. "Undefined" here means
283 "is None", which is the convention used to indicate that an option
287 option of the same command. 'src_cmd' is the other command from
288 which option values will be taken (a command object will be created