Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
48736f78
Commit
48736f78
authored
Jan 19, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Permit 2 args bool STATUS conditions int assuming equality test
parent
1d729abe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
domotika.py
domotika/domotika.py
+6
-1
proxy.py
domotika/web/proxy.py
+7
-5
No files found.
domotika/domotika.py
View file @
48736f78
...
@@ -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
)
...
...
domotika/web/proxy.py
View file @
48736f78
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment