Unverified Commit 84f05c05 authored by Tereshchenko Vlad's avatar Tereshchenko Vlad Committed by GitHub
Browse files

Merge pull request #2 from normcontrol/vlter

Small fixes after migration
Showing with 9 additions and 4 deletions
+9 -4
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -8,7 +8,7 @@ from src.styles import Auto
from src.styles import Default
from src.styles import Style
class ListParser():
class ImageParser():
def __init__(self, file):
self.filePath = file
self.fileText = []
......@@ -17,7 +17,7 @@ if __name__ == '__main__':
h = hpy()
h1 = h.heap()
doc = ListParser('listsimages.odt')
doc = ImageParser('listsimages.odt')
print("-----------------------------------------\n")
print("Получение стилей image & frame:\n")
print(Style.get_styles_image(doc))
......
......@@ -33,8 +33,13 @@ if __name__ == '__main__':
print(Auto.get_styles_automatic_styles_list(doc), '\n')
print("--------------------3-2---------------------")
print(Auto.get_styles_automatic_listsText(doc), '\n')
print(Auto.get_style_automatic_by_name(doc, 'WW_CharLFO5LVL1'))
print(Auto.get_style_automatic_by_name(doc, 'WW_CharLFO8LVL1'))
print(Auto.get_style_automatic_by_name(doc, 'WW_CharLFO17LVL8'))
print("--------------------3-3---------------------")
print(Auto.get_style_automatic_by_name(doc, 'LFO2'))
print(Auto.get_style_automatic_by_name(doc, 'LFO5'))
print(Auto.get_style_automatic_by_name(doc, 'LFO16'))
print("----------------------lists-------------------\n")
print("Получение конкретных характеристик:")
ast = Auto.get_style_by_name('listsimages.odt', 'LFO2')
......
......@@ -82,8 +82,8 @@ def get_styles_table(self):
stylesDict[name] = style
for n in ast.childNodes:
if n.qname[1] == "paragraph-properties" or n.qname[1] == "table-properties" \
or n.qname[1] == "table-column-properties" or n.qname[1] == "table-row-properties" or n.qname[1] == "table-cell-properties":
if n.qname[1] == "table-properties" or n.qname[1] == "table-column-properties" \
or n.qname[1] == "table-row-properties" or n.qname[1] == "table-cell-properties":
for k in n.attributes.keys():
style[n.qname[1] + "/" + k[1]] = n.attributes[k]
return stylesDict
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment