Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
483061e8
Commit
483061e8
authored
Dec 24, 2013
by
Hilton Bristow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explicit string encoding when writing to file in python3
parent
7cad2c67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
build_info.py
modules/matlab/generator/build_info.py
+1
-1
cvmex.py
modules/matlab/generator/cvmex.py
+1
-1
gen_matlab.py
modules/matlab/generator/gen_matlab.py
+5
-5
No files found.
modules/matlab/generator/build_info.py
View file @
483061e8
...
...
@@ -21,7 +21,7 @@ def substitute(build, output_dir):
# populate template
populated
=
template
.
render
(
build
=
build
,
time
=
time
)
with
open
(
os
.
path
.
join
(
output_dir
,
'buildInformation.m'
),
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
if
__name__
==
"__main__"
:
"""
...
...
modules/matlab/generator/cvmex.py
View file @
483061e8
...
...
@@ -22,7 +22,7 @@ def substitute(cv, output_dir):
# populate template
populated
=
template
.
render
(
cv
=
cv
,
time
=
time
)
with
open
(
os
.
path
.
join
(
output_dir
,
'mex.m'
),
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
if
__name__
==
"__main__"
:
"""
...
...
modules/matlab/generator/gen_matlab.py
View file @
483061e8
...
...
@@ -105,27 +105,27 @@ class MatlabWrapperGenerator(object):
for
method
in
namespace
.
methods
:
populated
=
tfunction
.
render
(
fun
=
method
,
time
=
time
,
includes
=
namespace
.
name
)
with
open
(
output_source_dir
+
'/'
+
method
.
name
+
'.cpp'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
if
namespace
.
name
in
doc
and
method
.
name
in
doc
[
namespace
.
name
]:
populated
=
tdoc
.
render
(
fun
=
method
,
doc
=
doc
[
namespace
.
name
][
method
.
name
],
time
=
time
)
with
open
(
output_class_dir
+
'/'
+
method
.
name
+
'.m'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
# classes
for
clss
in
namespace
.
classes
:
# cpp converter
populated
=
tclassc
.
render
(
clss
=
clss
,
time
=
time
)
with
open
(
output_private_dir
+
'/'
+
clss
.
name
+
'Bridge.cpp'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
# matlab classdef
populated
=
tclassm
.
render
(
clss
=
clss
,
time
=
time
)
with
open
(
output_class_dir
+
'/'
+
clss
.
name
+
'.m'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
# create a global constants lookup table
const
=
dict
(
constants
(
todict
(
parse_tree
.
namespaces
)))
populated
=
tconst
.
render
(
constants
=
const
,
time
=
time
)
with
open
(
output_dir
+
'/cv.m'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
f
.
write
(
populated
.
encode
(
'utf-8'
)
)
if
__name__
==
"__main__"
:
...
...
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