class clSearchStrKonwert def __init__ self pass def LikeSyntaxPrepare

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class clSearchStrKonwert:
def __init__(self):
pass
def LikeSyntaxPrepare(self, obj=""):
"""
Заменяет * на % и ? на _ , это нужно для использования LIKE
"""
NewObj=""
if obj=="":
raise NameError("I need a string for check and translate!")
for i in obj:
if i=="*":
NewObj=NewObj+"%"
elif i=="?":
NewObj=NewObj+"_"
else:
NewObj=NewObj+i
return NewObj
def __call__(self,obj):
return self.LikeSyntaxPrepare(obj)
class clCheckPolis:
def __init__(self):
pass
def IsThisPolis(self,pattern=None):
if pattern==None:
return False
else:
return True
def __call__(self,pattern=None):
return self.IsThisPolis(pattern)
class clSearchAt_Agent:
def __init__(self):
self.CheckPolis=clCheckPolis()
self.MaskKonwert=clSearchStrKonwert()
return None
def doQueryString(self,pattern=None):
if (self.CheckPolis(pattern)==False)or(pattern==None):
raise ValueError("I need not null object 'polis' !")
...