Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
html2protoxml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexis Filipozzi
html2protoxml
Commits
a7a82c55
There was a problem fetching the pipeline summary.
Commit
a7a82c55
authored
8 years ago
by
Alexis Filipozzi
Browse files
Options
Downloads
Patches
Plain Diff
center image only out of table
parent
956bfd67
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data.py
+20
-15
20 additions, 15 deletions
data.py
with
20 additions
and
15 deletions
data.py
+
20
−
15
View file @
a7a82c55
...
@@ -32,17 +32,19 @@ class Image:
...
@@ -32,17 +32,19 @@ class Image:
img
.
attrib
[
"
height
"
]
=
self
.
_height
img
.
attrib
[
"
height
"
]
=
self
.
_height
return
img
return
img
def
to_element
(
self
,
tag_name
=
"
element
"
):
def
to_element
(
self
,
tag_name
=
"
element
"
,
is_in_table
=
False
):
el
=
etree
.
Element
(
tag_name
)
el
=
etree
.
Element
(
tag_name
)
layout
=
etree
.
Element
(
"
layout
"
)
layout
=
etree
.
Element
(
"
layout
"
)
layout
.
attrib
[
"
secondary_alignment
"
]
=
"
CENTER
"
layout
.
attrib
[
"
secondary_alignment
"
]
=
"
CENTER
"
layout
.
attrib
[
"
gap
"
]
=
"
0
"
layout
.
attrib
[
"
gap
"
]
=
"
0
"
layout
.
attrib
[
"
fit_content_height
"
]
=
"
true
"
layout
.
attrib
[
"
fit_content_height
"
]
=
"
true
"
if
not
is_in_table
:
el
.
append
(
layout
)
el
.
append
(
layout
)
top_mg
=
etree
.
Element
(
"
top_margin
"
)
top_mg
=
etree
.
Element
(
"
top_margin
"
)
top_mg
.
text
=
"
20
"
top_mg
.
text
=
"
20
"
layout
.
append
(
top_mg
)
layout
.
append
(
top_mg
)
if
not
is_in_table
:
size
=
etree
.
Element
(
"
size
"
)
size
=
etree
.
Element
(
"
size
"
)
size
.
attrib
[
"
relative_width
"
]
=
"
1
"
size
.
attrib
[
"
relative_width
"
]
=
"
1
"
layout
.
append
(
size
)
layout
.
append
(
size
)
...
@@ -59,6 +61,9 @@ class Image:
...
@@ -59,6 +61,9 @@ class Image:
inner_el
.
append
(
inner_layout
)
inner_el
.
append
(
inner_layout
)
inner_el
.
append
(
self
.
to_xml
())
inner_el
.
append
(
self
.
to_xml
())
else
:
el
.
append
(
layout
)
el
.
append
(
self
.
to_xml
())
return
el
return
el
...
@@ -195,7 +200,7 @@ class Table:
...
@@ -195,7 +200,7 @@ class Table:
if
isinstance
(
cell
,
Image
):
if
isinstance
(
cell
,
Image
):
cell_xml
=
etree
.
Element
(
"
cell
"
)
cell_xml
=
etree
.
Element
(
"
cell
"
)
table
.
append
(
cell_xml
)
table
.
append
(
cell_xml
)
cell_xml
.
append
(
cell
.
to_element
(
"
element
"
))
cell_xml
.
append
(
cell
.
to_element
(
"
element
"
,
True
))
else
:
else
:
table
.
append
(
cell
.
to_element
(
"
cell
"
))
table
.
append
(
cell
.
to_element
(
"
cell
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment