File: wordFindTest.py

package info (click to toggle)
python-soappy 0.9.7-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 500 kB
  • ctags: 1,020
  • sloc: python: 7,572; makefile: 43; sh: 16
file content (24 lines) | stat: -rw-r--r-- 766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import SOAP
import sys

def usage():
    print sys.argv[0], "searchString"
    print '''\tcurrently, this can be used to search for word completions or
    anagrams- the function will parse and perform the word-search function if
    there is a "?" or "*" character, and perform the anagram-search function
    otherwise'''
    sys.exit(1)

if len(sys.argv) < 2: usage()

ss = sys.argv[1]

if ss.find('?') > -1 or ss.find('*') > -1: word=1
else: word=0
    
#SOAP.Config.debug = 1
serv = SOAP.SOAPProxy("http://webservices.matlus.com/scripts/WordFind.DLL/soap/IWordFind", namespace="urn:WordFindIntf-IWordFind", soapaction="urn:WordFindIntf-IWordFind#FindWords")
if word: print serv.FindWords(Source=ss)
else:
    serv._sa= ""
    print serv.FindAnagrams(Source=ss)