How to use add_param method in autotest

Best Python code snippet using autotest_python

Styles.py

Source:Styles.py Github

copy

Full Screen

2from Code.Odt import XML3class Styles(XML.XML):4 def __init__(self):5 XML.XML.__init__(self, "office:document-styles")6 self.add_param("xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0")7 self.add_param("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0")8 self.add_param("xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0")9 self.add_param("xmlns:ooo", "http://openoffice.org/2004/office")10 self.add_param("xmlns:xlink", "http://www.w3.org/1999/xlink")11 self.add_param("xmlns:dc", "http://purl.org/dc/elements/1.1/")12 self.add_param("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0")13 self.add_param("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0")14 self.add_param("xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0")15 self.add_param("xmlns:dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0")16 self.add_param("xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0")17 self.add_param("xmlns:chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0")18 self.add_param("xmlns:rpt", "http://openoffice.org/2005/report")19 self.add_param("xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0")20 self.add_param("xmlns:number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0")21 self.add_param("xmlns:ooow", "http://openoffice.org/2004/writer")22 self.add_param("xmlns:oooc", "http://openoffice.org/2004/calc")23 self.add_param("xmlns:of", "urn:oasis:names:tc:opendocument:xmlns:of:1.2")24 self.add_param("xmlns:tableooo", "http://openoffice.org/2009/table")25 self.add_param("xmlns:calcext", "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0")26 self.add_param("xmlns:drawooo", "http://openoffice.org/2010/draw")27 self.add_param("xmlns:loext", "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0")28 self.add_param("xmlns:field", "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0")29 self.add_param("xmlns:math", "http://www.w3.org/1998/Math/MathML")30 self.add_param("xmlns:form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0")31 self.add_param("xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0")32 self.add_param("xmlns:dom", "http://www.w3.org/2001/xml-events")33 self.add_param("xmlns:xhtml", "http://www.w3.org/1999/xhtml")34 self.add_param("xmlns:grddl", "http://www.w3.org/2003/g/data-view#")35 self.add_param("xmlns:css3t", "http://www.w3.org/TR/css3-text/")36 self.add_param("xmlns:officeooo", "http://openoffice.org/2009/office")37 self.add_param("office:version", "1.3")38 element1 = XML.Element("office:font-face-decls")39 self.add_content(element1)40 element2 = XML.Element("style:font-face")41 element2.add_param("style:name", "Mangal1")42 element2.add_param("svg:font-family", "Mangal")43 element1.add_content(element2)44 element3 = XML.Element("style:font-face")45 element3.add_param("style:name", "Liberation Serif")46 element3.add_param("svg:font-family", "'Liberation Serif'")47 element3.add_param("style:font-family-generic", "roman")48 element3.add_param("style:font-pitch", "variable")49 element1.add_content(element3)50 element4 = XML.Element("style:font-face")51 element4.add_param("style:name", "Liberation Sans")52 element4.add_param("svg:font-family", "'Liberation Sans'")53 element4.add_param("style:font-family-generic", "swiss")54 element4.add_param("style:font-pitch", "variable")55 element1.add_content(element4)56 element5 = XML.Element("style:font-face")57 element5.add_param("style:name", "Mangal")58 element5.add_param("svg:font-family", "Mangal")59 element5.add_param("style:font-family-generic", "system")60 element5.add_param("style:font-pitch", "variable")61 element1.add_content(element5)62 element6 = XML.Element("style:font-face")63 element6.add_param("style:name", "Microsoft YaHei")64 element6.add_param("svg:font-family", "'Microsoft YaHei'")65 element6.add_param("style:font-family-generic", "system")66 element6.add_param("style:font-pitch", "variable")67 element1.add_content(element6)68 element7 = XML.Element("style:font-face")69 element7.add_param("style:name", "NSimSun")70 element7.add_param("svg:font-family", "NSimSun")71 element7.add_param("style:font-family-generic", "system")72 element7.add_param("style:font-pitch", "variable")73 element1.add_content(element7)74 element8 = XML.Element("office:styles")75 self.add_content(element8)76 element9 = XML.Element("style:default-style")77 element9.add_param("style:family", "graphic")78 element8.add_content(element9)79 element10 = XML.Element("style:graphic-properties")80 element10.add_param("svg:stroke-color", "#3465a4")81 element10.add_param("draw:fill-color", "#729fcf")82 element10.add_param("fo:wrap-option", "no-wrap")83 element10.add_param("draw:shadow-offset-x", "0.3cm")84 element10.add_param("draw:shadow-offset-y", "0.3cm")85 element10.add_param("draw:start-line-spacing-horizontal", "0.283cm")86 element10.add_param("draw:start-line-spacing-vertical", "0.283cm")87 element10.add_param("draw:end-line-spacing-horizontal", "0.283cm")88 element10.add_param("draw:end-line-spacing-vertical", "0.283cm")89 element10.add_param("style:flow-with-text", "false")90 element9.add_content(element10)91 element11 = XML.Element("style:paragraph-properties")92 element11.add_param("style:text-autospace", "ideograph-alpha")93 element11.add_param("style:line-break", "strict")94 element11.add_param("style:writing-mode", "lr-tb")95 element11.add_param("style:font-independent-line-spacing", "false")96 element9.add_content(element11)97 element12 = XML.Element("style:tab-stops")98 element11.add_content(element12)99 element13 = XML.Element("style:text-properties")100 element13.add_param("style:use-window-font-color", "true")101 element13.add_param("loext:opacity", "0%")102 element13.add_param("style:font-name", "Liberation Serif")103 element13.add_param("fo:font-size", "12pt")104 element13.add_param("fo:language", "es")105 element13.add_param("fo:country", "ES")106 element13.add_param("style:letter-kerning", "true")107 element13.add_param("style:font-name-asian", "NSimSun")108 element13.add_param("style:font-size-asian", "10.5pt")109 element13.add_param("style:language-asian", "zh")110 element13.add_param("style:country-asian", "CN")111 element13.add_param("style:font-name-complex", "Mangal")112 element13.add_param("style:font-size-complex", "12pt")113 element13.add_param("style:language-complex", "hi")114 element13.add_param("style:country-complex", "IN")115 element9.add_content(element13)116 element14 = XML.Element("style:default-style")117 element14.add_param("style:family", "paragraph")118 element8.add_content(element14)119 element15 = XML.Element("style:paragraph-properties")120 element15.add_param("fo:orphans", "2")121 element15.add_param("fo:widows", "2")122 element15.add_param("fo:hyphenation-ladder-count", "no-limit")123 element15.add_param("style:text-autospace", "ideograph-alpha")124 element15.add_param("style:punctuation-wrap", "hanging")125 element15.add_param("style:line-break", "strict")126 element15.add_param("style:tab-stop-distance", "1.251cm")127 element15.add_param("style:writing-mode", "page")128 element14.add_content(element15)129 element16 = XML.Element("style:text-properties")130 element16.add_param("style:use-window-font-color", "true")131 element16.add_param("loext:opacity", "0%")132 element16.add_param("style:font-name", "Liberation Serif")133 element16.add_param("fo:font-size", "12pt")134 element16.add_param("fo:language", "es")135 element16.add_param("fo:country", "ES")136 element16.add_param("style:letter-kerning", "true")137 element16.add_param("style:font-name-asian", "NSimSun")138 element16.add_param("style:font-size-asian", "10.5pt")139 element16.add_param("style:language-asian", "zh")140 element16.add_param("style:country-asian", "CN")141 element16.add_param("style:font-name-complex", "Mangal")142 element16.add_param("style:font-size-complex", "12pt")143 element16.add_param("style:language-complex", "hi")144 element16.add_param("style:country-complex", "IN")145 element16.add_param("fo:hyphenate", "false")146 element16.add_param("fo:hyphenation-remain-char-count", "2")147 element16.add_param("fo:hyphenation-push-char-count", "2")148 element16.add_param("loext:hyphenation-no-caps", "false")149 element14.add_content(element16)150 element17 = XML.Element("style:default-style")151 element17.add_param("style:family", "table")152 element8.add_content(element17)153 element18 = XML.Element("style:table-properties")154 element18.add_param("table:border-model", "collapsing")155 element17.add_content(element18)156 element19 = XML.Element("style:default-style")157 element19.add_param("style:family", "table-row")158 element8.add_content(element19)159 element20 = XML.Element("style:table-row-properties")160 element20.add_param("fo:keep-together", "auto")161 element19.add_content(element20)162 element21 = XML.Element("style:style")163 element21.add_param("style:name", "Standard")164 element21.add_param("style:family", "paragraph")165 element21.add_param("style:class", "text")166 element8.add_content(element21)167 element22 = XML.Element("style:style")168 element22.add_param("style:name", "Heading")169 element22.add_param("style:family", "paragraph")170 element22.add_param("style:parent-style-name", "Standard")171 element22.add_param("style:next-style-name", "Text_20_body")172 element22.add_param("style:class", "text")173 element8.add_content(element22)174 element23 = XML.Element("style:paragraph-properties")175 element23.add_param("fo:margin-top", "0.423cm")176 element23.add_param("fo:margin-bottom", "0.212cm")177 element23.add_param("style:contextual-spacing", "false")178 element23.add_param("fo:keep-with-next", "always")179 element22.add_content(element23)180 element24 = XML.Element("style:text-properties")181 element24.add_param("style:font-name", "Liberation Sans")182 element24.add_param("fo:font-family", "'Liberation Sans'")183 element24.add_param("style:font-family-generic", "swiss")184 element24.add_param("style:font-pitch", "variable")185 element24.add_param("fo:font-size", "14pt")186 element24.add_param("style:font-name-asian", "Microsoft YaHei")187 element24.add_param("style:font-family-asian", "'Microsoft YaHei'")188 element24.add_param("style:font-family-generic-asian", "system")189 element24.add_param("style:font-pitch-asian", "variable")190 element24.add_param("style:font-size-asian", "14pt")191 element24.add_param("style:font-name-complex", "Mangal")192 element24.add_param("style:font-family-complex", "Mangal")193 element24.add_param("style:font-family-generic-complex", "system")194 element24.add_param("style:font-pitch-complex", "variable")195 element24.add_param("style:font-size-complex", "14pt")196 element22.add_content(element24)197 element25 = XML.Element("style:style")198 element25.add_param("style:name", "Text_20_body")199 element25.add_param("style:display-name", "Text body")200 element25.add_param("style:family", "paragraph")201 element25.add_param("style:parent-style-name", "Standard")202 element25.add_param("style:class", "text")203 element8.add_content(element25)204 element26 = XML.Element("style:paragraph-properties")205 element26.add_param("fo:margin-top", "0cm")206 element26.add_param("fo:margin-bottom", "0.247cm")207 element26.add_param("style:contextual-spacing", "false")208 element26.add_param("fo:line-height", "115%")209 element25.add_content(element26)210 element27 = XML.Element("style:style")211 element27.add_param("style:name", "List")212 element27.add_param("style:family", "paragraph")213 element27.add_param("style:parent-style-name", "Text_20_body")214 element27.add_param("style:class", "list")215 element8.add_content(element27)216 element28 = XML.Element("style:text-properties")217 element28.add_param("style:font-size-asian", "12pt")218 element28.add_param("style:font-name-complex", "Mangal1")219 element28.add_param("style:font-family-complex", "Mangal")220 element27.add_content(element28)221 element29 = XML.Element("style:style")222 element29.add_param("style:name", "Caption")223 element29.add_param("style:family", "paragraph")224 element29.add_param("style:parent-style-name", "Standard")225 element29.add_param("style:class", "extra")226 element8.add_content(element29)227 element30 = XML.Element("style:paragraph-properties")228 element30.add_param("fo:margin-top", "0.212cm")229 element30.add_param("fo:margin-bottom", "0.212cm")230 element30.add_param("style:contextual-spacing", "false")231 element30.add_param("text:number-lines", "false")232 element30.add_param("text:line-number", "0")233 element29.add_content(element30)234 element31 = XML.Element("style:text-properties")235 element31.add_param("fo:font-size", "12pt")236 element31.add_param("fo:font-style", "italic")237 element31.add_param("style:font-size-asian", "12pt")238 element31.add_param("style:font-style-asian", "italic")239 element31.add_param("style:font-name-complex", "Mangal1")240 element31.add_param("style:font-family-complex", "Mangal")241 element31.add_param("style:font-size-complex", "12pt")242 element31.add_param("style:font-style-complex", "italic")243 element29.add_content(element31)244 element32 = XML.Element("style:style")245 element32.add_param("style:name", "Index")246 element32.add_param("style:family", "paragraph")247 element32.add_param("style:parent-style-name", "Standard")248 element32.add_param("style:class", "index")249 element8.add_content(element32)250 element33 = XML.Element("style:paragraph-properties")251 element33.add_param("text:number-lines", "false")252 element33.add_param("text:line-number", "0")253 element32.add_content(element33)254 element34 = XML.Element("style:text-properties")255 element34.add_param("fo:language", "zxx")256 element34.add_param("fo:country", "none")257 element34.add_param("style:font-size-asian", "12pt")258 element34.add_param("style:language-asian", "zxx")259 element34.add_param("style:country-asian", "none")260 element34.add_param("style:font-name-complex", "Mangal1")261 element34.add_param("style:font-family-complex", "Mangal")262 element34.add_param("style:language-complex", "zxx")263 element34.add_param("style:country-complex", "none")264 element32.add_content(element34)265 element35 = XML.Element("style:style")266 element35.add_param("style:name", "Header_20_and_20_Footer")267 element35.add_param("style:display-name", "Header and Footer")268 element35.add_param("style:family", "paragraph")269 element35.add_param("style:parent-style-name", "Standard")270 element35.add_param("style:class", "extra")271 element8.add_content(element35)272 element36 = XML.Element("style:paragraph-properties")273 element36.add_param("text:number-lines", "false")274 element36.add_param("text:line-number", "0")275 element35.add_content(element36)276 element37 = XML.Element("style:tab-stops")277 element36.add_content(element37)278 element38 = XML.Element("style:tab-stop")279 element38.add_param("style:position", "12.85cm")280 element38.add_param("style:type", "center")281 element37.add_content(element38)282 element39 = XML.Element("style:tab-stop")283 element39.add_param("style:position", "25.7cm")284 element39.add_param("style:type", "right")285 element37.add_content(element39)286 element40 = XML.Element("style:style")287 element40.add_param("style:name", "Header")288 element40.add_param("style:family", "paragraph")289 element40.add_param("style:parent-style-name", "Header_20_and_20_Footer")290 element40.add_param("style:class", "extra")291 element8.add_content(element40)292 element41 = XML.Element("style:paragraph-properties")293 element41.add_param("text:number-lines", "false")294 element41.add_param("text:line-number", "0")295 element40.add_content(element41)296 element42 = XML.Element("style:tab-stops")297 element41.add_content(element42)298 element43 = XML.Element("style:tab-stop")299 element43.add_param("style:position", "12.85cm")300 element43.add_param("style:type", "center")301 element42.add_content(element43)302 element44 = XML.Element("style:tab-stop")303 element44.add_param("style:position", "25.7cm")304 element44.add_param("style:type", "right")305 element42.add_content(element44)306 element45 = XML.Element("style:style")307 element45.add_param("style:name", "Table_20_Contents")308 element45.add_param("style:display-name", "Table Contents")309 element45.add_param("style:family", "paragraph")310 element45.add_param("style:parent-style-name", "Standard")311 element45.add_param("style:class", "extra")312 element8.add_content(element45)313 element46 = XML.Element("style:paragraph-properties")314 element46.add_param("fo:orphans", "0")315 element46.add_param("fo:widows", "0")316 element46.add_param("text:number-lines", "false")317 element46.add_param("text:line-number", "0")318 element45.add_content(element46)319 element47 = XML.Element("style:style")320 element47.add_param("style:name", "Footer")321 element47.add_param("style:family", "paragraph")322 element47.add_param("style:parent-style-name", "Header_20_and_20_Footer")323 element47.add_param("style:class", "extra")324 element8.add_content(element47)325 element48 = XML.Element("style:paragraph-properties")326 element48.add_param("text:number-lines", "false")327 element48.add_param("text:line-number", "0")328 element47.add_content(element48)329 element49 = XML.Element("style:tab-stops")330 element48.add_content(element49)331 element50 = XML.Element("style:tab-stop")332 element50.add_param("style:position", "8.5cm")333 element50.add_param("style:type", "center")334 element49.add_content(element50)335 element51 = XML.Element("style:tab-stop")336 element51.add_param("style:position", "17cm")337 element51.add_param("style:type", "right")338 element49.add_content(element51)339 element52 = XML.Element("style:style")340 element52.add_param("style:name", "Internet_20_link")341 element52.add_param("style:display-name", "Internet link")342 element52.add_param("style:family", "text")343 element8.add_content(element52)344 element53 = XML.Element("style:text-properties")345 element53.add_param("fo:color", "#000080")346 element53.add_param("loext:opacity", "100%")347 element53.add_param("fo:language", "zxx")348 element53.add_param("fo:country", "none")349 element53.add_param("style:text-underline-style", "solid")350 element53.add_param("style:text-underline-width", "auto")351 element53.add_param("style:text-underline-color", "font-color")352 element53.add_param("style:language-asian", "zxx")353 element53.add_param("style:country-asian", "none")354 element53.add_param("style:language-complex", "zxx")355 element53.add_param("style:country-complex", "none")356 element52.add_content(element53)357 element54 = XML.Element("style:style")358 element54.add_param("style:name", "Graphics")359 element54.add_param("style:family", "graphic")360 element8.add_content(element54)361 element55 = XML.Element("style:graphic-properties")362 element55.add_param("text:anchor-type", "paragraph")363 element55.add_param("svg:x", "0cm")364 element55.add_param("svg:y", "0cm")365 element55.add_param("style:wrap", "dynamic")366 element55.add_param("style:number-wrapped-paragraphs", "no-limit")367 element55.add_param("style:wrap-contour", "false")368 element55.add_param("style:vertical-pos", "top")369 element55.add_param("style:vertical-rel", "paragraph")370 element55.add_param("style:horizontal-pos", "center")371 element55.add_param("style:horizontal-rel", "paragraph")372 element54.add_content(element55)373 element56 = XML.Element("text:outline-style")374 element56.add_param("style:name", "Outline")375 element8.add_content(element56)376 element57 = XML.Element("text:outline-level-style")377 element57.add_param("text:level", "1")378 element57.add_param("style:num-format", "")379 element56.add_content(element57)380 element58 = XML.Element("style:list-level-properties")381 element58.add_param("text:list-level-position-and-space-mode", "label-alignment")382 element57.add_content(element58)383 element59 = XML.Element("style:list-level-label-alignment")384 element59.add_param("text:label-followed-by", "listtab")385 element58.add_content(element59)386 element60 = XML.Element("text:outline-level-style")387 element60.add_param("text:level", "2")388 element60.add_param("style:num-format", "")389 element56.add_content(element60)390 element61 = XML.Element("style:list-level-properties")391 element61.add_param("text:list-level-position-and-space-mode", "label-alignment")392 element60.add_content(element61)393 element62 = XML.Element("style:list-level-label-alignment")394 element62.add_param("text:label-followed-by", "listtab")395 element61.add_content(element62)396 element63 = XML.Element("text:outline-level-style")397 element63.add_param("text:level", "3")398 element63.add_param("style:num-format", "")399 element56.add_content(element63)400 element64 = XML.Element("style:list-level-properties")401 element64.add_param("text:list-level-position-and-space-mode", "label-alignment")402 element63.add_content(element64)403 element65 = XML.Element("style:list-level-label-alignment")404 element65.add_param("text:label-followed-by", "listtab")405 element64.add_content(element65)406 element66 = XML.Element("text:outline-level-style")407 element66.add_param("text:level", "4")408 element66.add_param("style:num-format", "")409 element56.add_content(element66)410 element67 = XML.Element("style:list-level-properties")411 element67.add_param("text:list-level-position-and-space-mode", "label-alignment")412 element66.add_content(element67)413 element68 = XML.Element("style:list-level-label-alignment")414 element68.add_param("text:label-followed-by", "listtab")415 element67.add_content(element68)416 element69 = XML.Element("text:outline-level-style")417 element69.add_param("text:level", "5")418 element69.add_param("style:num-format", "")419 element56.add_content(element69)420 element70 = XML.Element("style:list-level-properties")421 element70.add_param("text:list-level-position-and-space-mode", "label-alignment")422 element69.add_content(element70)423 element71 = XML.Element("style:list-level-label-alignment")424 element71.add_param("text:label-followed-by", "listtab")425 element70.add_content(element71)426 element72 = XML.Element("text:outline-level-style")427 element72.add_param("text:level", "6")428 element72.add_param("style:num-format", "")429 element56.add_content(element72)430 element73 = XML.Element("style:list-level-properties")431 element73.add_param("text:list-level-position-and-space-mode", "label-alignment")432 element72.add_content(element73)433 element74 = XML.Element("style:list-level-label-alignment")434 element74.add_param("text:label-followed-by", "listtab")435 element73.add_content(element74)436 element75 = XML.Element("text:outline-level-style")437 element75.add_param("text:level", "7")438 element75.add_param("style:num-format", "")439 element56.add_content(element75)440 element76 = XML.Element("style:list-level-properties")441 element76.add_param("text:list-level-position-and-space-mode", "label-alignment")442 element75.add_content(element76)443 element77 = XML.Element("style:list-level-label-alignment")444 element77.add_param("text:label-followed-by", "listtab")445 element76.add_content(element77)446 element78 = XML.Element("text:outline-level-style")447 element78.add_param("text:level", "8")448 element78.add_param("style:num-format", "")449 element56.add_content(element78)450 element79 = XML.Element("style:list-level-properties")451 element79.add_param("text:list-level-position-and-space-mode", "label-alignment")452 element78.add_content(element79)453 element80 = XML.Element("style:list-level-label-alignment")454 element80.add_param("text:label-followed-by", "listtab")455 element79.add_content(element80)456 element81 = XML.Element("text:outline-level-style")457 element81.add_param("text:level", "9")458 element81.add_param("style:num-format", "")459 element56.add_content(element81)460 element82 = XML.Element("style:list-level-properties")461 element82.add_param("text:list-level-position-and-space-mode", "label-alignment")462 element81.add_content(element82)463 element83 = XML.Element("style:list-level-label-alignment")464 element83.add_param("text:label-followed-by", "listtab")465 element82.add_content(element83)466 element84 = XML.Element("text:outline-level-style")467 element84.add_param("text:level", "10")468 element84.add_param("style:num-format", "")469 element56.add_content(element84)470 element85 = XML.Element("style:list-level-properties")471 element85.add_param("text:list-level-position-and-space-mode", "label-alignment")472 element84.add_content(element85)473 element86 = XML.Element("style:list-level-label-alignment")474 element86.add_param("text:label-followed-by", "listtab")475 element85.add_content(element86)476 element87 = XML.Element("text:notes-configuration")477 element87.add_param("text:note-class", "footnote")478 element87.add_param("style:num-format", "1")479 element87.add_param("text:start-value", "0")480 element87.add_param("text:footnotes-position", "page")481 element87.add_param("text:start-numbering-at", "document")482 element8.add_content(element87)483 element88 = XML.Element("text:notes-configuration")484 element88.add_param("text:note-class", "endnote")485 element88.add_param("style:num-format", "i")486 element88.add_param("text:start-value", "0")487 element8.add_content(element88)488 element89 = XML.Element("text:linenumbering-configuration")489 element89.add_param("text:number-lines", "false")490 element89.add_param("text:offset", "0.499cm")491 element89.add_param("style:num-format", "1")492 element89.add_param("text:number-position", "left")493 element89.add_param("text:increment", "5")494 element8.add_content(element89)495 element90 = XML.Element("office:automatic-styles")496 self.add_content(element90)497 element91 = XML.Element("style:style")498 element91.add_param("style:name", "MP1")499 element91.add_param("style:family", "paragraph")500 element91.add_param("style:parent-style-name", "Header")501 element90.add_content(element91)502 element92 = XML.Element("style:paragraph-properties")503 element92.add_param("fo:text-align", "center")504 element92.add_param("style:justify-single-word", "false")505 element91.add_content(element92)506 element93 = XML.Element("style:text-properties")507 element93.add_param("fo:font-weight", "bold")508 element93.add_param("officeooo:rsid", "00033015")509 element93.add_param("officeooo:paragraph-rsid", "00033015")510 element93.add_param("style:font-weight-asian", "bold")511 element93.add_param("style:font-weight-complex", "bold")512 element91.add_content(element93)513 element94 = XML.Element("style:style")514 element94.add_param("style:name", "MP2")515 element94.add_param("style:family", "paragraph")516 element94.add_param("style:parent-style-name", "Footer")517 element90.add_content(element94)518 element95 = XML.Element("style:paragraph-properties")519 element95.add_param("fo:text-align", "end")520 element95.add_param("style:justify-single-word", "false")521 element94.add_content(element95)522 element96 = XML.Element("style:page-layout")523 element96.add_param("style:name", "Mpm1")524 element90.add_content(element96)525 element97 = XML.Element("style:page-layout-properties")526 element97.add_param("fo:page-width", "21.001cm")527 element97.add_param("fo:page-height", "29.7cm")528 element97.add_param("style:num-format", "1")529 element97.add_param("style:print-orientation", "portrait")530 element97.add_param("fo:margin-top", "2cm")531 element97.add_param("fo:margin-bottom", "2cm")532 element97.add_param("fo:margin-left", "2cm")533 element97.add_param("fo:margin-right", "2cm")534 element97.add_param("style:writing-mode", "lr-tb")535 element97.add_param("style:layout-grid-color", "#c0c0c0")536 element97.add_param("style:layout-grid-lines", "20")537 element97.add_param("style:layout-grid-base-height", "0.706cm")538 element97.add_param("style:layout-grid-ruby-height", "0.353cm")539 element97.add_param("style:layout-grid-mode", "none")540 element97.add_param("style:layout-grid-ruby-below", "false")541 element97.add_param("style:layout-grid-print", "false")542 element97.add_param("style:layout-grid-display", "false")543 element97.add_param("style:footnote-max-height", "0cm")544 element96.add_content(element97)545 element98 = XML.Element("style:footnote-sep")546 element98.add_param("style:width", "0.018cm")547 element98.add_param("style:distance-before-sep", "0.101cm")548 element98.add_param("style:distance-after-sep", "0.101cm")549 element98.add_param("style:line-style", "solid")550 element98.add_param("style:adjustment", "left")551 element98.add_param("style:rel-width", "25%")552 element98.add_param("style:color", "#000000")553 element97.add_content(element98)554 element99 = XML.Element("style:header-style")555 element96.add_content(element99)556 element100 = XML.Element("style:header-footer-properties")557 element100.add_param("fo:min-height", "0cm")558 element100.add_param("fo:margin-left", "0cm")559 element100.add_param("fo:margin-right", "0cm")560 element100.add_param("fo:margin-bottom", "0.499cm")561 element100.add_param("fo:background-color", "transparent")562 element100.add_param("draw:fill", "none")563 element100.add_param("draw:fill-color", "#729fcf")564 element99.add_content(element100)565 element101 = XML.Element("style:footer-style")566 element96.add_content(element101)567 element102 = XML.Element("style:header-footer-properties")568 element102.add_param("fo:min-height", "0.6cm")569 element102.add_param("fo:margin-left", "0cm")570 element102.add_param("fo:margin-right", "0cm")571 element102.add_param("fo:margin-top", "0.499cm")572 element102.add_param("fo:background-color", "transparent")573 element102.add_param("style:dynamic-spacing", "false")574 element102.add_param("draw:fill", "none")575 element101.add_content(element102)576 element103 = XML.Element("office:master-styles")577 self.add_content(element103)578 element104 = XML.Element("style:master-page")579 element104.add_param("style:name", "Standard")580 element104.add_param("style:page-layout-name", "Mpm1")581 element103.add_content(element104)582 element105 = XML.Element("style:header")583 element104.add_content(element105)584 element106 = XML.Element("text:p")585 element106.add_param("text:style-name", "MP1")586 element105.add_content(element106)587 element106.set_value("Lucas Chess")588 element107 = XML.Element("style:footer")589 element104.add_content(element107)590 element108 = XML.Element("text:p")591 element108.add_param("text:style-name", "MP2")592 element107.add_content(element108)593 element109 = XML.Element("text:page-number")594 element109.add_param("text:select-page", "current")595 element108.add_content(element109)596 element109.set_value("5")597 element110 = XML.Element("text:page-count")598 element108.add_content(element110)599 element110.set_value("5")600 element109.set_later("/")601 def run(self, folder):602 path = os.path.join(folder, "styles.xml")603 self.save(path)604 def landscape(self):605 """element71 = XML.Element("style:page-layout-properties")606 element71.add_param("fo:page-width", "21.001cm")607 element71.add_param("fo:page-height", "29.7cm")608 element71.add_param("style:num-format", "1")609 element71.add_param("style:print-orientation", "portrait")610 """611 element = self.seek("style:page-layout-properties")612 element.change_param("fo:page-height", "21.00cm")613 element.change_param("fo:page-width", "29.70cm")614 element.change_param("style:print-orientation", "landscape")615 def header(self, txt):616 element = self.seek_param_key("text:p", "text:style-name", "MP1")...

