Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
message-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 8095ea7e
authored
2019-10-16 10:12:58 -0300
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed sqlite bug
1 parent
e1ec510d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
process.py
services.py
process.py
View file @
8095ea7
from
services
import
serviceFactory
from
services
import
serviceFactory
from
database
import
DBconnection
from
database
import
DBconnection
from
enums
import
Services
,
States
,
Datatypes
,
Table
from
enums
import
Services
,
States
,
Datatypes
,
Table
import
os
,
json
import
os
,
json
,
ipdb
class
Process
:
class
Process
:
...
@@ -45,10 +45,12 @@ class Process:
...
@@ -45,10 +45,12 @@ class Process:
Table
.
dest
:
query
[
Table
.
dest
],
Table
.
dest
:
query
[
Table
.
dest
],
Table
.
serv
:
query
[
Table
.
serv
],
Table
.
serv
:
query
[
Table
.
serv
],
Table
.
type
:
query
[
Table
.
type
],
Table
.
type
:
query
[
Table
.
type
],
Table
.
info
:
query
[
Table
.
info
],
Table
.
conf
:
query
[
Table
.
conf
],
Table
.
state
:
States
.
queued
Table
.
state
:
States
.
queued
}
}
if
query
[
Table
.
info
]:
entities
[
Table
.
info
]
=
query
[
Table
.
info
]
if
query
[
Table
.
conf
]:
entities
[
Table
.
conf
]
=
query
[
Table
.
conf
]
error
=
self
.
conn
.
update
(
"msg"
,(
Table
.
id
,
query
[
Table
.
id
]),
entities
)
error
=
self
.
conn
.
update
(
"msg"
,(
Table
.
id
,
query
[
Table
.
id
]),
entities
)
if
error
:
if
error
:
return
error
return
error
...
@@ -80,7 +82,7 @@ class Process:
...
@@ -80,7 +82,7 @@ class Process:
# todo enviado
# todo enviado
if
len
(
d
)
==
0
:
if
len
(
d
)
==
0
:
# no se espera confirmacion
# no se espera confirmacion
if
query
[
Table
.
conf
]
==
'None'
or
query
[
Table
.
conf
]
==
'None'
:
if
query
[
Table
.
conf
]
==
None
:
self
.
conn
.
query
(
"DELETE FROM msg WHERE id = ?"
,(
query
[
Table
.
id
],))
self
.
conn
.
query
(
"DELETE FROM msg WHERE id = ?"
,(
query
[
Table
.
id
],))
del
query
[
Table
.
id
]
del
query
[
Table
.
id
]
self
.
conn
.
insert
(
"history"
,
query
)
self
.
conn
.
insert
(
"history"
,
query
)
...
...
services.py
View file @
8095ea7
...
@@ -63,7 +63,6 @@ class Wpp1(ServiceBase):
...
@@ -63,7 +63,6 @@ class Wpp1(ServiceBase):
return
type
in
Wpp1
.
Allowed
return
type
in
Wpp1
.
Allowed
def
validateinfo
(
self
,
info
):
def
validateinfo
(
self
,
info
):
info
=
None
if
info
==
'None'
else
info
if
info
==
None
:
if
info
==
None
:
return
True
return
True
i
=
json
.
loads
(
info
)
i
=
json
.
loads
(
info
)
...
@@ -134,7 +133,6 @@ class Mail(ServiceBase):
...
@@ -134,7 +133,6 @@ class Mail(ServiceBase):
return
type
in
Mail
.
Allowed
return
type
in
Mail
.
Allowed
def
validateinfo
(
self
,
info
):
def
validateinfo
(
self
,
info
):
info
=
None
if
info
==
'None'
else
info
if
info
==
None
:
if
info
==
None
:
return
False
return
False
i
=
json
.
loads
(
info
)
i
=
json
.
loads
(
info
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment