Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
cloudooo
Commits
e0068547
Commit
e0068547
authored
Feb 16, 2017
by
Boris Kocherov
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t: use with block for open file
parent
2e8fd048
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
cloudooo/handler/x2t/handler.py
cloudooo/handler/x2t/handler.py
+17
-19
No files found.
cloudooo/handler/x2t/handler.py
View file @
e0068547
...
...
@@ -168,8 +168,7 @@ class Handler(object):
os
.
mkdir
(
output_dir
)
output_file_name
=
os
.
path
.
join
(
output_dir
,
"body.txt"
)
config_file
=
open
(
config_file_name
,
"w"
)
with
open
(
config_file_name
,
"w"
)
as
config_file
:
config
=
{
# 'm_sKey': 'from',
'm_sFileFrom'
:
input_file_name
,
...
...
@@ -186,7 +185,6 @@ class Handler(object):
for
key
,
value
in
config
.
items
():
ElementTree
.
SubElement
(
root
,
key
).
text
=
value
ElementTree
.
ElementTree
(
root
).
write
(
config_file
,
encoding
=
'utf-8'
,
xml_declaration
=
True
,
default_namespace
=
None
,
method
=
"xml"
)
config_file
.
close
()
# run convertion binary
p
=
Popen
(
...
...
Boris Kocherov
@bk
mentioned in commit
405454a8
·
Feb 26, 2018
mentioned in commit
405454a8
mentioned in commit 405454a8c5e357f3cc3988a37667f3cc039dff93
Toggle commit list
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