KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/test/test_getopt.pyc
mò
‚=5Dc@s¡dkZdklZdklZlZlZdkZed„Zei	i
dƒZedj	oei	d=neo	dGHneei
ddƒƒeei
ddƒƒedeƒed	eƒeo	d
GHneiddgƒ\ZZeeƒeedjƒeiddgƒ\ZZeeƒeedjƒeidd
gƒ\ZZeeƒeed
jƒedeƒedeƒeddeƒeo	dGHneigddgƒ\ZZeed<gjƒeegjƒeigddgƒ\ZZeed=gjƒeegjƒeigdddgƒ\ZZeed>gjƒeegjƒeigddddgƒ\ZZeed?gjƒeedgjƒedeƒedeƒeo	dGHneigddggƒ\ZZeed@gjƒeegjƒeigddggƒ\ZZeedAgjƒeegjƒeigddggƒ\ZZeedBgjƒeegjƒeigdddd
ggƒ\ZZeedCgjƒeegjƒeigd d!d"ggƒ\ZZeedDgjƒeegjƒed%eƒed&eƒddd'd(d)dd*ddd)d+d,gZeo	d-GHneied.d/d0gƒ\ZZeedEdFdGdHdIdJdKgjƒeed+d,gjƒed2eƒeo	d3GHndd+d'dd1d4gZeied5d6d7gƒ\ZZeedLdMdNdOgjƒeed+gjƒeied8d6d7gƒ\ZZeedPgjƒeed+d'dd1d4gjƒdei	d<eied5d6d7gƒ\ZZeedQgjƒeed+d'dd1d4gjƒedjoei	d=neei	d<d9Zhd:e<ZdkZeeieeƒeo	d;GHndS(RN(sGetoptError(sverifysverbosesrun_doctestcBs,y|dUWn|j
onX|‚dS(s{Executes a statement passed in teststr, and raises an exception
       (failure) if the expected exception is *not* raised.N(tteststrtexpectedtfailure(RRR((t(/usr/lib64/python2.4/test/test_getopt.pytexpectException	stPOSIXLY_CORRECTs%Running tests on getopt.short_has_argtasa:s$tmp = getopt.short_has_arg('a', 'b')s#tmp = getopt.short_has_arg('a', '')s%Running tests on getopt.long_has_argstabcsabc=tabcds6has_arg, option = getopt.long_has_args('abc', ['def'])s1has_arg, option = getopt.long_has_args('abc', [])shas_arg, option = s-getopt.long_has_args('abc', ['abcd','abcde'])s!Running tests on getopt.do_shortss-atta1t1t2s0opts, args = getopt.do_shorts([], 'a1', 'a', [])s0opts, args = getopt.do_shorts([], 'a', 'a:', [])s Running tests on getopt.do_longss--abcsabc=1sabcd=s--abcdtabsfoo=42sfoo-barsfoo=s--foot42s6opts, args = getopt.do_longs([], 'abc=1', ['abc'], [])s5opts, args = getopt.do_longs([], 'abc', ['abc='], [])s-bs	--alpha=2s--betat3targ1targ2sRunning tests on getopt.getoptsa:bsalpha=tbetas--alphas=opts, args = getopt.getopt(cmdline, 'a:b', ['alpha', 'beta'])s"Running tests on getopt.gnu_getopts--beta=2sab:talphasbeta=s+ab:s#
Examples from the Library Reference:  Doc/lib/libgetopt.tex

An example using only Unix style options:


>>> import getopt
>>> args = '-a -b -cfoo -d bar a1 a2'.split()
>>> args
['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'abc:d:')
>>> optlist
[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
>>> args
['a1', 'a2']

Using long option names is equally easy:


>>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
>>> args = s.split()
>>> args
['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'x', [
...     'condition=', 'output-file=', 'testing'])
>>> optlist
[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')]
>>> args
['a1', 'a2']

t
libreftests,Module getopt: tests completed successfully.(s-aR	(s-aR(s-aR(s-aR(s--abcR	(s--abcR(s--abcdR(s--abcR	(s--fooR(s-aR(s-bR	(s--alphaR(s--betaR	(s-aR(s-aR	(s--betaR	(s-aR	(s-bR(s--alphaR	(s--betaR(s-aR	(s-aR	(tgetopttGetoptErrorttest.test_supporttverifytverbosetrun_doctesttostAssertionErrorRtenvirontgettold_posixly_correcttNonet
short_has_argt
long_has_argsthas_argtoptiont	do_shortstoptstargstdo_longstcmdlinet
gnu_getoptRt__test__tsystmodulest__name__(RRR)RRR'R,RRR+RRR#RR&R$((Rt?sÆ	
	

	

	

	!$	!!!'$*	!%	!!
!

 	

Anon7 - 2021