Commit 48736f78 authored by nextime's avatar nextime

Permit 2 args bool STATUS conditions int assuming equality test

parent 1d729abe
...@@ -1113,7 +1113,12 @@ class domotikaService(service.Service): ...@@ -1113,7 +1113,12 @@ class domotikaService(service.Service):
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype) WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype)
except: except:
pass pass
elif restype in ['bool','int'] and len(st)==2 and genutils.is_number(st[1]):
try:
ret=doQuery("""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)="+st['1'], restype)
except:
pass
elif restype=='string' and len(st)>0: elif restype=='string' and len(st)>0:
try: try:
ret=doQuery("SELECT value FROM statusrealtime WHERE DMDOMAIN(status_name,'"+str(st[0])+"')=1", restype=False) ret=doQuery("SELECT value FROM statusrealtime WHERE DMDOMAIN(status_name,'"+str(st[0])+"')=1", restype=False)
......
...@@ -78,6 +78,7 @@ class WebProxyClient(ProxyClient): ...@@ -78,6 +78,7 @@ class WebProxyClient(ProxyClient):
headers["connection"] = "close" headers["connection"] = "close"
headers.pop('keep-alive', None) headers.pop('keep-alive', None)
self.headers = headers self.headers = headers
log.debug("Proxy Client SEND headers: "+str(headers))
ProxyClient.__init__(self, ProxyClient.__init__(self,
command=command, command=command,
rest=rest, rest=rest,
...@@ -126,18 +127,17 @@ class WebProxyResource(ReverseProxyResource): ...@@ -126,18 +127,17 @@ class WebProxyResource(ReverseProxyResource):
def __init__(self, *arg, **kwarg): def __init__(self, *arg, **kwarg):
log.debug("WebProxy called") log.debug("WebProxy called")
#try: try:
if True:
if 'remove' in kwarg.keys(): if 'remove' in kwarg.keys():
self.remove=int(kwarg['remove']) self.remove=int(kwarg['remove'])
del kwarg['remove'] del kwarg['remove']
#except: except:
# log.debug("error in remove") log.debug("error in remove")
return ReverseProxyResource.__init__(self, *arg, **kwarg) return ReverseProxyResource.__init__(self, *arg, **kwarg)
def getChild(self, path, request): def getChild(self, path, request):
log.debug("APACHE PROXY SEND HEADERS "+str(request.requestHeaders)) #log.debug("APACHE PROXY SEND HEADERS "+str(request.requestHeaders))
#return ReverseProxyResource.getChild(self, path, request) #return ReverseProxyResource.getChild(self, path, request)
return WebProxyResource(self.host, self.port, self.path+'/'+urlquote(path, safe=""), remove=self.remove) return WebProxyResource(self.host, self.port, self.path+'/'+urlquote(path, safe=""), remove=self.remove)
...@@ -153,6 +153,8 @@ class WebProxyResource(ReverseProxyResource): ...@@ -153,6 +153,8 @@ class WebProxyResource(ReverseProxyResource):
headerhost=request.getHeader('host') headerhost=request.getHeader('host')
headers['host'] = hostport(self.host, self.port, headerhost) headers['host'] = hostport(self.host, self.port, headerhost)
log.debug("APACHE PROXY / SEND HEADERS "+str(request.requestHeaders))
try: try:
request.content.seek(0, 0) request.content.seek(0, 0)
reqdata=request.content.read() reqdata=request.content.read()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment