[Python-checkins] python/nondist/sandbox/setuptools/setuptools
dist.py, 1.2, 1.3
pje at users.sourceforge.net
pje at users.sourceforge.net
Sun Mar 21 20:12:33 EST 2004
Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10308/setuptools
Modified Files:
dist.py
Log Message:
Compute command line that should be passed to child setup scripts.
Warn user if unsupported options are supplied, and cancel unless
'depends -i' (aka '--ignore-extra-args') was used.
Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/dist.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** dist.py 20 Mar 2004 20:52:11 -0000 1.2
--- dist.py 22 Mar 2004 01:12:31 -0000 1.3
***************
*** 286,289 ****
--- 286,330 ----
+ def get_cmdline_options(self):
+ """Return a '{cmd: {opt:val}}' map of all command-line options
+
+ Option names are all long, but do not include the leading '--', and
+ contain dashes rather than underscores. If the option doesn't take
+ an argument (e.g. '--quiet'), the 'val' is 'None'.
+
+ Note that options provided by config files are intentionally excluded.
+ """
+
+ d = {}
+
+ for cmd,opts in self.command_options.items():
+
+ for opt,(src,val) in opts.items():
+
+ if src != "command line":
+ continue
+
+ opt = opt.replace('_','-')
+
+ if val==0:
+ cmdobj = self.get_command_obj(cmd)
+ neg_opt = self.negative_opt.copy()
+ neg_opt.update(getattr(cmdobj,'negative_opt',{}))
+ for neg,pos in neg_opt.items():
+ if pos==opt:
+ opt=neg
+ val=None
+ break
+ else:
+ raise AssertionError("Shouldn't be able to get here")
+
+ elif val==1:
+ val = None
+
+ d.setdefault(cmd,{})[opt] = val
+
+ return d
+
+
class Feature:
"""A subset of the distribution that can be excluded if unneeded/wanted
More information about the Python-checkins
mailing list