Full Screen

Full Screen

Settings.py

Source:Settings.py Github

copy

Full Screen

2from Code.Odt import XML3class Settings(XML.XML):4 def __init__(self):5 XML.XML.__init__(self, "office:document-settings")6 self.add_param("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0")7 self.add_param("xmlns:ooo", "http://openoffice.org/2004/office")8 self.add_param("xmlns:xlink", "http://www.w3.org/1999/xlink")9 self.add_param("xmlns:config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0")10 self.add_param("office:version", "1.3")11 element1 = XML.Element("office:settings")12 self.add_content(element1)13 element2 = XML.Element("config:config-item-set")14 element2.add_param("config:name", "ooo:view-settings")15 element1.add_content(element2)16 element3 = XML.Element("config:config-item")17 element3.add_param("config:name", "ViewAreaTop")18 element3.add_param("config:type", "long")19 element2.add_content(element3)20 element3.set_value("0")21 element4 = XML.Element("config:config-item")22 element4.add_param("config:name", "ViewAreaLeft")23 element4.add_param("config:type", "long")24 element2.add_content(element4)25 element4.set_value("0")26 element5 = XML.Element("config:config-item")27 element5.add_param("config:name", "ViewAreaWidth")28 element5.add_param("config:type", "long")29 element2.add_content(element5)30 element5.set_value("43155")31 element6 = XML.Element("config:config-item")32 element6.add_param("config:name", "ViewAreaHeight")33 element6.add_param("config:type", "long")34 element2.add_content(element6)35 element6.set_value("26143")36 element7 = XML.Element("config:config-item")37 element7.add_param("config:name", "ShowRedlineChanges")38 element7.add_param("config:type", "boolean")39 element2.add_content(element7)40 element7.set_value("false")41 element8 = XML.Element("config:config-item")42 element8.add_param("config:name", "InBrowseMode")43 element8.add_param("config:type", "boolean")44 element2.add_content(element8)45 element8.set_value("false")46 element9 = XML.Element("config:config-item-map-indexed")47 element9.add_param("config:name", "Views")48 element2.add_content(element9)49 element10 = XML.Element("config:config-item-map-entry")50 element9.add_content(element10)51 element11 = XML.Element("config:config-item")52 element11.add_param("config:name", "ViewId")53 element11.add_param("config:type", "string")54 element10.add_content(element11)55 element11.set_value("view2")56 element12 = XML.Element("config:config-item")57 element12.add_param("config:name", "ViewLeft")58 element12.add_param("config:type", "long")59 element10.add_content(element12)60 element12.set_value("13077")61 element13 = XML.Element("config:config-item")62 element13.add_param("config:name", "ViewTop")63 element13.add_param("config:type", "long")64 element10.add_content(element13)65 element13.set_value("2501")66 element14 = XML.Element("config:config-item")67 element14.add_param("config:name", "VisibleLeft")68 element14.add_param("config:type", "long")69 element10.add_content(element14)70 element14.set_value("0")71 element15 = XML.Element("config:config-item")72 element15.add_param("config:name", "VisibleTop")73 element15.add_param("config:type", "long")74 element10.add_content(element15)75 element15.set_value("0")76 element16 = XML.Element("config:config-item")77 element16.add_param("config:name", "VisibleRight")78 element16.add_param("config:type", "long")79 element10.add_content(element16)80 element16.set_value("43154")81 element17 = XML.Element("config:config-item")82 element17.add_param("config:name", "VisibleBottom")83 element17.add_param("config:type", "long")84 element10.add_content(element17)85 element17.set_value("26141")86 element18 = XML.Element("config:config-item")87 element18.add_param("config:name", "ZoomType")88 element18.add_param("config:type", "short")89 element10.add_content(element18)90 element18.set_value("0")91 element19 = XML.Element("config:config-item")92 element19.add_param("config:name", "ViewLayoutColumns")93 element19.add_param("config:type", "short")94 element10.add_content(element19)95 element19.set_value("0")96 element20 = XML.Element("config:config-item")97 element20.add_param("config:name", "ViewLayoutBookMode")98 element20.add_param("config:type", "boolean")99 element10.add_content(element20)100 element20.set_value("false")101 element21 = XML.Element("config:config-item")102 element21.add_param("config:name", "ZoomFactor")103 element21.add_param("config:type", "short")104 element10.add_content(element21)105 element21.set_value("100")106 element22 = XML.Element("config:config-item")107 element22.add_param("config:name", "IsSelectedFrame")108 element22.add_param("config:type", "boolean")109 element10.add_content(element22)110 element22.set_value("false")111 element23 = XML.Element("config:config-item")112 element23.add_param("config:name", "KeepRatio")113 element23.add_param("config:type", "boolean")114 element10.add_content(element23)115 element23.set_value("false")116 element24 = XML.Element("config:config-item")117 element24.add_param("config:name", "AnchoredTextOverflowLegacy")118 element24.add_param("config:type", "boolean")119 element10.add_content(element24)120 element24.set_value("false")121 element25 = XML.Element("config:config-item-set")122 element25.add_param("config:name", "ooo:configuration-settings")123 element1.add_content(element25)124 element26 = XML.Element("config:config-item")125 element26.add_param("config:name", "ProtectForm")126 element26.add_param("config:type", "boolean")127 element25.add_content(element26)128 element26.set_value("false")129 element27 = XML.Element("config:config-item")130 element27.add_param("config:name", "PrinterName")131 element27.add_param("config:type", "string")132 element25.add_content(element27)133 element28 = XML.Element("config:config-item")134 element28.add_param("config:name", "EmbeddedDatabaseName")135 element28.add_param("config:type", "string")136 element25.add_content(element28)137 element29 = XML.Element("config:config-item")138 element29.add_param("config:name", "CurrentDatabaseDataSource")139 element29.add_param("config:type", "string")140 element25.add_content(element29)141 element30 = XML.Element("config:config-item")142 element30.add_param("config:name", "LinkUpdateMode")143 element30.add_param("config:type", "short")144 element25.add_content(element30)145 element30.set_value("1")146 element31 = XML.Element("config:config-item")147 element31.add_param("config:name", "AddParaTableSpacingAtStart")148 element31.add_param("config:type", "boolean")149 element25.add_content(element31)150 element31.set_value("false")151 element32 = XML.Element("config:config-item")152 element32.add_param("config:name", "FloattableNomargins")153 element32.add_param("config:type", "boolean")154 element25.add_content(element32)155 element32.set_value("false")156 element33 = XML.Element("config:config-item")157 element33.add_param("config:name", "UnbreakableNumberings")158 element33.add_param("config:type", "boolean")159 element25.add_content(element33)160 element33.set_value("false")161 element34 = XML.Element("config:config-item")162 element34.add_param("config:name", "FieldAutoUpdate")163 element34.add_param("config:type", "boolean")164 element25.add_content(element34)165 element34.set_value("false")166 element35 = XML.Element("config:config-item")167 element35.add_param("config:name", "AddVerticalFrameOffsets")168 element35.add_param("config:type", "boolean")169 element25.add_content(element35)170 element35.set_value("false")171 element36 = XML.Element("config:config-item")172 element36.add_param("config:name", "BackgroundParaOverDrawings")173 element36.add_param("config:type", "boolean")174 element25.add_content(element36)175 element36.set_value("false")176 element37 = XML.Element("config:config-item")177 element37.add_param("config:name", "AddParaTableSpacing")178 element37.add_param("config:type", "boolean")179 element25.add_content(element37)180 element37.set_value("false")181 element38 = XML.Element("config:config-item")182 element38.add_param("config:name", "ChartAutoUpdate")183 element38.add_param("config:type", "boolean")184 element25.add_content(element38)185 element38.set_value("false")186 element39 = XML.Element("config:config-item")187 element39.add_param("config:name", "CurrentDatabaseCommand")188 element39.add_param("config:type", "string")189 element25.add_content(element39)190 element40 = XML.Element("config:config-item")191 element40.add_param("config:name", "PrinterSetup")192 element40.add_param("config:type", "base64Binary")193 element25.add_content(element40)194 element41 = XML.Element("config:config-item")195 element41.add_param("config:name", "AlignTabStopPosition")196 element41.add_param("config:type", "boolean")197 element25.add_content(element41)198 element41.set_value("false")199 element42 = XML.Element("config:config-item")200 element42.add_param("config:name", "PrinterPaperFromSetup")201 element42.add_param("config:type", "boolean")202 element25.add_content(element42)203 element42.set_value("false")204 element43 = XML.Element("config:config-item")205 element43.add_param("config:name", "IsKernAsianPunctuation")206 element43.add_param("config:type", "boolean")207 element25.add_content(element43)208 element43.set_value("false")209 element44 = XML.Element("config:config-item")210 element44.add_param("config:name", "CharacterCompressionType")211 element44.add_param("config:type", "short")212 element25.add_content(element44)213 element44.set_value("0")214 element45 = XML.Element("config:config-item")215 element45.add_param("config:name", "ApplyUserData")216 element45.add_param("config:type", "boolean")217 element25.add_content(element45)218 element45.set_value("false")219 element46 = XML.Element("config:config-item")220 element46.add_param("config:name", "DoNotJustifyLinesWithManualBreak")221 element46.add_param("config:type", "boolean")222 element25.add_content(element46)223 element46.set_value("false")224 element47 = XML.Element("config:config-item")225 element47.add_param("config:name", "SaveThumbnail")226 element47.add_param("config:type", "boolean")227 element25.add_content(element47)228 element47.set_value("false")229 element48 = XML.Element("config:config-item")230 element48.add_param("config:name", "SaveGlobalDocumentLinks")231 element48.add_param("config:type", "boolean")232 element25.add_content(element48)233 element48.set_value("false")234 element49 = XML.Element("config:config-item")235 element49.add_param("config:name", "SmallCapsPercentage66")236 element49.add_param("config:type", "boolean")237 element25.add_content(element49)238 element49.set_value("false")239 element50 = XML.Element("config:config-item")240 element50.add_param("config:name", "CurrentDatabaseCommandType")241 element50.add_param("config:type", "int")242 element25.add_content(element50)243 element50.set_value("0")244 element51 = XML.Element("config:config-item")245 element51.add_param("config:name", "SaveVersionOnClose")246 element51.add_param("config:type", "boolean")247 element25.add_content(element51)248 element51.set_value("false")249 element52 = XML.Element("config:config-item")250 element52.add_param("config:name", "UpdateFromTemplate")251 element52.add_param("config:type", "boolean")252 element25.add_content(element52)253 element52.set_value("false")254 element53 = XML.Element("config:config-item")255 element53.add_param("config:name", "DoNotCaptureDrawObjsOnPage")256 element53.add_param("config:type", "boolean")257 element25.add_content(element53)258 element53.set_value("false")259 element54 = XML.Element("config:config-item")260 element54.add_param("config:name", "UseFormerObjectPositioning")261 element54.add_param("config:type", "boolean")262 element25.add_content(element54)263 element54.set_value("false")264 element55 = XML.Element("config:config-item")265 element55.add_param("config:name", "PrintSingleJobs")266 element55.add_param("config:type", "boolean")267 element25.add_content(element55)268 element55.set_value("false")269 element56 = XML.Element("config:config-item")270 element56.add_param("config:name", "EmbedSystemFonts")271 element56.add_param("config:type", "boolean")272 element25.add_content(element56)273 element56.set_value("false")274 element57 = XML.Element("config:config-item")275 element57.add_param("config:name", "PrinterIndependentLayout")276 element57.add_param("config:type", "string")277 element25.add_content(element57)278 element57.set_value("high-resolution")279 element58 = XML.Element("config:config-item")280 element58.add_param("config:name", "IsLabelDocument")281 element58.add_param("config:type", "boolean")282 element25.add_content(element58)283 element58.set_value("false")284 element59 = XML.Element("config:config-item")285 element59.add_param("config:name", "AddFrameOffsets")286 element59.add_param("config:type", "boolean")287 element25.add_content(element59)288 element59.set_value("false")289 element60 = XML.Element("config:config-item")290 element60.add_param("config:name", "AddExternalLeading")291 element60.add_param("config:type", "boolean")292 element25.add_content(element60)293 element60.set_value("false")294 element61 = XML.Element("config:config-item")295 element61.add_param("config:name", "MsWordCompMinLineHeightByFly")296 element61.add_param("config:type", "boolean")297 element25.add_content(element61)298 element61.set_value("false")299 element62 = XML.Element("config:config-item")300 element62.add_param("config:name", "UseOldNumbering")301 element62.add_param("config:type", "boolean")302 element25.add_content(element62)303 element62.set_value("false")304 element63 = XML.Element("config:config-item")305 element63.add_param("config:name", "OutlineLevelYieldsNumbering")306 element63.add_param("config:type", "boolean")307 element25.add_content(element63)308 element63.set_value("false")309 element64 = XML.Element("config:config-item")310 element64.add_param("config:name", "DoNotResetParaAttrsForNumFont")311 element64.add_param("config:type", "boolean")312 element25.add_content(element64)313 element64.set_value("false")314 element65 = XML.Element("config:config-item")315 element65.add_param("config:name", "IgnoreFirstLineIndentInNumbering")316 element65.add_param("config:type", "boolean")317 element25.add_content(element65)318 element65.set_value("false")319 element66 = XML.Element("config:config-item")320 element66.add_param("config:name", "AllowPrintJobCancel")321 element66.add_param("config:type", "boolean")322 element25.add_content(element66)323 element66.set_value("false")324 element67 = XML.Element("config:config-item")325 element67.add_param("config:name", "UseFormerLineSpacing")326 element67.add_param("config:type", "boolean")327 element25.add_content(element67)328 element67.set_value("false")329 element68 = XML.Element("config:config-item")330 element68.add_param("config:name", "AddParaSpacingToTableCells")331 element68.add_param("config:type", "boolean")332 element25.add_content(element68)333 element68.set_value("false")334 element69 = XML.Element("config:config-item")335 element69.add_param("config:name", "AddParaLineSpacingToTableCells")336 element69.add_param("config:type", "boolean")337 element25.add_content(element69)338 element69.set_value("false")339 element70 = XML.Element("config:config-item")340 element70.add_param("config:name", "UseFormerTextWrapping")341 element70.add_param("config:type", "boolean")342 element25.add_content(element70)343 element70.set_value("false")344 element71 = XML.Element("config:config-item")345 element71.add_param("config:name", "RedlineProtectionKey")346 element71.add_param("config:type", "base64Binary")347 element25.add_content(element71)348 element72 = XML.Element("config:config-item")349 element72.add_param("config:name", "ConsiderTextWrapOnObjPos")350 element72.add_param("config:type", "boolean")351 element25.add_content(element72)352 element72.set_value("false")353 element73 = XML.Element("config:config-item")354 element73.add_param("config:name", "TableRowKeep")355 element73.add_param("config:type", "boolean")356 element25.add_content(element73)357 element73.set_value("false")358 element74 = XML.Element("config:config-item")359 element74.add_param("config:name", "TabsRelativeToIndent")360 element74.add_param("config:type", "boolean")361 element25.add_content(element74)362 element74.set_value("false")363 element75 = XML.Element("config:config-item")364 element75.add_param("config:name", "IgnoreTabsAndBlanksForLineCalculation")365 element75.add_param("config:type", "boolean")366 element25.add_content(element75)367 element75.set_value("false")368 element76 = XML.Element("config:config-item")369 element76.add_param("config:name", "RsidRoot")370 element76.add_param("config:type", "int")371 element25.add_content(element76)372 element76.set_value("0")373 element77 = XML.Element("config:config-item")374 element77.add_param("config:name", "LoadReadonly")375 element77.add_param("config:type", "boolean")376 element25.add_content(element77)377 element77.set_value("false")378 element78 = XML.Element("config:config-item")379 element78.add_param("config:name", "ClipAsCharacterAnchoredWriterFlyFrames")380 element78.add_param("config:type", "boolean")381 element25.add_content(element78)382 element78.set_value("false")383 element79 = XML.Element("config:config-item")384 element79.add_param("config:name", "UnxForceZeroExtLeading")385 element79.add_param("config:type", "boolean")386 element25.add_content(element79)387 element79.set_value("false")388 element80 = XML.Element("config:config-item")389 element80.add_param("config:name", "UseOldPrinterMetrics")390 element80.add_param("config:type", "boolean")391 element25.add_content(element80)392 element80.set_value("false")393 element81 = XML.Element("config:config-item")394 element81.add_param("config:name", "TabAtLeftIndentForParagraphsInList")395 element81.add_param("config:type", "boolean")396 element25.add_content(element81)397 element81.set_value("false")398 element82 = XML.Element("config:config-item")399 element82.add_param("config:name", "Rsid")400 element82.add_param("config:type", "int")401 element25.add_content(element82)402 element82.set_value("126673")403 element83 = XML.Element("config:config-item")404 element83.add_param("config:name", "MsWordCompTrailingBlanks")405 element83.add_param("config:type", "boolean")406 element25.add_content(element83)407 element83.set_value("false")408 element84 = XML.Element("config:config-item")409 element84.add_param("config:name", "MathBaselineAlignment")410 element84.add_param("config:type", "boolean")411 element25.add_content(element84)412 element84.set_value("false")413 element85 = XML.Element("config:config-item")414 element85.add_param("config:name", "InvertBorderSpacing")415 element85.add_param("config:type", "boolean")416 element25.add_content(element85)417 element85.set_value("false")418 element86 = XML.Element("config:config-item")419 element86.add_param("config:name", "CollapseEmptyCellPara")420 element86.add_param("config:type", "boolean")421 element25.add_content(element86)422 element86.set_value("false")423 element87 = XML.Element("config:config-item")424 element87.add_param("config:name", "TabOverflow")425 element87.add_param("config:type", "boolean")426 element25.add_content(element87)427 element87.set_value("false")428 element88 = XML.Element("config:config-item")429 element88.add_param("config:name", "StylesNoDefault")430 element88.add_param("config:type", "boolean")431 element25.add_content(element88)432 element88.set_value("false")433 element89 = XML.Element("config:config-item")434 element89.add_param("config:name", "ClippedPictures")435 element89.add_param("config:type", "boolean")436 element25.add_content(element89)437 element89.set_value("false")438 element90 = XML.Element("config:config-item")439 element90.add_param("config:name", "EmbedFonts")440 element90.add_param("config:type", "boolean")441 element25.add_content(element90)442 element90.set_value("false")443 element91 = XML.Element("config:config-item")444 element91.add_param("config:name", "EmbedOnlyUsedFonts")445 element91.add_param("config:type", "boolean")446 element25.add_content(element91)447 element91.set_value("false")448 element92 = XML.Element("config:config-item")449 element92.add_param("config:name", "EmbedLatinScriptFonts")450 element92.add_param("config:type", "boolean")451 element25.add_content(element92)452 element92.set_value("false")453 element93 = XML.Element("config:config-item")454 element93.add_param("config:name", "EmbedAsianScriptFonts")455 element93.add_param("config:type", "boolean")456 element25.add_content(element93)457 element93.set_value("false")458 element94 = XML.Element("config:config-item")459 element94.add_param("config:name", "EmptyDbFieldHidesPara")460 element94.add_param("config:type", "boolean")461 element25.add_content(element94)462 element94.set_value("false")463 element95 = XML.Element("config:config-item")464 element95.add_param("config:name", "EmbedComplexScriptFonts")465 element95.add_param("config:type", "boolean")466 element25.add_content(element95)467 element95.set_value("false")468 element96 = XML.Element("config:config-item")469 element96.add_param("config:name", "TabOverMargin")470 element96.add_param("config:type", "boolean")471 element25.add_content(element96)472 element96.set_value("false")473 element97 = XML.Element("config:config-item")474 element97.add_param("config:name", "TabOverSpacing")475 element97.add_param("config:type", "boolean")476 element25.add_content(element97)477 element97.set_value("false")478 element98 = XML.Element("config:config-item")479 element98.add_param("config:name", "TreatSingleColumnBreakAsPageBreak")480 element98.add_param("config:type", "boolean")481 element25.add_content(element98)482 element98.set_value("false")483 element99 = XML.Element("config:config-item")484 element99.add_param("config:name", "SurroundTextWrapSmall")485 element99.add_param("config:type", "boolean")486 element25.add_content(element99)487 element99.set_value("false")488 element100 = XML.Element("config:config-item")489 element100.add_param("config:name", "ApplyParagraphMarkFormatToNumbering")490 element100.add_param("config:type", "boolean")491 element25.add_content(element100)492 element100.set_value("false")493 element101 = XML.Element("config:config-item")494 element101.add_param("config:name", "PropLineSpacingShrinksFirstLine")495 element101.add_param("config:type", "boolean")496 element25.add_content(element101)497 element101.set_value("false")498 element102 = XML.Element("config:config-item")499 element102.add_param("config:name", "SubtractFlysAnchoredAtFlys")500 element102.add_param("config:type", "boolean")501 element25.add_content(element102)502 element102.set_value("false")503 element103 = XML.Element("config:config-item")504 element103.add_param("config:name", "DisableOffPagePositioning")505 element103.add_param("config:type", "boolean")506 element25.add_content(element103)507 element103.set_value("false")508 element104 = XML.Element("config:config-item")509 element104.add_param("config:name", "ContinuousEndnotes")510 element104.add_param("config:type", "boolean")511 element25.add_content(element104)512 element104.set_value("false")513 element105 = XML.Element("config:config-item")514 element105.add_param("config:name", "ProtectBookmarks")515 element105.add_param("config:type", "boolean")516 element25.add_content(element105)517 element105.set_value("false")518 element106 = XML.Element("config:config-item")519 element106.add_param("config:name", "ProtectFields")520 element106.add_param("config:type", "boolean")521 element25.add_content(element106)522 element106.set_value("false")523 element107 = XML.Element("config:config-item")524 element107.add_param("config:name", "HeaderSpacingBelowLastPara")525 element107.add_param("config:type", "boolean")526 element25.add_content(element107)527 element107.set_value("false")528 element108 = XML.Element("config:config-item")529 element108.add_param("config:name", "FrameAutowidthWithMorePara")530 element108.add_param("config:type", "boolean")531 element25.add_content(element108)532 element108.set_value("false")533 element109 = XML.Element("config:config-item")534 element109.add_param("config:name", "GutterAtTop")535 element109.add_param("config:type", "boolean")536 element25.add_content(element109)537 element109.set_value("false")538 element110 = XML.Element("config:config-item")539 element110.add_param("config:name", "PrintAnnotationMode")540 element110.add_param("config:type", "short")541 element25.add_content(element110)542 element110.set_value("0")543 element111 = XML.Element("config:config-item")544 element111.add_param("config:name", "PrintGraphics")545 element111.add_param("config:type", "boolean")546 element25.add_content(element111)547 element111.set_value("false")548 element112 = XML.Element("config:config-item")549 element112.add_param("config:name", "PrintBlackFonts")550 element112.add_param("config:type", "boolean")551 element25.add_content(element112)552 element112.set_value("false")553 element113 = XML.Element("config:config-item")554 element113.add_param("config:name", "PrintLeftPages")555 element113.add_param("config:type", "boolean")556 element25.add_content(element113)557 element113.set_value("false")558 element114 = XML.Element("config:config-item")559 element114.add_param("config:name", "PrintControls")560 element114.add_param("config:type", "boolean")561 element25.add_content(element114)562 element114.set_value("false")563 element115 = XML.Element("config:config-item")564 element115.add_param("config:name", "PrintPageBackground")565 element115.add_param("config:type", "boolean")566 element25.add_content(element115)567 element115.set_value("false")568 element116 = XML.Element("config:config-item")569 element116.add_param("config:name", "PrintTextPlaceholder")570 element116.add_param("config:type", "boolean")571 element25.add_content(element116)572 element116.set_value("false")573 element117 = XML.Element("config:config-item")574 element117.add_param("config:name", "PrintDrawings")575 element117.add_param("config:type", "boolean")576 element25.add_content(element117)577 element117.set_value("false")578 element118 = XML.Element("config:config-item")579 element118.add_param("config:name", "PrintHiddenText")580 element118.add_param("config:type", "boolean")581 element25.add_content(element118)582 element118.set_value("false")583 element119 = XML.Element("config:config-item")584 element119.add_param("config:name", "PrintProspect")585 element119.add_param("config:type", "boolean")586 element25.add_content(element119)587 element119.set_value("false")588 element120 = XML.Element("config:config-item")589 element120.add_param("config:name", "PrintTables")590 element120.add_param("config:type", "boolean")591 element25.add_content(element120)592 element120.set_value("false")593 element121 = XML.Element("config:config-item")594 element121.add_param("config:name", "PrintProspectRTL")595 element121.add_param("config:type", "boolean")596 element25.add_content(element121)597 element121.set_value("false")598 element122 = XML.Element("config:config-item")599 element122.add_param("config:name", "PrintReversed")600 element122.add_param("config:type", "boolean")601 element25.add_content(element122)602 element122.set_value("false")603 element123 = XML.Element("config:config-item")604 element123.add_param("config:name", "PrintRightPages")605 element123.add_param("config:type", "boolean")606 element25.add_content(element123)607 element123.set_value("false")608 element124 = XML.Element("config:config-item")609 element124.add_param("config:name", "PrintFaxName")610 element124.add_param("config:type", "string")611 element25.add_content(element124)612 element125 = XML.Element("config:config-item")613 element125.add_param("config:name", "PrintPaperFromSetup")614 element125.add_param("config:type", "boolean")615 element25.add_content(element125)616 element125.set_value("false")617 element126 = XML.Element("config:config-item")618 element126.add_param("config:name", "PrintEmptyPages")619 element126.add_param("config:type", "boolean")620 element25.add_content(element126)621 element126.set_value("false")622 def run(self, folder):623 path = os.path.join(folder, "settings.xml")...

