summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2013-09-21 09:15:11 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2013-09-21 09:15:11 +0000
commit3e57eaa3f76862a65503efe90bdc2e9817e3640d (patch)
tree8e1d3835eeaa640cfb526cb2593ec426707ca8f9 /src/examples
parent83723b9a28212bfd43df400450eca1896c7d32c9 (diff)
downloadpyparsing-3e57eaa3f76862a65503efe90bdc2e9817e3640d.tar.gz
Cleanup unit tests for cross 2.x/3.x Python compatibility
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@261 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/Setup.ini73
-rw-r--r--src/examples/__init__.py0
-rw-r--r--src/examples/configParse.py10
-rw-r--r--src/examples/fourFn.py2
4 files changed, 79 insertions, 6 deletions
diff --git a/src/examples/Setup.ini b/src/examples/Setup.ini
new file mode 100644
index 0000000..4574b1c
--- /dev/null
+++ b/src/examples/Setup.ini
@@ -0,0 +1,73 @@
+[Startup]
+AppName=M3i.comm
+stname = Utility
+modemid=125D&DEV_1999
+audioid=125D&DEV_1998
+win98path=
+winmepath=
+win2kpath=
+winxppath=
+win95path=
+winnt4path=
+
+stupgrade =Install/Upgrade Drivers
+stuninstall =Uninstall Drivers
+stchoose =Choose One Function to Process
+stchoosez3 =Choose Devices to Process
+
+copycompl =Copying files completed
+
+RemString1=Set up has finished remove ESS device driver and cleaned your system. Click Finish to exit.
+RemString2=ESS devices is removed completely.No need to reboot. If you want to reinstall, run the setup again with driver package.
+stshowmsg1=Setup will clean the installed files and update registry.
+stshowmsg2=Setup is updating system's registry ....
+stshowmsg3=Setup is starting
+
+sysdriver=es56cvmp.sys
+mdmzn=mdmm3com.inf
+mdmznp=esmdm_98.inf
+mdmzna=mdmessa.inf
+spkname=essspk.exe
+remvess=remvess.exe
+slmcat=allem3m.cat
+audiocat=allem3.cat
+audioinf=M3i
+sysaudio=es198xdl.sys
+audiovxd=es198x.vxd
+
+[Languages]
+Default=0x0009
+count=30
+key0=0x002d
+key1=0x0003
+key2=0x0804
+key3=0x0404
+key4=0x001a
+key5=0x0005
+key6=0x0006
+key7=0x0013
+key8=0x0009
+key9=0x000b
+key10=0x0c0c
+key11=0x040c
+key12=0x0007
+key13=0x0008
+key14=0x000e
+key15=0x0021
+key16=0x0010
+key17=0x0011
+key18=0x0012
+key19=0x0014
+key20=0x0015
+key21=0x0416
+key22=0x0816
+key23=0x0019
+key24=0x001b
+key25=0x0024
+key26=0x000a
+key27=0x001d
+key28=0x001e
+key29=0x001f
+
+[test]
+foo=bar
diff --git a/src/examples/__init__.py b/src/examples/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/examples/__init__.py
diff --git a/src/examples/configParse.py b/src/examples/configParse.py
index edea293..769249c 100644
--- a/src/examples/configParse.py
+++ b/src/examples/configParse.py
@@ -64,9 +64,9 @@ def test( strng ):
print()
return tokens
-
-ini = test("setup.ini")
-print("ini['Startup']['modemid'] =", ini['Startup']['modemid'])
-print("ini.Startup =", ini.Startup)
-print("ini.Startup.modemid =", ini.Startup.modemid)
+if __name__ == "__main__":
+ ini = test("setup.ini")
+ print("ini['Startup']['modemid'] =", ini['Startup']['modemid'])
+ print("ini.Startup =", ini.Startup)
+ print("ini.Startup.modemid =", ini.Startup.modemid)
diff --git a/src/examples/fourFn.py b/src/examples/fourFn.py
index fedd2aa..8ea4609 100644
--- a/src/examples/fourFn.py
+++ b/src/examples/fourFn.py
@@ -87,7 +87,7 @@ fn = { "sin" : math.sin,
"abs" : abs,
"trunc" : lambda a: int(a),
"round" : round,
- "sgn" : lambda a: abs(a)>epsilon and cmp(a,0) or 0}
+ "sgn" : lambda a: (a > epsilon) - (a < -epsilon) }
def evaluateStack( s ):
op = s.pop()
if op == 'unary -':