Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
9dec97cc
Commit
9dec97cc
authored
Oct 13, 2011
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last lxml version needs ascii string not utf8
parent
36cd50f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
bt5/erp5_tiosafe_oxatis_test/ExtensionTemplateItem/OxatisTest.py
...5_tiosafe_oxatis_test/ExtensionTemplateItem/OxatisTest.py
+18
-18
No files found.
bt5/erp5_tiosafe_oxatis_test/ExtensionTemplateItem/OxatisTest.py
View file @
9dec97cc
...
@@ -225,10 +225,10 @@ class OxatisTestConnector:
...
@@ -225,10 +225,10 @@ class OxatisTestConnector:
if
not
kw
.
has_key
(
'data'
):
if
not
kw
.
has_key
(
'data'
):
raise
ValueError
,
"No data passed to UserGetList, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to UserGetList, got %s / %s"
%
(
args
,
kw
)
# parse the data to retrieve the date
# parse the data to retrieve the date
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateStart"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateStart"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
date_start
=
element
.
text
date_start
=
element
.
text
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateEnd"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateEnd"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
date_end
=
element
.
text
date_end
=
element
.
text
date
=
etree
.
SubElement
(
user_list
,
'LatestModifiedDateStart'
)
date
=
etree
.
SubElement
(
user_list
,
'LatestModifiedDateStart'
)
...
@@ -264,7 +264,7 @@ class OxatisTestConnector:
...
@@ -264,7 +264,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to UserGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to UserGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the user id
# parse the data to retrieve the user id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
user_id
=
element
.
text
user_id
=
element
.
text
# retrieve the person inside the test module
# retrieve the person inside the test module
...
@@ -274,7 +274,7 @@ class OxatisTestConnector:
...
@@ -274,7 +274,7 @@ class OxatisTestConnector:
raise
KeyError
(
user_id
)
raise
KeyError
(
user_id
)
else
:
else
:
person
=
person_list
[
0
].
getObject
()
person
=
person_list
[
0
].
getObject
()
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,))
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,))
person_dict
=
{}
person_dict
=
{}
for
event
,
element
in
context
:
for
event
,
element
in
context
:
if
element
.
text
is
None
:
if
element
.
text
is
None
:
...
@@ -296,7 +296,7 @@ class OxatisTestConnector:
...
@@ -296,7 +296,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to UserGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to UserGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the user id
# parse the data to retrieve the user id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
user_id
=
element
.
text
user_id
=
element
.
text
# retrieve the person inside the test module
# retrieve the person inside the test module
...
@@ -343,10 +343,10 @@ class OxatisTestConnector:
...
@@ -343,10 +343,10 @@ class OxatisTestConnector:
if
not
kw
.
has_key
(
'data'
):
if
not
kw
.
has_key
(
'data'
):
raise
ValueError
,
"No data passed to UserGetList, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to UserGetList, got %s / %s"
%
(
args
,
kw
)
# parse the data to retrieve the date
# parse the data to retrieve the date
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateStart"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateStart"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
date_start
=
element
.
text
date_start
=
element
.
text
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateEnd"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"LatestModifiedDateEnd"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
date_end
=
element
.
text
date_end
=
element
.
text
date
=
etree
.
SubElement
(
products
,
'LatestModifiedDateStart'
)
date
=
etree
.
SubElement
(
products
,
'LatestModifiedDateStart'
)
...
@@ -375,7 +375,7 @@ class OxatisTestConnector:
...
@@ -375,7 +375,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the product id
# parse the data to retrieve the product id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
resource_id
=
element
.
text
resource_id
=
element
.
text
# retrieve the product inside the test module
# retrieve the product inside the test module
...
@@ -424,7 +424,7 @@ class OxatisTestConnector:
...
@@ -424,7 +424,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the product id
# parse the data to retrieve the product id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
resource_id
=
element
.
text
resource_id
=
element
.
text
# retrieve the product inside the test module
# retrieve the product inside the test module
...
@@ -446,7 +446,7 @@ class OxatisTestConnector:
...
@@ -446,7 +446,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the product id
# parse the data to retrieve the product id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
resource_id
=
element
.
text
resource_id
=
element
.
text
# retrieve the product inside the test module
# retrieve the product inside the test module
...
@@ -457,7 +457,7 @@ class OxatisTestConnector:
...
@@ -457,7 +457,7 @@ class OxatisTestConnector:
raise
KeyError
(
resource_id
)
raise
KeyError
(
resource_id
)
else
:
else
:
resource
=
resource_list
[
0
].
getObject
()
resource
=
resource_list
[
0
].
getObject
()
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"Name"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"Name"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
name
=
element
.
text
name
=
element
.
text
resource
.
edit
(
name
=
name
)
resource
.
edit
(
name
=
name
)
...
@@ -471,7 +471,7 @@ class OxatisTestConnector:
...
@@ -471,7 +471,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to ProductGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the product id
# parse the data to retrieve the product id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
resource_id
=
element
.
text
resource_id
=
element
.
text
# retrieve the product inside the test module
# retrieve the product inside the test module
...
@@ -482,7 +482,7 @@ class OxatisTestConnector:
...
@@ -482,7 +482,7 @@ class OxatisTestConnector:
raise
KeyError
(
resource_id
)
raise
KeyError
(
resource_id
)
else
:
else
:
resource
=
resource_list
[
0
].
getObject
()
resource
=
resource_list
[
0
].
getObject
()
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"Description"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"Description"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
desc
=
element
.
text
desc
=
element
.
text
resource
.
edit
(
description
=
desc
)
resource
.
edit
(
description
=
desc
)
...
@@ -500,11 +500,11 @@ class OxatisTestConnector:
...
@@ -500,11 +500,11 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to OrderGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to OrderGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the order id
# parse the data to retrieve the order id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OrderDateStart"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OrderDateStart"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
start_date
=
DateTime
(
element
.
text
)
start_date
=
DateTime
(
element
.
text
)
date_start
=
element
.
text
date_start
=
element
.
text
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OrderDateEnd"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OrderDateEnd"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
stop_date
=
DateTime
(
element
.
text
)
stop_date
=
DateTime
(
element
.
text
)
date_end
=
element
.
text
date_end
=
element
.
text
...
@@ -552,7 +552,7 @@ class OxatisTestConnector:
...
@@ -552,7 +552,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to OrderGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to OrderGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the order id
# parse the data to retrieve the order id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
sale_order_id
=
element
.
text
sale_order_id
=
element
.
text
# retrieve the order inside the test module
# retrieve the order inside the test module
...
@@ -595,7 +595,7 @@ class OxatisTestConnector:
...
@@ -595,7 +595,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to OptionTypesGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to OptionTypesGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the base category id
# parse the data to retrieve the base category id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
base_category_id
=
element
.
text
base_category_id
=
element
.
text
...
@@ -624,7 +624,7 @@ class OxatisTestConnector:
...
@@ -624,7 +624,7 @@ class OxatisTestConnector:
raise
ValueError
,
"No data passed to OptionsValuesGet, got %s / %s"
%
(
args
,
kw
)
raise
ValueError
,
"No data passed to OptionsValuesGet, got %s / %s"
%
(
args
,
kw
)
# Must check xml validity here
# Must check xml validity here
# parse the data to retrieve the base category id
# parse the data to retrieve the base category id
context
=
etree
.
iterparse
(
StringIO
(
kw
[
'data'
]
),
events
=
(
'end'
,),
tag
=
"OxID"
)
context
=
etree
.
iterparse
(
StringIO
(
str
(
kw
[
'data'
])
),
events
=
(
'end'
,),
tag
=
"OxID"
)
for
event
,
element
in
context
:
for
event
,
element
in
context
:
category_id
=
element
.
text
category_id
=
element
.
text
...
...
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