Full Screen

Full Screen

params_groups.py

Source:params_groups.py Github

copy

Full Screen

1# from ulfs.utils import expand2from ulfs import utils, runner_base_v13from ref_task.datasets import all_datasets4def add_hypothesis_sampler_args(runner: runner_base_v1.RunnerBase):5 runner.add_param('--hypothesis-noise', type=float, default=0.0)6 runner.add_param('--hypothesis-tau', type=float, default=1.2)7 runner.add_param('--hypothesis-ent-reg', type=float, default=0.01)8 runner.add_param('--hypothesis-gumbel-soft', action='store_true')9 # runner.add_param('--hypothesis-sampler', type=str, default='HypothesisSamplerGumbel')10 # TODO, not duplicate the hypothesis sampler type and gumbel, reinforce11 runner.add_param('--hypothesis-exp-probs', action='store_true')12def add_receiver_args(runner: runner_base_v1.RunnerBase):13 runner.add_param('--multimodal-classifier', type=str, default='Cosine')14 runner.add_param(15 '--num-output-fcs', type=int, default=1,16 help='how many fully connected layers at the end of the multi modal classifier model')17 runner.add_param('--linguistic-encoder', type=str, default='RNN')18 runner.add_param('--linguistic-encoder-num-layers', type=int, default=1)19 runner.add_param('--linguistic-encoder-rnn-type', type=str, default='GRU')20 runner.add_param('--num-receiver-its', type=int, default=1)21def add_e2e_args(runner: runner_base_v1.RunnerBase):22 runner.add_param('--utt-len', type=int, default=10)23 runner.add_param('--vocab-size', type=int, default=21)24 # runner.add_param('--share-conv', action='store_true')25 runner.add_param('--max-steps', type=int, default=0)26def add_tre_args(runner: runner_base_v1.RunnerBase):27 runner.add_param('--tre-lr', type=float, default=0.01)28 runner.add_param('--tre-quiet', action='store_true')29 runner.add_param('--tre-steps', type=int, default=400)30 runner.add_param('--tre-max-samples', type=int, default=80)31 runner.add_param('--no-tre-zero-init', action='store_true')32 runner.add_param('--no-tre-bias', action='store_true')33def add_hypprop_args(runner):34 runner.add_param('--model-seed', type=int, default=123)35 runner.add_param('--train-receiver-by-row', action='store_true')36 runner.add_param('--obverter-trainer', type=str, default='BackpropM')37 runner.add_param('--sub-batch-size', type=int, default=16, help='for Backprop trainer')38 runner.add_param('--phase0-its', type=int, default=50)39 runner.add_param('--phase1-its', type=int, default=5)40 runner.add_param('--hyp-opt', type=str, default='Adam')41 runner.add_param('--hyp-checker-opt', type=str, default='Adam')42 runner.add_param('--meta-inner-opt', type=str, default='Adam', help='for reptile (maml always uses SGD')43 runner.add_param('--meta-outer-opt', type=str, default='Adam', help='for maml')44 runner.add_param('--meta-lr', type=float, default=0.001)45 runner.add_param('--meta-inner-steps', type=int, default=50)46 runner.add_param('--meta-accumulate-over', type=int, default=1)47 runner.add_param('--backpropm-accumulate-cols', type=int, default=1)48 runner.add_param('--no-backpropm-randomize-cols', action='store_true')49 runner.add_param('--hyp-l1-reg', type=float, default=0)50 runner.add_param('--hyp-hinge-reg', type=float, default=1)51 runner.add_param('--hyp-hinge-range', type=str, default='0,1')52 runner.add_param('--hyp-self-norm-l1-reg', type=float, default=0)53 runner.add_param('--hyp-self-norm-l2-reg', type=float, default=0)54 runner.add_param('--enable-predictor', action='store_true')55 # TODO add pred-activation back in56 runner.add_param('--pred-activation', type=str, help='[tanh|sigmoid]')57 runner.add_param('--hyp-first-symbol-margin', type=float)58 runner.add_param('--hyp-first-symbol-margin-reg', type=float, default=0)59 runner.add_param('--max-mfb-equiv', type=float, default=80)60 runner.add_param('--full-validation-every-mfb', type=float, default=0)61 runner.add_param('--swap-sender-receiver', action='store_true', help='for 2 agent')62def add_sender_args(runner: runner_base_v1.RunnerBase):63 runner.add_param('--image-seq-embedder', type=str, default='PrototypicalSender')64 runner.add_param('--no-sender-negex', action='store_true', help='disable negative examples')65 runner.add_param('--sender-decoder', type=str, default='RNNDecoder')66 runner.add_param('--sender-num-heads', type=int, default=1)67 runner.add_param('--sender-num-timesteps', type=int, default=5)68 runner.add_param('--sender-num-rnn-layers', type=int, default=1)69def add_conv_args(runner: runner_base_v1.RunnerBase):70 runner.add_param('--conv-preset', type=str, default='conv4', choices=['conv4', 'none'], help='optional')71 runner.add_param('--cnn-sizes', type=str, default='16,16')72 runner.add_param('--cnn-batch-norm', action='store_true')73 runner.add_param('--cnn-max-pooling-size', type=int, help='if None then no pooling, otherwise kernel size')74 runner.add_param('--preconv-model', type=str, default='StridedConv')75 runner.add_param('--preconv-stride', type=int, default=4)76 runner.add_param('--preconv-relu', action='store_true')77 runner.add_param('--preconv-dropout', type=float, default=0.2)78 runner.add_param('--preconv-embedding-size', type=int, default=16)79def add_common_args(runner: runner_base_v1.RunnerBase):80 runner.add_param('--embedding-size', type=int, default=128)81 runner.add_param('--dropout', type=float, default=0)82 runner.add_param('--lr', type=float, default=0.001)83 runner.add_param('--batch-size', type=int, default=128)84 runner.add_param('--repr', type=str, default='gumb', choices=['soft', 'gumb', 'discr'])85def add_ds_args(runner: runner_base_v1.RunnerBase):86 runner.add_param('--ds-family', type=str, choices=['texrel', 'shapeworld'], default='texrel')87 runner.add_param('--ds-shapeworld-folder', type=str, default='~/data/shapeworld')88 runner.add_param('--ds-filepath-templ', type=str, default='~/data/reftask/{ds_ref}.dat')89 runner.add_param('--ds-seed', type=int, default=123)90 runner.add_param('--ds-texture-size', type=int, default=4)91 runner.add_param('--ds-background-noise', type=float, default=0, help='std of noise (with mean 0.5)')92 runner.add_param('--ds-mean', type=float, default=0)93 runner.add_param('--ds-mean-std', type=float, default=0)94 runner.add_param('--ds-collection', type=str, default='128valsame')95 runner.add_param('--ds-tasks', type=str, default='Relations', help='tasks for training')96 runner.add_param('--ds-val-tasks', type=str,97 help='tasks for validation and test (defaults to same as training)')98 runner.add_param('--ds-distractors', type=str, default='2')99 runner.add_param('--ds-val-distractors', type=str,100 help='distractors for validation and test (defaults to same as training)')101 runner.add_param('--ds-refs', type=str)102 runner.add_param('--ds-val-refs', type=str)103def process_args(args):104 if 'ds_refs' in args.__dict__ and args.ds_refs is not None:105 args.ds_refs = args.ds_refs.split(',')106 if 'ds_val_refs' in args.__dict__ and args.ds_val_refs is not None:107 args.ds_val_refs = args.ds_val_refs.split(',')108 else:109 args.ds_val_refs = list(args.ds_refs)110 elif 'ds_collection' in args.__dict__:111 args.ds_tasks = args.ds_tasks.split(',')112 args.ds_distractors = [int(v) for v in args.ds_distractors.split(',')]113 if args.ds_val_tasks is not None:114 args.ds_val_tasks = args.ds_val_tasks.split(',')115 if args.ds_val_distractors is not None:116 args.ds_val_distractors = [int(v) for v in args.ds_val_distractors.split(',')]...

Full Screen

Full Screen

manage_monthly_check.js

Source:manage_monthly_check.js Github

copy

Full Screen

1$(function() {2 //全体一覧表示時アンカーへスクロール3 if ($("#anchor").length>0){4 var scroll = new SmoothScroll('a[href*="#"]');5 var headerH = 285; //ヘッダーの高さ6 var target = $("#anchor").eq(0);7 var position = target.offset().top;8 var sc_pos = position - headerH;9 scrollTo(0,sc_pos);10 //document.getElementById('anchor').scrollIntoView({behavior: "smooth"});11 }12 $('#search_form').submit(function() {13 var staff = $('#staff').val();14 var careuser = $('#careuser').val();15 if (staff === undefined || staff === "") {16 $('#staff').attr('name','empty_staff');17 } else {18 $('#staff').attr('name','staff');19 }20 if (careuser === undefined || careuser === "") {21 $('#careuser').attr('name','empty_careuser');22 } else {23 $('#careuser').attr('name','careuser');24 }25 });26 $("#staff").change(function(){27 $('#careuser').val(undefined);28 $("#search_form").submit();29 });30 $("#careuser").change(function(){31 $('#staff').val(undefined);32 $("#search_form").submit();33 });34 35 $(".print_btn,.month_btn").on('click',function(){36 var send_url = $(this).parents('a').attr('href');37 url_arr = send_url.split('?');38 send_url = url_arr[0];39 var add_param = "";40 var staff = $('#staff').val();41 var careuser = $('#careuser').val();42 if (staff !== undefined && staff !== ""){43 if(add_param ==""){44 add_param += "?";45 }46 add_param += "staff=" + staff;47 }else if (careuser !== undefined && careuser !== ""){48 if(add_param ==""){49 add_param += "?";50 }51 add_param += "careuser=" + careuser;52 }53 send_url = send_url + add_param;54 $(this).parents('a').attr('href',send_url);55 });56/*57 $(".td_day").on('click',function(){58 var send_url = $(this).attr('href');59 url_arr = send_url.split('?');60 send_url = url_arr[0];61 var add_param = "";62 var staff = $('#staff').val();63 var careuser = $('#careuser').val();64 if (staff !== undefined && staff !== ""){65 if(add_param ==""){66 add_param += "?";67 }68 add_param += "staff=" + staff;69 }else if (careuser !== undefined && careuser !== ""){70 if(add_param ==""){71 add_param += "?";72 }73 add_param += "careuser=" + careuser;74 }75 send_url = send_url + add_param;76 window.location.href = send_url;77 });78*/...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful