mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-01 19:17:02 -04:00 
			
		
		
		
	Run autopep8 on odf2xhtml
This commit is contained in:
		
							parent
							
								
									ed1571af6e
								
							
						
					
					
						commit
						609892eb81
					
				| @ -24,37 +24,48 @@ from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| def Animate(**args): | ||||
|     return Element(qname = (ANIMNS,'animate'), **args) | ||||
|     return Element(qname=(ANIMNS,'animate'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Animatecolor(**args): | ||||
|     return Element(qname = (ANIMNS,'animateColor'), **args) | ||||
|     return Element(qname=(ANIMNS,'animateColor'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Animatemotion(**args): | ||||
|     return Element(qname = (ANIMNS,'animateMotion'), **args) | ||||
|     return Element(qname=(ANIMNS,'animateMotion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Animatetransform(**args): | ||||
|     return Element(qname = (ANIMNS,'animateTransform'), **args) | ||||
|     return Element(qname=(ANIMNS,'animateTransform'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Audio(**args): | ||||
|     return Element(qname = (ANIMNS,'audio'), **args) | ||||
|     return Element(qname=(ANIMNS,'audio'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Command(**args): | ||||
|     return Element(qname = (ANIMNS,'command'), **args) | ||||
|     return Element(qname=(ANIMNS,'command'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Iterate(**args): | ||||
|     return Element(qname = (ANIMNS,'iterate'), **args) | ||||
|     return Element(qname=(ANIMNS,'iterate'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Par(**args): | ||||
|     return Element(qname = (ANIMNS,'par'), **args) | ||||
|     return Element(qname=(ANIMNS,'par'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Param(**args): | ||||
|     return Element(qname = (ANIMNS,'param'), **args) | ||||
|     return Element(qname=(ANIMNS,'param'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Seq(**args): | ||||
|     return Element(qname = (ANIMNS,'seq'), **args) | ||||
|     return Element(qname=(ANIMNS,'seq'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Set(**args): | ||||
|     return Element(qname = (ANIMNS,'set'), **args) | ||||
|     return Element(qname=(ANIMNS,'set'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Transitionfilter(**args): | ||||
|     return Element(qname = (ANIMNS,'transitionFilter'), **args) | ||||
|     return Element(qname=(ANIMNS,'transitionFilter'), **args) | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -22,65 +22,87 @@ from .namespaces import CHARTNS | ||||
| from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Axis(**args): | ||||
|     return Element(qname = (CHARTNS,'axis'), **args) | ||||
|     return Element(qname=(CHARTNS,'axis'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Categories(**args): | ||||
|     return Element(qname = (CHARTNS,'categories'), **args) | ||||
|     return Element(qname=(CHARTNS,'categories'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Chart(**args): | ||||
|     return Element(qname = (CHARTNS,'chart'), **args) | ||||
|     return Element(qname=(CHARTNS,'chart'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPoint(**args): | ||||
|     return Element(qname = (CHARTNS,'data-point'), **args) | ||||
|     return Element(qname=(CHARTNS,'data-point'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Domain(**args): | ||||
|     return Element(qname = (CHARTNS,'domain'), **args) | ||||
|     return Element(qname=(CHARTNS,'domain'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ErrorIndicator(**args): | ||||
|     return Element(qname = (CHARTNS,'error-indicator'), **args) | ||||
|     return Element(qname=(CHARTNS,'error-indicator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Floor(**args): | ||||
|     return Element(qname = (CHARTNS,'floor'), **args) | ||||
|     return Element(qname=(CHARTNS,'floor'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Footer(**args): | ||||
|     return Element(qname = (CHARTNS,'footer'), **args) | ||||
|     return Element(qname=(CHARTNS,'footer'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Grid(**args): | ||||
|     return Element(qname = (CHARTNS,'grid'), **args) | ||||
|     return Element(qname=(CHARTNS,'grid'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Legend(**args): | ||||
|     return Element(qname = (CHARTNS,'legend'), **args) | ||||
|     return Element(qname=(CHARTNS,'legend'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def MeanValue(**args): | ||||
|     return Element(qname = (CHARTNS,'mean-value'), **args) | ||||
|     return Element(qname=(CHARTNS,'mean-value'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PlotArea(**args): | ||||
|     return Element(qname = (CHARTNS,'plot-area'), **args) | ||||
|     return Element(qname=(CHARTNS,'plot-area'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RegressionCurve(**args): | ||||
|     return Element(qname = (CHARTNS,'regression-curve'), **args) | ||||
|     return Element(qname=(CHARTNS,'regression-curve'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Series(**args): | ||||
|     return Element(qname = (CHARTNS,'series'), **args) | ||||
|     return Element(qname=(CHARTNS,'series'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def StockGainMarker(**args): | ||||
|     return Element(qname = (CHARTNS,'stock-gain-marker'), **args) | ||||
|     return Element(qname=(CHARTNS,'stock-gain-marker'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def StockLossMarker(**args): | ||||
|     return Element(qname = (CHARTNS,'stock-loss-marker'), **args) | ||||
|     return Element(qname=(CHARTNS,'stock-loss-marker'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def StockRangeLine(**args): | ||||
|     return Element(qname = (CHARTNS,'stock-range-line'), **args) | ||||
|     return Element(qname=(CHARTNS,'stock-range-line'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Subtitle(**args): | ||||
|     return Element(qname = (CHARTNS,'subtitle'), **args) | ||||
|     return Element(qname=(CHARTNS,'subtitle'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SymbolImage(**args): | ||||
|     return Element(qname = (CHARTNS,'symbol-image'), **args) | ||||
|     return Element(qname=(CHARTNS,'symbol-image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Title(**args): | ||||
|     return Element(qname = (CHARTNS,'title'), **args) | ||||
|     return Element(qname=(CHARTNS,'title'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Wall(**args): | ||||
|     return Element(qname = (CHARTNS,'wall'), **args) | ||||
|     return Element(qname=(CHARTNS,'wall'), **args) | ||||
|  | ||||
| @ -22,17 +22,23 @@ from .namespaces import CONFIGNS | ||||
| from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def ConfigItem(**args): | ||||
|     return Element(qname = (CONFIGNS, 'config-item'), **args) | ||||
|     return Element(qname=(CONFIGNS, 'config-item'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConfigItemMapEntry(**args): | ||||
|     return Element(qname = (CONFIGNS,'config-item-map-entry'), **args) | ||||
|     return Element(qname=(CONFIGNS,'config-item-map-entry'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConfigItemMapIndexed(**args): | ||||
|     return Element(qname = (CONFIGNS,'config-item-map-indexed'), **args) | ||||
|     return Element(qname=(CONFIGNS,'config-item-map-indexed'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConfigItemMapNamed(**args): | ||||
|     return Element(qname = (CONFIGNS,'config-item-map-named'), **args) | ||||
|     return Element(qname=(CONFIGNS,'config-item-map-named'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConfigItemSet(**args): | ||||
|     return Element(qname = (CONFIGNS, 'config-item-set'), **args) | ||||
|     return Element(qname=(CONFIGNS, 'config-item-set'), **args) | ||||
|  | ||||
| @ -22,51 +22,58 @@ from .namespaces import DCNS | ||||
| from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Creator(**args): | ||||
|     return Element(qname = (DCNS,'creator'), **args) | ||||
|     return Element(qname=(DCNS,'creator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Date(**args): | ||||
|     return Element(qname = (DCNS,'date'), **args) | ||||
|     return Element(qname=(DCNS,'date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Description(**args): | ||||
|     return Element(qname = (DCNS,'description'), **args) | ||||
|     return Element(qname=(DCNS,'description'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Language(**args): | ||||
|     return Element(qname = (DCNS,'language'), **args) | ||||
|     return Element(qname=(DCNS,'language'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Subject(**args): | ||||
|     return Element(qname = (DCNS,'subject'), **args) | ||||
|     return Element(qname=(DCNS,'subject'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Title(**args): | ||||
|     return Element(qname = (DCNS,'title'), **args) | ||||
|     return Element(qname=(DCNS,'title'), **args) | ||||
| 
 | ||||
| # The following complete the Dublin Core elements, but there is no | ||||
| # guarantee a compliant implementation of OpenDocument will preserve | ||||
| # these elements | ||||
| 
 | ||||
| #def Contributor(**args): | ||||
| # def Contributor(**args): | ||||
| #    return Element(qname = (DCNS,'contributor'), **args) | ||||
| 
 | ||||
| #def Coverage(**args): | ||||
| # def Coverage(**args): | ||||
| #    return Element(qname = (DCNS,'coverage'), **args) | ||||
| 
 | ||||
| #def Format(**args): | ||||
| # def Format(**args): | ||||
| #    return Element(qname = (DCNS,'format'), **args) | ||||
| 
 | ||||
| #def Identifier(**args): | ||||
| # def Identifier(**args): | ||||
| #    return Element(qname = (DCNS,'identifier'), **args) | ||||
| 
 | ||||
| #def Publisher(**args): | ||||
| # def Publisher(**args): | ||||
| #    return Element(qname = (DCNS,'publisher'), **args) | ||||
| 
 | ||||
| #def Relation(**args): | ||||
| # def Relation(**args): | ||||
| #    return Element(qname = (DCNS,'relation'), **args) | ||||
| 
 | ||||
| #def Rights(**args): | ||||
| # def Rights(**args): | ||||
| #    return Element(qname = (DCNS,'rights'), **args) | ||||
| 
 | ||||
| #def Source(**args): | ||||
| # def Source(**args): | ||||
| #    return Element(qname = (DCNS,'source'), **args) | ||||
| 
 | ||||
| #def Type(**args): | ||||
| # def Type(**args): | ||||
| #    return Element(qname = (DCNS,'type'), **args) | ||||
|  | ||||
| @ -23,20 +23,27 @@ from .element import Element | ||||
| from .draw import StyleRefElement | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Cube(**args): | ||||
|     return StyleRefElement(qname = (DR3DNS,'cube'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'cube'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Extrude(**args): | ||||
|     return StyleRefElement(qname = (DR3DNS,'extrude'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'extrude'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Light(Element): | ||||
|     return StyleRefElement(qname = (DR3DNS,'light'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'light'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Rotate(**args): | ||||
|     return StyleRefElement(qname = (DR3DNS,'rotate'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'rotate'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Scene(**args): | ||||
|     return StyleRefElement(qname = (DR3DNS,'scene'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'scene'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Sphere(**args): | ||||
|     return StyleRefElement(qname = (DR3DNS,'sphere'), **args) | ||||
|     return StyleRefElement(qname=(DR3DNS,'sphere'), **args) | ||||
|  | ||||
							
								
								
									
										135
									
								
								src/odf/draw.py
									
									
									
									
									
								
							
							
						
						
									
										135
									
								
								src/odf/draw.py
									
									
									
									
									
								
							| @ -21,6 +21,7 @@ | ||||
| from .namespaces import DRAWNS, STYLENS, PRESENTATIONNS | ||||
| from .element import Element | ||||
| 
 | ||||
| 
 | ||||
| def StyleRefElement(stylename=None, classnames=None, **args): | ||||
|     qattrs = {} | ||||
|     if stylename is not None: | ||||
| @ -41,6 +42,7 @@ def StyleRefElement(stylename=None, classnames=None, **args): | ||||
|             raise ValueError("Style's family must be either 'graphic' or 'presentation'") | ||||
|     return Element(qattributes=qattrs, **args) | ||||
| 
 | ||||
| 
 | ||||
| def DrawElement(name=None, **args): | ||||
|     e = Element(name=name, **args) | ||||
|     if 'displayname' not in args: | ||||
| @ -48,134 +50,179 @@ def DrawElement(name=None, **args): | ||||
|     return e | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def A(**args): | ||||
|     return Element(qname = (DRAWNS,'a'), **args) | ||||
|     return Element(qname=(DRAWNS,'a'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Applet(**args): | ||||
|     return Element(qname = (DRAWNS,'applet'), **args) | ||||
|     return Element(qname=(DRAWNS,'applet'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AreaCircle(**args): | ||||
|     return Element(qname = (DRAWNS,'area-circle'), **args) | ||||
|     return Element(qname=(DRAWNS,'area-circle'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AreaPolygon(**args): | ||||
|     return Element(qname = (DRAWNS,'area-polygon'), **args) | ||||
|     return Element(qname=(DRAWNS,'area-polygon'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AreaRectangle(**args): | ||||
|     return Element(qname = (DRAWNS,'area-rectangle'), **args) | ||||
|     return Element(qname=(DRAWNS,'area-rectangle'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Caption(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'caption'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'caption'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Circle(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'circle'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'circle'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Connector(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'connector'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'connector'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ContourPath(**args): | ||||
|     return Element(qname = (DRAWNS,'contour-path'), **args) | ||||
|     return Element(qname=(DRAWNS,'contour-path'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ContourPolygon(**args): | ||||
|     return Element(qname = (DRAWNS,'contour-polygon'), **args) | ||||
|     return Element(qname=(DRAWNS,'contour-polygon'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Control(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'control'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'control'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CustomShape(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'custom-shape'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'custom-shape'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Ellipse(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'ellipse'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'ellipse'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EnhancedGeometry(**args): | ||||
|     return Element(qname = (DRAWNS,'enhanced-geometry'), **args) | ||||
|     return Element(qname=(DRAWNS,'enhanced-geometry'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Equation(**args): | ||||
|     return Element(qname = (DRAWNS,'equation'), **args) | ||||
|     return Element(qname=(DRAWNS,'equation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FillImage(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'fill-image'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'fill-image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FloatingFrame(**args): | ||||
|     return Element(qname = (DRAWNS,'floating-frame'), **args) | ||||
|     return Element(qname=(DRAWNS,'floating-frame'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Frame(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'frame'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'frame'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def G(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'g'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'g'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def GluePoint(**args): | ||||
|     return Element(qname = (DRAWNS,'glue-point'), **args) | ||||
|     return Element(qname=(DRAWNS,'glue-point'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Gradient(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'gradient'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'gradient'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Handle(**args): | ||||
|     return Element(qname = (DRAWNS,'handle'), **args) | ||||
|     return Element(qname=(DRAWNS,'handle'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Hatch(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'hatch'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'hatch'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Image(**args): | ||||
|     return Element(qname = (DRAWNS,'image'), **args) | ||||
|     return Element(qname=(DRAWNS,'image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ImageMap(**args): | ||||
|     return Element(qname = (DRAWNS,'image-map'), **args) | ||||
|     return Element(qname=(DRAWNS,'image-map'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Layer(**args): | ||||
|     return Element(qname = (DRAWNS,'layer'), **args) | ||||
|     return Element(qname=(DRAWNS,'layer'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LayerSet(**args): | ||||
|     return Element(qname = (DRAWNS,'layer-set'), **args) | ||||
|     return Element(qname=(DRAWNS,'layer-set'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Line(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'line'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'line'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Marker(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'marker'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'marker'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Measure(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'measure'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'measure'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Object(**args): | ||||
|     return Element(qname = (DRAWNS,'object'), **args) | ||||
|     return Element(qname=(DRAWNS,'object'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ObjectOle(**args): | ||||
|     return Element(qname = (DRAWNS,'object-ole'), **args) | ||||
|     return Element(qname=(DRAWNS,'object-ole'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Opacity(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'opacity'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'opacity'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Page(**args): | ||||
|     return Element(qname = (DRAWNS,'page'), **args) | ||||
|     return Element(qname=(DRAWNS,'page'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageThumbnail(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'page-thumbnail'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'page-thumbnail'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Param(**args): | ||||
|     return Element(qname = (DRAWNS,'param'), **args) | ||||
|     return Element(qname=(DRAWNS,'param'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Path(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'path'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'path'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Plugin(**args): | ||||
|     return Element(qname = (DRAWNS,'plugin'), **args) | ||||
|     return Element(qname=(DRAWNS,'plugin'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Polygon(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'polygon'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'polygon'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Polyline(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'polyline'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'polyline'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Rect(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'rect'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'rect'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RegularPolygon(**args): | ||||
|     return StyleRefElement(qname = (DRAWNS,'regular-polygon'), **args) | ||||
|     return StyleRefElement(qname=(DRAWNS,'regular-polygon'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def StrokeDash(**args): | ||||
|     return DrawElement(qname = (DRAWNS,'stroke-dash'), **args) | ||||
|     return DrawElement(qname=(DRAWNS,'stroke-dash'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TextBox(**args): | ||||
|     return Element(qname = (DRAWNS,'text-box'), **args) | ||||
|     return Element(qname=(DRAWNS,'text-box'), **args) | ||||
|  | ||||
| @ -41,11 +41,13 @@ _MAX_LIST_LEVEL = 10 | ||||
| SHOW_ALL_LEVELS = True | ||||
| SHOW_ONE_LEVEL = False | ||||
| 
 | ||||
| 
 | ||||
| def styleFromString(name, specifiers, delim, spacing, showAllLevels): | ||||
|     specArray = specifiers.split(delim) | ||||
|     return styleFromList( name, specArray, spacing, showAllLevels ) | ||||
|     return styleFromList(name, specArray, spacing, showAllLevels) | ||||
| 
 | ||||
| def styleFromList( styleName, specArray, spacing, showAllLevels): | ||||
| 
 | ||||
| def styleFromList(styleName, specArray, spacing, showAllLevels): | ||||
|     bullet = "" | ||||
|     numPrefix = "" | ||||
|     numSuffix = "" | ||||
| @ -57,7 +59,7 @@ def styleFromList( styleName, specArray, spacing, showAllLevels): | ||||
|     listStyle = ListStyle(name=styleName) | ||||
|     numFormatPattern = re.compile("([1IiAa])") | ||||
|     cssLengthPattern = re.compile("([^a-z]+)\\s*([a-z]+)?") | ||||
|     m = cssLengthPattern.search( spacing ) | ||||
|     m = cssLengthPattern.search(spacing) | ||||
|     if (m != None): | ||||
|         cssLengthNum = float(m.group(1)) | ||||
|         if (m.lastindex == 2): | ||||
| @ -95,7 +97,7 @@ def styleFromList( styleName, specArray, spacing, showAllLevels): | ||||
|         llp = ListLevelProperties() | ||||
|         llp.setAttribute('spacebefore', str(cssLengthNum * (i+1)) + cssLengthUnits) | ||||
|         llp.setAttribute('minlabelwidth', str(cssLengthNum) + cssLengthUnits) | ||||
|         lls.addElement( llp ) | ||||
|         lls.addElement(llp) | ||||
|         listStyle.addElement(lls) | ||||
|         i += 1 | ||||
|     return listStyle | ||||
|  | ||||
| @ -31,6 +31,8 @@ from .attrconverters import AttrConverters | ||||
| # The following code is pasted form xml.sax.saxutils | ||||
| # Tt makes it possible to run the code without the xml sax package installed | ||||
| # To make it possible to have <rubbish> in your text elements, it is necessary to escape the texts | ||||
| 
 | ||||
| 
 | ||||
| def _escape(data, entities={}): | ||||
|     """ Escape &, <, and > in a string of data. | ||||
| 
 | ||||
| @ -45,6 +47,7 @@ def _escape(data, entities={}): | ||||
|         data = data.replace(chars, entity) | ||||
|     return data | ||||
| 
 | ||||
| 
 | ||||
| def _quoteattr(data, entities={}): | ||||
|     """ Escape and quote an attribute value. | ||||
| 
 | ||||
| @ -68,6 +71,7 @@ def _quoteattr(data, entities={}): | ||||
|         data = '"%s"' % data | ||||
|     return data | ||||
| 
 | ||||
| 
 | ||||
| def _nssplit(qualifiedName): | ||||
|     """ Split a qualified name into namespace part and local part.  """ | ||||
|     fields = qualifiedName.split(':', 1) | ||||
| @ -76,15 +80,21 @@ def _nssplit(qualifiedName): | ||||
|     else: | ||||
|         return (None, fields[0]) | ||||
| 
 | ||||
| 
 | ||||
| def _nsassign(namespace): | ||||
|     return nsdict.setdefault(namespace,"ns" + str(len(nsdict))) | ||||
| 
 | ||||
| # Exceptions | ||||
| 
 | ||||
| 
 | ||||
| class IllegalChild(Exception): | ||||
|     """ Complains if you add an element to a parent where it is not allowed """ | ||||
| 
 | ||||
| 
 | ||||
| class IllegalText(Exception): | ||||
|     """ Complains if you add text or cdata to an element where it is not allowed """ | ||||
| 
 | ||||
| 
 | ||||
| class Node(xml.dom.Node): | ||||
|     """ super class for more specific nodes """ | ||||
|     parentNode = None | ||||
| @ -145,10 +155,10 @@ class Node(xml.dom.Node): | ||||
|         if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE: | ||||
|             for c in tuple(newChild.childNodes): | ||||
|                 self.appendChild(c) | ||||
|             ### The DOM does not clearly specify what to return in this case | ||||
|             # The DOM does not clearly specify what to return in this case | ||||
|             return newChild | ||||
|         if newChild.nodeType not in self._child_node_types: | ||||
|             raise IllegalChild("<%s> is not allowed in %s" % ( newChild.tagName, self.tagName)) | ||||
|             raise IllegalChild("<%s> is not allowed in %s" % (newChild.tagName, self.tagName)) | ||||
|         if newChild.parentNode is not None: | ||||
|             newChild.parentNode.removeChild(newChild) | ||||
|         _append_child(self, newChild) | ||||
| @ -158,7 +168,7 @@ class Node(xml.dom.Node): | ||||
|     def removeChild(self, oldChild): | ||||
|         """ Removes the child node indicated by oldChild from the list of children, and returns it. | ||||
|         """ | ||||
|         #FIXME: update ownerDocument.element_dict or find other solution | ||||
|         # FIXME: update ownerDocument.element_dict or find other solution | ||||
|         try: | ||||
|             self.childNodes.remove(oldChild) | ||||
|         except ValueError: | ||||
| @ -185,9 +195,11 @@ class Node(xml.dom.Node): | ||||
|             val.append(type(u'')(c)) | ||||
|         return u''.join(val) | ||||
| 
 | ||||
| 
 | ||||
| defproperty(Node, "firstChild", doc="First child node, or None.") | ||||
| defproperty(Node, "lastChild",  doc="Last child node, or None.") | ||||
| 
 | ||||
| 
 | ||||
| def _append_child(self, node): | ||||
|     # fast path with less checks; usable by DOM builders if careful | ||||
|     childNodes = self.childNodes | ||||
| @ -198,6 +210,7 @@ def _append_child(self, node): | ||||
|     childNodes.append(node) | ||||
|     node.__dict__["parentNode"] = self | ||||
| 
 | ||||
| 
 | ||||
| class Childless: | ||||
|     """ Mixin that makes childless-ness easy to implement and avoids | ||||
|         the complexity of the Node methods that deal with children. | ||||
| @ -237,6 +250,7 @@ class Childless: | ||||
|         raise xml.dom.HierarchyRequestErr( | ||||
|             self.tagName + " nodes do not have children") | ||||
| 
 | ||||
| 
 | ||||
| class Text(Childless, Node): | ||||
|     nodeType = Node.TEXT_NODE | ||||
|     tagName = "Text" | ||||
| @ -255,6 +269,7 @@ class Text(Childless, Node): | ||||
|         if self.data: | ||||
|             f.write(_escape(type(u'')(self.data).encode('utf-8'))) | ||||
| 
 | ||||
| 
 | ||||
| class CDATASection(Text, Childless): | ||||
|     nodeType = Node.CDATA_SECTION_NODE | ||||
| 
 | ||||
| @ -266,6 +281,7 @@ class CDATASection(Text, Childless): | ||||
|         if self.data: | ||||
|             f.write('<![CDATA[%s]]>' % self.data.replace(']]>',']]>]]><![CDATA[')) | ||||
| 
 | ||||
| 
 | ||||
| class Element(Node): | ||||
|     """ Creates a arbitrary element and is intended to be subclassed not used on its own. | ||||
|         This element is the base of every element it defines a class which resembles | ||||
| @ -300,7 +316,7 @@ class Element(Node): | ||||
| 
 | ||||
|         allowed_attrs = self.allowed_attributes() | ||||
|         if allowed_attrs is not None: | ||||
|             allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             allowed_args = [a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|         self.attributes={} | ||||
|         # Load the attributes from the 'attributes' argument | ||||
|         if attributes: | ||||
| @ -332,14 +348,16 @@ class Element(Node): | ||||
|         """ | ||||
|         global nsdict | ||||
|         for ns,p in nsdict.items(): | ||||
|             if p == prefix: return ns | ||||
|             if p == prefix: | ||||
|                 return ns | ||||
|         return None | ||||
| 
 | ||||
|     def get_nsprefix(self, namespace): | ||||
|         """ Odfpy maintains a list of known namespaces. In some cases we have a namespace URL, | ||||
|             and needs to look up or assign the prefix for it. | ||||
|         """ | ||||
|         if namespace is None: namespace = "" | ||||
|         if namespace is None: | ||||
|             namespace = "" | ||||
|         prefix = _nsassign(namespace) | ||||
|         if namespace not in self.namespaces: | ||||
|             self.namespaces[namespace] = prefix | ||||
| @ -360,7 +378,7 @@ class Element(Node): | ||||
|         """ | ||||
|         if check_grammar and self.allowed_children is not None: | ||||
|             if element.qname not in self.allowed_children: | ||||
|                 raise IllegalChild("<%s> is not allowed in <%s>" % ( element.tagName, self.tagName)) | ||||
|                 raise IllegalChild("<%s> is not allowed in <%s>" % (element.tagName, self.tagName)) | ||||
|         self.appendChild(element) | ||||
|         self._setOwnerDoc(element) | ||||
|         if self.ownerDocument: | ||||
| @ -396,9 +414,9 @@ class Element(Node): | ||||
|                 raise AttributeError("Unable to add simple attribute - use (namespace, localpart)") | ||||
|         else: | ||||
|             # Construct a list of allowed arguments | ||||
|             allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             allowed_args = [a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             if check_grammar and attr not in allowed_args: | ||||
|                 raise AttributeError("Attribute %s is not allowed in <%s>" % ( attr, self.tagName)) | ||||
|                 raise AttributeError("Attribute %s is not allowed in <%s>" % (attr, self.tagName)) | ||||
|             i = allowed_args.index(attr) | ||||
|             self.removeAttrNS(allowed_attrs[i][0], allowed_attrs[i][1]) | ||||
| 
 | ||||
| @ -419,9 +437,9 @@ class Element(Node): | ||||
|                 raise AttributeError("Unable to add simple attribute - use (namespace, localpart)") | ||||
|         else: | ||||
|             # Construct a list of allowed arguments | ||||
|             allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             allowed_args = [a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             if check_grammar and attr not in allowed_args: | ||||
|                 raise AttributeError("Attribute %s is not allowed in <%s>" % ( attr, self.tagName)) | ||||
|                 raise AttributeError("Attribute %s is not allowed in <%s>" % (attr, self.tagName)) | ||||
|             i = allowed_args.index(attr) | ||||
|             self.setAttrNS(allowed_attrs[i][0], allowed_attrs[i][1], value) | ||||
| 
 | ||||
| @ -458,7 +476,7 @@ class Element(Node): | ||||
|                 raise AttributeError("Unable to get simple attribute - use (namespace, localpart)") | ||||
|         else: | ||||
|             # Construct a list of allowed arguments | ||||
|             allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             allowed_args = [a[1].lower().replace('-','') for a in allowed_attrs] | ||||
|             i = allowed_args.index(attr) | ||||
|             return self.getAttrNS(allowed_attrs[i][0], allowed_attrs[i][1]) | ||||
| 
 | ||||
|  | ||||
| @ -24,92 +24,121 @@ from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| def Button(**args): | ||||
|     return Element(qname = (FORMNS,'button'), **args) | ||||
|     return Element(qname=(FORMNS,'button'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Checkbox(**args): | ||||
|     return Element(qname = (FORMNS,'checkbox'), **args) | ||||
|     return Element(qname=(FORMNS,'checkbox'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Column(**args): | ||||
|     return Element(qname = (FORMNS,'column'), **args) | ||||
|     return Element(qname=(FORMNS,'column'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Combobox(**args): | ||||
|     return Element(qname = (FORMNS,'combobox'), **args) | ||||
|     return Element(qname=(FORMNS,'combobox'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConnectionResource(**args): | ||||
|     return Element(qname = (FORMNS,'connection-resource'), **args) | ||||
|     return Element(qname=(FORMNS,'connection-resource'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Date(**args): | ||||
|     return Element(qname = (FORMNS,'date'), **args) | ||||
|     return Element(qname=(FORMNS,'date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def File(**args): | ||||
|     return Element(qname = (FORMNS,'file'), **args) | ||||
|     return Element(qname=(FORMNS,'file'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FixedText(**args): | ||||
|     return Element(qname = (FORMNS,'fixed-text'), **args) | ||||
|     return Element(qname=(FORMNS,'fixed-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Form(**args): | ||||
|     return Element(qname = (FORMNS,'form'), **args) | ||||
|     return Element(qname=(FORMNS,'form'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FormattedText(**args): | ||||
|     return Element(qname = (FORMNS,'formatted-text'), **args) | ||||
|     return Element(qname=(FORMNS,'formatted-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Frame(**args): | ||||
|     return Element(qname = (FORMNS,'frame'), **args) | ||||
|     return Element(qname=(FORMNS,'frame'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def GenericControl(**args): | ||||
|     return Element(qname = (FORMNS,'generic-control'), **args) | ||||
|     return Element(qname=(FORMNS,'generic-control'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Grid(**args): | ||||
|     return Element(qname = (FORMNS,'grid'), **args) | ||||
|     return Element(qname=(FORMNS,'grid'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Hidden(**args): | ||||
|     return Element(qname = (FORMNS,'hidden'), **args) | ||||
|     return Element(qname=(FORMNS,'hidden'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Image(**args): | ||||
|     return Element(qname = (FORMNS,'image'), **args) | ||||
|     return Element(qname=(FORMNS,'image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ImageFrame(**args): | ||||
|     return Element(qname = (FORMNS,'image-frame'), **args) | ||||
|     return Element(qname=(FORMNS,'image-frame'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Item(**args): | ||||
|     return Element(qname = (FORMNS,'item'), **args) | ||||
|     return Element(qname=(FORMNS,'item'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListProperty(**args): | ||||
|     return Element(qname = (FORMNS,'list-property'), **args) | ||||
|     return Element(qname=(FORMNS,'list-property'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListValue(**args): | ||||
|     return Element(qname = (FORMNS,'list-value'), **args) | ||||
|     return Element(qname=(FORMNS,'list-value'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Listbox(**args): | ||||
|     return Element(qname = (FORMNS,'listbox'), **args) | ||||
|     return Element(qname=(FORMNS,'listbox'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Number(**args): | ||||
|     return Element(qname = (FORMNS,'number'), **args) | ||||
|     return Element(qname=(FORMNS,'number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Option(**args): | ||||
|     return Element(qname = (FORMNS,'option'), **args) | ||||
|     return Element(qname=(FORMNS,'option'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Password(**args): | ||||
|     return Element(qname = (FORMNS,'password'), **args) | ||||
|     return Element(qname=(FORMNS,'password'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Properties(**args): | ||||
|     return Element(qname = (FORMNS,'properties'), **args) | ||||
|     return Element(qname=(FORMNS,'properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Property(**args): | ||||
|     return Element(qname = (FORMNS,'property'), **args) | ||||
|     return Element(qname=(FORMNS,'property'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Radio(**args): | ||||
|     return Element(qname = (FORMNS,'radio'), **args) | ||||
|     return Element(qname=(FORMNS,'radio'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Text(**args): | ||||
|     return Element(qname = (FORMNS,'text'), **args) | ||||
|     return Element(qname=(FORMNS,'text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Textarea(**args): | ||||
|     return Element(qname = (FORMNS,'textarea'), **args) | ||||
|     return Element(qname=(FORMNS,'textarea'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Time(**args): | ||||
|     return Element(qname = (FORMNS,'time'), **args) | ||||
|     return Element(qname=(FORMNS,'time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ValueRange(**args): | ||||
|     return Element(qname = (FORMNS,'value-range'), **args) | ||||
|     return Element(qname=(FORMNS,'value-range'), **args) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										16214
									
								
								src/odf/grammar.py
									
									
									
									
									
								
							
							
						
						
									
										16214
									
								
								src/odf/grammar.py
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -32,13 +32,15 @@ from .namespaces import OFFICENS | ||||
| # | ||||
| # Parse the XML files | ||||
| # | ||||
| 
 | ||||
| 
 | ||||
| class LoadParser(handler.ContentHandler): | ||||
|     """ Extract headings from content.xml of an ODT file """ | ||||
|     triggers = ( | ||||
|        (OFFICENS, 'automatic-styles'), (OFFICENS, 'body'), | ||||
|        (OFFICENS, 'font-face-decls'), (OFFICENS, 'master-styles'), | ||||
|        (OFFICENS, 'meta'), (OFFICENS, 'scripts'), | ||||
|        (OFFICENS, 'settings'), (OFFICENS, 'styles') ) | ||||
|        (OFFICENS, 'settings'), (OFFICENS, 'styles')) | ||||
| 
 | ||||
|     def __init__(self, document): | ||||
|         self.doc = document | ||||
| @ -70,7 +72,7 @@ class LoadParser(handler.ContentHandler): | ||||
|         for (att,value) in attrs.items(): | ||||
|             attrdict[att] = value | ||||
|         try: | ||||
|             e = Element(qname = tag, qattributes=attrdict, check_grammar=False) | ||||
|             e = Element(qname=tag, qattributes=attrdict, check_grammar=False) | ||||
|             self.curr = e | ||||
|         except AttributeError as v: | ||||
|             print("Error: %s" % v) | ||||
| @ -95,7 +97,6 @@ class LoadParser(handler.ContentHandler): | ||||
|             self.parent.addElement(e, check_grammar=False) | ||||
|         self.parent = e | ||||
| 
 | ||||
| 
 | ||||
|     def endElementNS(self, tag, qname): | ||||
|         if self.parse == False: | ||||
|             return | ||||
|  | ||||
| @ -24,17 +24,23 @@ from .namespaces import MANIFESTNS | ||||
| from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Manifest(**args): | ||||
|     return Element(qname = (MANIFESTNS,'manifest'), **args) | ||||
|     return Element(qname=(MANIFESTNS,'manifest'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FileEntry(**args): | ||||
|     return Element(qname = (MANIFESTNS,'file-entry'), **args) | ||||
|     return Element(qname=(MANIFESTNS,'file-entry'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EncryptionData(**args): | ||||
|     return Element(qname = (MANIFESTNS,'encryption-data'), **args) | ||||
|     return Element(qname=(MANIFESTNS,'encryption-data'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Algorithm(**args): | ||||
|     return Element(qname = (MANIFESTNS,'algorithm'), **args) | ||||
|     return Element(qname=(MANIFESTNS,'algorithm'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def KeyDerivation(**args): | ||||
|     return Element(qname = (MANIFESTNS,'key-derivation'), **args) | ||||
|     return Element(qname=(MANIFESTNS,'key-derivation'), **args) | ||||
|  | ||||
| @ -25,6 +25,8 @@ from .element import Element | ||||
| # Mathematical content is represented by MathML 2.0 | ||||
| 
 | ||||
| # Autogenerated | ||||
| def Math(**args): | ||||
|     return Element(qname = (MATHNS,'math'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Math(**args): | ||||
|     return Element(qname=(MATHNS,'math'), **args) | ||||
| 
 | ||||
|  | ||||
| @ -22,45 +22,60 @@ from .namespaces import METANS | ||||
| from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def AutoReload(**args): | ||||
|     return Element(qname = (METANS,'auto-reload'), **args) | ||||
|     return Element(qname=(METANS,'auto-reload'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CreationDate(**args): | ||||
|     return Element(qname = (METANS,'creation-date'), **args) | ||||
|     return Element(qname=(METANS,'creation-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DateString(**args): | ||||
|     return Element(qname = (METANS,'date-string'), **args) | ||||
|     return Element(qname=(METANS,'date-string'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DocumentStatistic(**args): | ||||
|     return Element(qname = (METANS,'document-statistic'), **args) | ||||
|     return Element(qname=(METANS,'document-statistic'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EditingCycles(**args): | ||||
|     return Element(qname = (METANS,'editing-cycles'), **args) | ||||
|     return Element(qname=(METANS,'editing-cycles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EditingDuration(**args): | ||||
|     return Element(qname = (METANS,'editing-duration'), **args) | ||||
|     return Element(qname=(METANS,'editing-duration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Generator(**args): | ||||
|     return Element(qname = (METANS,'generator'), **args) | ||||
|     return Element(qname=(METANS,'generator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HyperlinkBehaviour(**args): | ||||
|     return Element(qname = (METANS,'hyperlink-behaviour'), **args) | ||||
|     return Element(qname=(METANS,'hyperlink-behaviour'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def InitialCreator(**args): | ||||
|     return Element(qname = (METANS,'initial-creator'), **args) | ||||
|     return Element(qname=(METANS,'initial-creator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Keyword(**args): | ||||
|     return Element(qname = (METANS,'keyword'), **args) | ||||
|     return Element(qname=(METANS,'keyword'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PrintDate(**args): | ||||
|     return Element(qname = (METANS,'print-date'), **args) | ||||
|     return Element(qname=(METANS,'print-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PrintedBy(**args): | ||||
|     return Element(qname = (METANS,'printed-by'), **args) | ||||
|     return Element(qname=(METANS,'printed-by'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Template(**args): | ||||
|     return Element(qname = (METANS,'template'), **args) | ||||
|     return Element(qname=(METANS,'template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserDefined(**args): | ||||
|     return Element(qname = (METANS,'user-defined'), **args) | ||||
|     return Element(qname=(METANS,'user-defined'), **args) | ||||
| 
 | ||||
|  | ||||
| @ -25,79 +25,104 @@ from .style import StyleElement | ||||
| 
 | ||||
| # Autogenerated | ||||
| def AmPm(**args): | ||||
|     return Element(qname = (NUMBERNS,'am-pm'), **args) | ||||
|     return Element(qname=(NUMBERNS,'am-pm'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Boolean(**args): | ||||
|     return Element(qname = (NUMBERNS,'boolean'), **args) | ||||
|     return Element(qname=(NUMBERNS,'boolean'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BooleanStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'boolean-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'boolean-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CurrencyStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'currency-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'currency-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CurrencySymbol(**args): | ||||
|     return Element(qname = (NUMBERNS,'currency-symbol'), **args) | ||||
|     return Element(qname=(NUMBERNS,'currency-symbol'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DateStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'date-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'date-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Day(**args): | ||||
|     return Element(qname = (NUMBERNS,'day'), **args) | ||||
|     return Element(qname=(NUMBERNS,'day'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DayOfWeek(**args): | ||||
|     return Element(qname = (NUMBERNS,'day-of-week'), **args) | ||||
|     return Element(qname=(NUMBERNS,'day-of-week'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EmbeddedText(**args): | ||||
|     return Element(qname = (NUMBERNS,'embedded-text'), **args) | ||||
|     return Element(qname=(NUMBERNS,'embedded-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Era(**args): | ||||
|     return Element(qname = (NUMBERNS,'era'), **args) | ||||
|     return Element(qname=(NUMBERNS,'era'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Fraction(**args): | ||||
|     return Element(qname = (NUMBERNS,'fraction'), **args) | ||||
|     return Element(qname=(NUMBERNS,'fraction'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Hours(**args): | ||||
|     return Element(qname = (NUMBERNS,'hours'), **args) | ||||
|     return Element(qname=(NUMBERNS,'hours'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Minutes(**args): | ||||
|     return Element(qname = (NUMBERNS,'minutes'), **args) | ||||
|     return Element(qname=(NUMBERNS,'minutes'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Month(**args): | ||||
|     return Element(qname = (NUMBERNS,'month'), **args) | ||||
|     return Element(qname=(NUMBERNS,'month'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Number(**args): | ||||
|     return Element(qname = (NUMBERNS,'number'), **args) | ||||
|     return Element(qname=(NUMBERNS,'number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NumberStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'number-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'number-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PercentageStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'percentage-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'percentage-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Quarter(**args): | ||||
|     return Element(qname = (NUMBERNS,'quarter'), **args) | ||||
|     return Element(qname=(NUMBERNS,'quarter'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ScientificNumber(**args): | ||||
|     return Element(qname = (NUMBERNS,'scientific-number'), **args) | ||||
|     return Element(qname=(NUMBERNS,'scientific-number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Seconds(**args): | ||||
|     return Element(qname = (NUMBERNS,'seconds'), **args) | ||||
|     return Element(qname=(NUMBERNS,'seconds'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Text(**args): | ||||
|     return Element(qname = (NUMBERNS,'text'), **args) | ||||
|     return Element(qname=(NUMBERNS,'text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TextContent(**args): | ||||
|     return Element(qname = (NUMBERNS,'text-content'), **args) | ||||
|     return Element(qname=(NUMBERNS,'text-content'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TextStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'text-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'text-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TimeStyle(**args): | ||||
|     return StyleElement(qname = (NUMBERNS,'time-style'), **args) | ||||
|     return StyleElement(qname=(NUMBERNS,'time-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def WeekOfYear(**args): | ||||
|     return Element(qname = (NUMBERNS,'week-of-year'), **args) | ||||
|     return Element(qname=(NUMBERNS,'week-of-year'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Year(**args): | ||||
|     return Element(qname = (NUMBERNS,'year'), **args) | ||||
|     return Element(qname=(NUMBERNS,'year'), **args) | ||||
|  | ||||
| @ -32,9 +32,9 @@ IGNORED_TAGS = [ | ||||
|     'office:annotation', | ||||
|     'presentation:notes', | ||||
|     'svg:desc', | ||||
| ] + [ nsdict[item[0]]+":"+item[1] for item in empty_elements] | ||||
| ] + [nsdict[item[0]]+":"+item[1] for item in empty_elements] | ||||
| 
 | ||||
| INLINE_TAGS = [ nsdict[item[0]]+":"+item[1] for item in inline_elements] | ||||
| INLINE_TAGS = [nsdict[item[0]]+":"+item[1] for item in inline_elements] | ||||
| 
 | ||||
| 
 | ||||
| class TextProps: | ||||
| @ -100,6 +100,7 @@ class TextProps: | ||||
|                                           str(self.bold), | ||||
|                                           str(self.fixed)) | ||||
| 
 | ||||
| 
 | ||||
| class ParagraphProps: | ||||
|     """ Holds properties of a paragraph style. """ | ||||
| 
 | ||||
| @ -123,7 +124,6 @@ class ParagraphProps: | ||||
|     def setCode(self, value): | ||||
|         self.code = value | ||||
| 
 | ||||
| 
 | ||||
|     def __str__(self): | ||||
| 
 | ||||
|         return "[bq=%s, h=%d, code=%s]" % (str(self.blockquote), | ||||
| @ -141,10 +141,8 @@ class ListProperties: | ||||
|         self.ordered = value | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| class ODF2MoinMoin(object): | ||||
| 
 | ||||
| 
 | ||||
|     def __init__(self, filepath): | ||||
|         self.footnotes = [] | ||||
|         self.footnoteCounter = 0 | ||||
| @ -183,8 +181,6 @@ class ODF2MoinMoin(object): | ||||
|             if fontFace.getAttribute("style:font-pitch") == "fixed": | ||||
|                 self.fixedFonts.append(fontFace.getAttribute("style:name")) | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     def extractTextProperties(self, style, parent=None): | ||||
|         """ Extracts text properties from a style element. """ | ||||
| 
 | ||||
| @ -196,7 +192,8 @@ class ODF2MoinMoin(object): | ||||
|                 textProp = parentProp | ||||
| 
 | ||||
|         textPropEl = style.getElementsByTagName("style:text-properties") | ||||
|         if not textPropEl: return textProps | ||||
|         if not textPropEl: | ||||
|             return textProps | ||||
| 
 | ||||
|         textPropEl = textPropEl[0] | ||||
| 
 | ||||
| @ -247,7 +244,6 @@ class ODF2MoinMoin(object): | ||||
| 
 | ||||
|         return paraProps | ||||
| 
 | ||||
| 
 | ||||
|     def processStyles(self, styleElements): | ||||
|         """ Runs through "style" elements extracting necessary information. | ||||
|         """ | ||||
| @ -256,7 +252,8 @@ class ODF2MoinMoin(object): | ||||
| 
 | ||||
|             name = style.getAttribute("style:name") | ||||
| 
 | ||||
|             if name == "Standard": continue | ||||
|             if name == "Standard": | ||||
|                 continue | ||||
| 
 | ||||
|             family = style.getAttribute("style:family") | ||||
|             parent = style.getAttribute("style:parent-style-name") | ||||
| @ -284,7 +281,6 @@ class ODF2MoinMoin(object): | ||||
| 
 | ||||
|             self.listStyles[name] = prop | ||||
| 
 | ||||
| 
 | ||||
|     def load(self, filepath): | ||||
|         """ Loads an ODT file. """ | ||||
| 
 | ||||
| @ -314,14 +310,14 @@ class ODF2MoinMoin(object): | ||||
|         numLines = len(lines) | ||||
|         for i in range(numLines): | ||||
| 
 | ||||
|             if (lines[i].strip() or i == numLines-1  or i == 0 or | ||||
|                 not ( lines[i-1].startswith("    ") | ||||
|                       and lines[i+1].startswith("    ") ) ): | ||||
|             if (lines[i].strip() or i == numLines-1 or i == 0 or | ||||
|                 not (lines[i-1].startswith("    ") | ||||
|                       and lines[i+1].startswith("    "))): | ||||
|                 buffer.append("\n" + lines[i]) | ||||
| 
 | ||||
|         return ''.join(buffer) | ||||
| 
 | ||||
| #----------------------------------- | ||||
| # ----------------------------------- | ||||
|     def do_nothing(self, node): | ||||
|         return '' | ||||
| 
 | ||||
| @ -330,7 +326,7 @@ class ODF2MoinMoin(object): | ||||
|         """ | ||||
| 
 | ||||
|         link = node.getAttribute("xlink:href") | ||||
|         if link and link[:2] == './': # Indicates a sub-object, which isn't supported | ||||
|         if link and link[:2] == './':  # Indicates a sub-object, which isn't supported | ||||
|             return "%s\n" % link | ||||
|         if link and link[:9] == 'Pictures/': | ||||
|             link = link[9:] | ||||
| @ -344,7 +340,6 @@ class ODF2MoinMoin(object): | ||||
|         else: | ||||
|             return "[%s %s] " % (link.strip(), text.strip()) | ||||
| 
 | ||||
| 
 | ||||
|     def text_line_break(self, node): | ||||
|         return "[[BR]]" | ||||
| 
 | ||||
| @ -396,8 +391,8 @@ class ODF2MoinMoin(object): | ||||
|         revmark.reverse() | ||||
|         return "%s%s%s" % (''.join(mark), text, ''.join(revmark)) | ||||
| 
 | ||||
| #----------------------------------- | ||||
|     def listToString(self, listElement, indent = 0): | ||||
| # ----------------------------------- | ||||
|     def listToString(self, listElement, indent=0): | ||||
| 
 | ||||
|         self.lastsegment = listElement.tagName | ||||
|         buffer = [] | ||||
| @ -448,7 +443,6 @@ class ODF2MoinMoin(object): | ||||
|                     self.lastsegment = cell.tagName | ||||
|         return ''.join(buffer) | ||||
| 
 | ||||
| 
 | ||||
|     def toString(self): | ||||
|         """ Converts the document to a string. | ||||
|             FIXME: Result from second call differs from first call | ||||
| @ -480,11 +474,9 @@ class ODF2MoinMoin(object): | ||||
|             for cite, body in self.footnotes: | ||||
|                 buffer.append("%s: %s" % (cite, body)) | ||||
| 
 | ||||
| 
 | ||||
|         buffer.append("") | ||||
|         return self.compressCodeBlocks('\n'.join(buffer)) | ||||
| 
 | ||||
| 
 | ||||
|     def textToString(self, element): | ||||
| 
 | ||||
|         buffer = [] | ||||
| @ -515,7 +507,7 @@ class ODF2MoinMoin(object): | ||||
| 
 | ||||
|         return ''.join(buffer) | ||||
| 
 | ||||
|     def paragraphToString(self, paragraph, indent = 0): | ||||
|     def paragraphToString(self, paragraph, indent=0): | ||||
| 
 | ||||
|         dummyParaProps = ParagraphProps() | ||||
| 
 | ||||
| @ -539,7 +531,8 @@ class ODF2MoinMoin(object): | ||||
|         if outlinelevel: | ||||
| 
 | ||||
|             level = int(outlinelevel) | ||||
|             if self.hasTitle: level += 1 | ||||
|             if self.hasTitle: | ||||
|                 level += 1 | ||||
| 
 | ||||
|             if level >= 1: | ||||
|                 return "=" * level + " " + text + " " + "=" * level + "\n" | ||||
| @ -548,13 +541,12 @@ class ODF2MoinMoin(object): | ||||
|             return "{{{\n" + text + "\n}}}\n" | ||||
| 
 | ||||
|         if paraProps.indented: | ||||
|             return self.wrapParagraph(text, indent = indent, blockquote = True) | ||||
|             return self.wrapParagraph(text, indent=indent, blockquote=True) | ||||
| 
 | ||||
|         else: | ||||
|             return self.wrapParagraph(text, indent = indent) | ||||
|             return self.wrapParagraph(text, indent=indent) | ||||
| 
 | ||||
| 
 | ||||
|     def wrapParagraph(self, text, indent = 0, blockquote=False): | ||||
|     def wrapParagraph(self, text, indent=0, blockquote=False): | ||||
| 
 | ||||
|         counter = 0 | ||||
|         buffer = [] | ||||
|  | ||||
| @ -29,11 +29,12 @@ import io | ||||
| 
 | ||||
| MANIFESTNS="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" | ||||
| 
 | ||||
| #----------------------------------------------------------------------------- | ||||
| # ----------------------------------------------------------------------------- | ||||
| # | ||||
| # ODFMANIFESTHANDLER | ||||
| # | ||||
| #----------------------------------------------------------------------------- | ||||
| # ----------------------------------------------------------------------------- | ||||
| 
 | ||||
| 
 | ||||
| class ODFManifestHandler(handler.ContentHandler): | ||||
|     """ The ODFManifestHandler parses a manifest file and produces a list of | ||||
| @ -80,14 +81,14 @@ class ODFManifestHandler(handler.ContentHandler): | ||||
|     def s_file_entry(self, tag, attrs): | ||||
|         m = attrs.get((MANIFESTNS, 'media-type'),"application/octet-stream") | ||||
|         p = attrs.get((MANIFESTNS, 'full-path')) | ||||
|         self.manifest[p] = { 'media-type':m, 'full-path':p } | ||||
|         self.manifest[p] = {'media-type':m, 'full-path':p} | ||||
| 
 | ||||
| 
 | ||||
| #----------------------------------------------------------------------------- | ||||
| # ----------------------------------------------------------------------------- | ||||
| # | ||||
| # Reading the file | ||||
| # | ||||
| #----------------------------------------------------------------------------- | ||||
| # ----------------------------------------------------------------------------- | ||||
| 
 | ||||
| def manifestlist(manifestxml): | ||||
|     odhandler = ODFManifestHandler() | ||||
| @ -103,12 +104,14 @@ def manifestlist(manifestxml): | ||||
| 
 | ||||
|     return odhandler.manifest | ||||
| 
 | ||||
| 
 | ||||
| def odfmanifest(odtfile): | ||||
|     z = zipfile.ZipFile(odtfile) | ||||
|     manifest = z.read('META-INF/manifest.xml') | ||||
|     z.close() | ||||
|     return manifestlist(manifest) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == "__main__": | ||||
|     import sys | ||||
|     result = odfmanifest(sys.argv[1]) | ||||
|  | ||||
| @ -23,82 +23,109 @@ from .element import Element | ||||
| from .draw import StyleRefElement | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Annotation(**args): | ||||
|     return StyleRefElement(qname = (OFFICENS,'annotation'), **args) | ||||
|     return StyleRefElement(qname=(OFFICENS,'annotation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AutomaticStyles(**args): | ||||
|     return Element(qname = (OFFICENS, 'automatic-styles'), **args) | ||||
|     return Element(qname=(OFFICENS, 'automatic-styles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BinaryData(**args): | ||||
|     return Element(qname = (OFFICENS,'binary-data'), **args) | ||||
|     return Element(qname=(OFFICENS,'binary-data'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Body(**args): | ||||
|     return Element(qname = (OFFICENS, 'body'), **args) | ||||
|     return Element(qname=(OFFICENS, 'body'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangeInfo(**args): | ||||
|     return Element(qname = (OFFICENS,'change-info'), **args) | ||||
|     return Element(qname=(OFFICENS,'change-info'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Chart(**args): | ||||
|     return Element(qname = (OFFICENS,'chart'), **args) | ||||
|     return Element(qname=(OFFICENS,'chart'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeSource(**args): | ||||
|     return Element(qname = (OFFICENS,'dde-source'), **args) | ||||
|     return Element(qname=(OFFICENS,'dde-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Document(version="1.1", **args): | ||||
|     return Element(qname = (OFFICENS,'document'), version=version, **args) | ||||
|     return Element(qname=(OFFICENS,'document'), version=version, **args) | ||||
| 
 | ||||
| 
 | ||||
| def DocumentContent(version="1.1", **args): | ||||
|     return Element(qname = (OFFICENS, 'document-content'), version=version, **args) | ||||
|     return Element(qname=(OFFICENS, 'document-content'), version=version, **args) | ||||
| 
 | ||||
| 
 | ||||
| def DocumentMeta(version="1.1", **args): | ||||
|     return Element(qname = (OFFICENS, 'document-meta'), version=version, **args) | ||||
|     return Element(qname=(OFFICENS, 'document-meta'), version=version, **args) | ||||
| 
 | ||||
| 
 | ||||
| def DocumentSettings(version="1.1", **args): | ||||
|     return Element(qname = (OFFICENS, 'document-settings'), version=version, **args) | ||||
|     return Element(qname=(OFFICENS, 'document-settings'), version=version, **args) | ||||
| 
 | ||||
| 
 | ||||
| def DocumentStyles(version="1.1", **args): | ||||
|     return Element(qname = (OFFICENS, 'document-styles'), version=version, **args) | ||||
|     return Element(qname=(OFFICENS, 'document-styles'), version=version, **args) | ||||
| 
 | ||||
| 
 | ||||
| def Drawing(**args): | ||||
|     return Element(qname = (OFFICENS,'drawing'), **args) | ||||
|     return Element(qname=(OFFICENS,'drawing'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EventListeners(**args): | ||||
|     return Element(qname = (OFFICENS,'event-listeners'), **args) | ||||
|     return Element(qname=(OFFICENS,'event-listeners'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFaceDecls(**args): | ||||
|     return Element(qname = (OFFICENS, 'font-face-decls'), **args) | ||||
|     return Element(qname=(OFFICENS, 'font-face-decls'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Forms(**args): | ||||
|     return Element(qname = (OFFICENS,'forms'), **args) | ||||
|     return Element(qname=(OFFICENS,'forms'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Image(**args): | ||||
|     return Element(qname = (OFFICENS,'image'), **args) | ||||
|     return Element(qname=(OFFICENS,'image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def MasterStyles(**args): | ||||
|     return Element(qname = (OFFICENS, 'master-styles'), **args) | ||||
|     return Element(qname=(OFFICENS, 'master-styles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Meta(**args): | ||||
|     return Element(qname = (OFFICENS, 'meta'), **args) | ||||
|     return Element(qname=(OFFICENS, 'meta'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Presentation(**args): | ||||
|     return Element(qname = (OFFICENS,'presentation'), **args) | ||||
|     return Element(qname=(OFFICENS,'presentation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Script(**args): | ||||
|     return Element(qname = (OFFICENS, 'script'), **args) | ||||
|     return Element(qname=(OFFICENS, 'script'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Scripts(**args): | ||||
|     return Element(qname = (OFFICENS, 'scripts'), **args) | ||||
|     return Element(qname=(OFFICENS, 'scripts'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Settings(**args): | ||||
|     return Element(qname = (OFFICENS, 'settings'), **args) | ||||
|     return Element(qname=(OFFICENS, 'settings'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Spreadsheet(**args): | ||||
|     return Element(qname = (OFFICENS, 'spreadsheet'), **args) | ||||
|     return Element(qname=(OFFICENS, 'spreadsheet'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Styles(**args): | ||||
|     return Element(qname = (OFFICENS, 'styles'), **args) | ||||
|     return Element(qname=(OFFICENS, 'styles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Text(**args): | ||||
|     return Element(qname = (OFFICENS, 'text'), **args) | ||||
|     return Element(qname=(OFFICENS, 'text'), **args) | ||||
| 
 | ||||
| # Autogenerated end | ||||
|  | ||||
| @ -41,8 +41,8 @@ IS_IMAGE = 1 | ||||
| # We need at least Python 2.2 | ||||
| assert sys.version_info[0]>=2 and sys.version_info[1] >= 2 | ||||
| 
 | ||||
| #sys.setrecursionlimit(100) | ||||
| #The recursion limit is set conservative so mistakes like | ||||
| # sys.setrecursionlimit(100) | ||||
| # The recursion limit is set conservative so mistakes like | ||||
| # s=content() s.addElement(s) won't eat up too much processor time. | ||||
| 
 | ||||
| odmimetypes = { | ||||
| @ -64,11 +64,13 @@ odmimetypes = { | ||||
|  'application/vnd.oasis.opendocument.text-web':              '.oth', | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| class OpaqueObject: | ||||
|     def __init__(self, filename, mediatype, content=None): | ||||
|        self.mediatype = mediatype | ||||
|        self.filename = filename | ||||
|        self.content = content | ||||
|         self.mediatype = mediatype | ||||
|         self.filename = filename | ||||
|         self.content = content | ||||
| 
 | ||||
| 
 | ||||
| class OpenDocument: | ||||
|     """ A class to hold the content of an OpenDocument document | ||||
| @ -83,7 +85,7 @@ class OpenDocument: | ||||
|         self.mimetype = mimetype | ||||
|         self.childobjects = [] | ||||
|         self._extra = [] | ||||
|         self.folder = "" # Always empty for toplevel documents | ||||
|         self.folder = ""  # Always empty for toplevel documents | ||||
|         self.topnode = Document(mimetype=self.mimetype) | ||||
|         self.topnode.ownerDocument = self | ||||
| 
 | ||||
| @ -110,7 +112,8 @@ class OpenDocument: | ||||
|         self.topnode.addElement(self.body) | ||||
| 
 | ||||
|     def rebuild_caches(self, node=None): | ||||
|         if node is None: node = self.topnode | ||||
|         if node is None: | ||||
|             node = self.topnode | ||||
|         self.build_caches(node) | ||||
|         for e in node.childNodes: | ||||
|             if e.nodeType == element.Node.ELEMENT_NODE: | ||||
| @ -128,7 +131,7 @@ class OpenDocument: | ||||
|             self.element_dict[element.qname] = [] | ||||
|         self.element_dict[element.qname].append(element) | ||||
|         if element.qname == (STYLENS, u'style'): | ||||
|             self.__register_stylename(element) # Add to style dictionary | ||||
|             self.__register_stylename(element)  # Add to style dictionary | ||||
|         styleref = element.getAttrNS(TEXTNS,u'style-name') | ||||
|         if styleref is not None and styleref in self._styles_ooo_fix: | ||||
|             element.setAttrNS(TEXTNS,u'style-name', self._styles_ooo_fix[styleref]) | ||||
| @ -143,7 +146,7 @@ class OpenDocument: | ||||
|             return | ||||
|         if element.parentNode.qname in ((OFFICENS,u'styles'), (OFFICENS,u'automatic-styles')): | ||||
|             if name in self._styles_dict: | ||||
|                 newname = 'M'+name # Rename style | ||||
|                 newname = 'M'+name  # Rename style | ||||
|                 self._styles_ooo_fix[name] = newname | ||||
|                 # From here on all references to the old name will refer to the new one | ||||
|                 name = newname | ||||
| @ -171,7 +174,6 @@ class OpenDocument: | ||||
|         self.topnode.toXml(0, xml) | ||||
|         return xml.getvalue() | ||||
| 
 | ||||
| 
 | ||||
|     def contentxml(self): | ||||
|         """ Generates the content.xml file | ||||
|             Always written as a bytestream in UTF-8 encoding | ||||
| @ -243,7 +245,7 @@ class OpenDocument: | ||||
|                         (STYLENS,u'style-name'), | ||||
|                         (TABLENS,u'default-cell-style-name'), | ||||
|                         (TABLENS,u'style-name'), | ||||
|                         (TEXTNS,u'style-name') ): | ||||
|                         (TEXTNS,u'style-name')): | ||||
|                     if e.getAttrNS(styleref[0],styleref[1]): | ||||
|                         stylename = e.getAttrNS(styleref[0],styleref[1]) | ||||
|                         if stylename not in stylenamelist: | ||||
| @ -295,8 +297,10 @@ class OpenDocument: | ||||
|                 mediatype, encoding = mimetypes.guess_type(filename) | ||||
|             if mediatype is None: | ||||
|                 mediatype = '' | ||||
|                 try: ext = filename[filename.rindex('.'):] | ||||
|                 except: ext='' | ||||
|                 try: | ||||
|                     ext = filename[filename.rindex('.'):] | ||||
|                 except: | ||||
|                     ext='' | ||||
|             else: | ||||
|                 ext = mimetypes.guess_extension(mediatype) | ||||
|             manifestfn = "Pictures/%0.0f%s" % ((time.time()*10000000000), ext) | ||||
| @ -317,8 +321,10 @@ class OpenDocument: | ||||
|             mediatype, encoding = mimetypes.guess_type(filename) | ||||
|         if mediatype is None: | ||||
|             mediatype = '' | ||||
|             try: ext = filename[filename.rindex('.'):] | ||||
|             except ValueError: ext='' | ||||
|             try: | ||||
|                 ext = filename[filename.rindex('.'):] | ||||
|             except ValueError: | ||||
|                 ext='' | ||||
|         else: | ||||
|             ext = mimetypes.guess_extension(mediatype) | ||||
|         manifestfn = "Pictures/%0.0f%s" % ((time.time()*10000000000), ext) | ||||
| @ -362,7 +368,7 @@ class OpenDocument: | ||||
|         hasPictures = False | ||||
|         for arcname, picturerec in object.Pictures.items(): | ||||
|             what_it_is, fileobj, mediatype = picturerec | ||||
|             self.manifest.addElement(manifest.FileEntry(fullpath="%s%s" % ( folder ,arcname), mediatype=mediatype)) | ||||
|             self.manifest.addElement(manifest.FileEntry(fullpath="%s%s" % (folder ,arcname), mediatype=mediatype)) | ||||
|             hasPictures = True | ||||
|             if what_it_is == IS_FILENAME: | ||||
|                 self._z.write(fileobj, arcname, zipfile.ZIP_STORED) | ||||
| @ -439,7 +445,8 @@ class OpenDocument: | ||||
| 
 | ||||
|         # Write any extra files | ||||
|         for op in self._extra: | ||||
|             if op.filename == "META-INF/documentsignatures.xml": continue # Don't save signatures | ||||
|             if op.filename == "META-INF/documentsignatures.xml": | ||||
|                 continue  # Don't save signatures | ||||
|             self.manifest.addElement(manifest.FileEntry(fullpath=op.filename, mediatype=op.mediatype)) | ||||
|             zi = zipfile.ZipInfo(op.filename.encode('utf-8'), self._now) | ||||
|             zi.compress_type = zipfile.ZIP_DEFLATED | ||||
| @ -450,12 +457,11 @@ class OpenDocument: | ||||
|         zi = zipfile.ZipInfo("META-INF/manifest.xml", self._now) | ||||
|         zi.compress_type = zipfile.ZIP_DEFLATED | ||||
|         zi.external_attr = UNIXPERMS | ||||
|         self._z.writestr(zi, self.__manifestxml() ) | ||||
|         self._z.writestr(zi, self.__manifestxml()) | ||||
|         del self._z | ||||
|         del self._now | ||||
|         del self.manifest | ||||
| 
 | ||||
| 
 | ||||
|     def _saveXmlObjects(self, object, folder): | ||||
|         if self == object: | ||||
|             self.manifest.addElement(manifest.FileEntry(fullpath="/", mediatype=object.mimetype)) | ||||
| @ -466,14 +472,14 @@ class OpenDocument: | ||||
|         zi = zipfile.ZipInfo("%sstyles.xml" % folder, self._now) | ||||
|         zi.compress_type = zipfile.ZIP_DEFLATED | ||||
|         zi.external_attr = UNIXPERMS | ||||
|         self._z.writestr(zi, object.stylesxml() ) | ||||
|         self._z.writestr(zi, object.stylesxml()) | ||||
| 
 | ||||
|         # Write content | ||||
|         self.manifest.addElement(manifest.FileEntry(fullpath="%scontent.xml" % folder, mediatype="text/xml")) | ||||
|         zi = zipfile.ZipInfo("%scontent.xml" % folder, self._now) | ||||
|         zi.compress_type = zipfile.ZIP_DEFLATED | ||||
|         zi.external_attr = UNIXPERMS | ||||
|         self._z.writestr(zi, object.contentxml() ) | ||||
|         self._z.writestr(zi, object.contentxml()) | ||||
| 
 | ||||
|         # Write settings | ||||
|         if object.settings.hasChildNodes(): | ||||
| @ -481,7 +487,7 @@ class OpenDocument: | ||||
|             zi = zipfile.ZipInfo("%ssettings.xml" % folder, self._now) | ||||
|             zi.compress_type = zipfile.ZIP_DEFLATED | ||||
|             zi.external_attr = UNIXPERMS | ||||
|             self._z.writestr(zi, object.settingsxml() ) | ||||
|             self._z.writestr(zi, object.settingsxml()) | ||||
| 
 | ||||
|         # Write meta | ||||
|         if self == object: | ||||
| @ -489,7 +495,7 @@ class OpenDocument: | ||||
|             zi = zipfile.ZipInfo("meta.xml", self._now) | ||||
|             zi.compress_type = zipfile.ZIP_DEFLATED | ||||
|             zi.external_attr = UNIXPERMS | ||||
|             self._z.writestr(zi, object.metaxml() ) | ||||
|             self._z.writestr(zi, object.metaxml()) | ||||
| 
 | ||||
|         # Write subobjects | ||||
|         subobjectnum = 1 | ||||
| @ -531,6 +537,8 @@ class OpenDocument: | ||||
|         return self.element_dict.get(obj.qname, []) | ||||
| 
 | ||||
| # Convenience functions | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentChart(): | ||||
|     """ Creates a chart document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.chart') | ||||
| @ -538,6 +546,7 @@ def OpenDocumentChart(): | ||||
|     doc.body.addElement(doc.chart) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentDrawing(): | ||||
|     """ Creates a drawing document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.graphics') | ||||
| @ -545,6 +554,7 @@ def OpenDocumentDrawing(): | ||||
|     doc.body.addElement(doc.drawing) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentImage(): | ||||
|     """ Creates an image document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.image') | ||||
| @ -552,6 +562,7 @@ def OpenDocumentImage(): | ||||
|     doc.body.addElement(doc.image) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentPresentation(): | ||||
|     """ Creates a presentation document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.presentation') | ||||
| @ -559,6 +570,7 @@ def OpenDocumentPresentation(): | ||||
|     doc.body.addElement(doc.presentation) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentSpreadsheet(): | ||||
|     """ Creates a spreadsheet document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.spreadsheet') | ||||
| @ -566,6 +578,7 @@ def OpenDocumentSpreadsheet(): | ||||
|     doc.body.addElement(doc.spreadsheet) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentText(): | ||||
|     """ Creates a text document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.text') | ||||
| @ -573,6 +586,7 @@ def OpenDocumentText(): | ||||
|     doc.body.addElement(doc.text) | ||||
|     return doc | ||||
| 
 | ||||
| 
 | ||||
| def OpenDocumentTextMaster(): | ||||
|     """ Creates a text master document """ | ||||
|     doc = OpenDocument('application/vnd.oasis.opendocument.text-master') | ||||
| @ -605,6 +619,7 @@ def __loadxmlparts(z, manifest, doc, objectpath): | ||||
|         except KeyError: | ||||
|             pass | ||||
| 
 | ||||
| 
 | ||||
| def load(odffile): | ||||
|     """ Load an ODF file into memory | ||||
|         Returns a reference to the structure | ||||
| @ -633,7 +648,7 @@ def load(odffile): | ||||
|             doc.addObject(subdoc, "/" + mentry[:-1]) | ||||
|             __loadxmlparts(z, manifest, subdoc, mentry) | ||||
|         elif mentry[:7] == "Object ": | ||||
|             pass # Don't load subobjects as opaque objects | ||||
|             pass  # Don't load subobjects as opaque objects | ||||
|         else: | ||||
|             if mvalue['full-path'][-1] == '/': | ||||
|                 doc._extra.append(OpaqueObject(mvalue['full-path'], mvalue['media-type'], None)) | ||||
|  | ||||
| @ -23,63 +23,84 @@ from .element import Element | ||||
| 
 | ||||
| # ODF 1.0 section 9.6 and 9.7 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def AnimationGroup(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'animation-group'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'animation-group'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Animations(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'animations'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'animations'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DateTime(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'date-time'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'date-time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DateTimeDecl(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'date-time-decl'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'date-time-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Dim(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'dim'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'dim'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EventListener(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'event-listener'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'event-listener'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Footer(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'footer'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'footer'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FooterDecl(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'footer-decl'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'footer-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Header(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'header'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'header'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HeaderDecl(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'header-decl'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'header-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HideShape(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'hide-shape'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'hide-shape'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HideText(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'hide-text'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'hide-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Notes(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'notes'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'notes'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Placeholder(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'placeholder'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'placeholder'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Play(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'play'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'play'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Settings(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'settings'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'settings'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Show(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'show'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'show'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ShowShape(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'show-shape'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'show-shape'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ShowText(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'show-text'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'show-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Sound(**args): | ||||
|     return Element(qname = (PRESENTATIONNS,'sound'), **args) | ||||
|     return Element(qname=(PRESENTATIONNS,'sound'), **args) | ||||
| 
 | ||||
|  | ||||
| @ -25,6 +25,8 @@ from .element import Element | ||||
| # The <script:event-listener> element binds an event to a macro. | ||||
| 
 | ||||
| # Autogenerated | ||||
| def EventListener(**args): | ||||
|     return Element(qname = (SCRIPTNS,'event-listener'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EventListener(**args): | ||||
|     return Element(qname=(SCRIPTNS,'event-listener'), **args) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										119
									
								
								src/odf/style.py
									
									
									
									
									
								
							
							
						
						
									
										119
									
								
								src/odf/style.py
									
									
									
									
									
								
							| @ -21,6 +21,7 @@ | ||||
| from .namespaces import STYLENS | ||||
| from .element import Element | ||||
| 
 | ||||
| 
 | ||||
| def StyleElement(**args): | ||||
|     e = Element(**args) | ||||
|     if args.get('check_grammar', True) == True: | ||||
| @ -29,119 +30,159 @@ def StyleElement(**args): | ||||
|     return e | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def BackgroundImage(**args): | ||||
|     return Element(qname = (STYLENS,'background-image'), **args) | ||||
|     return Element(qname=(STYLENS,'background-image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChartProperties(**args): | ||||
|     return Element(qname = (STYLENS,'chart-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'chart-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Column(**args): | ||||
|     return Element(qname = (STYLENS,'column'), **args) | ||||
|     return Element(qname=(STYLENS,'column'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ColumnSep(**args): | ||||
|     return Element(qname = (STYLENS,'column-sep'), **args) | ||||
|     return Element(qname=(STYLENS,'column-sep'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Columns(**args): | ||||
|     return Element(qname = (STYLENS,'columns'), **args) | ||||
|     return Element(qname=(STYLENS,'columns'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DefaultStyle(**args): | ||||
|     return Element(qname = (STYLENS,'default-style'), **args) | ||||
|     return Element(qname=(STYLENS,'default-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DrawingPageProperties(**args): | ||||
|     return Element(qname = (STYLENS,'drawing-page-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'drawing-page-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DropCap(**args): | ||||
|     return Element(qname = (STYLENS,'drop-cap'), **args) | ||||
|     return Element(qname=(STYLENS,'drop-cap'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFace(**args): | ||||
|     return Element(qname = (STYLENS,'font-face'), **args) | ||||
|     return Element(qname=(STYLENS,'font-face'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Footer(**args): | ||||
|     return Element(qname = (STYLENS,'footer'), **args) | ||||
|     return Element(qname=(STYLENS,'footer'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FooterLeft(**args): | ||||
|     return Element(qname = (STYLENS,'footer-left'), **args) | ||||
|     return Element(qname=(STYLENS,'footer-left'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FooterStyle(**args): | ||||
|     return Element(qname = (STYLENS,'footer-style'), **args) | ||||
|     return Element(qname=(STYLENS,'footer-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FootnoteSep(**args): | ||||
|     return Element(qname = (STYLENS,'footnote-sep'), **args) | ||||
|     return Element(qname=(STYLENS,'footnote-sep'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def GraphicProperties(**args): | ||||
|     return Element(qname = (STYLENS,'graphic-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'graphic-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HandoutMaster(**args): | ||||
|     return Element(qname = (STYLENS,'handout-master'), **args) | ||||
|     return Element(qname=(STYLENS,'handout-master'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Header(**args): | ||||
|     return Element(qname = (STYLENS,'header'), **args) | ||||
|     return Element(qname=(STYLENS,'header'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HeaderFooterProperties(**args): | ||||
|     return Element(qname = (STYLENS,'header-footer-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'header-footer-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HeaderLeft(**args): | ||||
|     return Element(qname = (STYLENS,'header-left'), **args) | ||||
|     return Element(qname=(STYLENS,'header-left'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HeaderStyle(**args): | ||||
|     return Element(qname = (STYLENS,'header-style'), **args) | ||||
|     return Element(qname=(STYLENS,'header-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListLevelProperties(**args): | ||||
|     return Element(qname = (STYLENS,'list-level-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'list-level-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Map(**args): | ||||
|     return Element(qname = (STYLENS,'map'), **args) | ||||
|     return Element(qname=(STYLENS,'map'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def MasterPage(**args): | ||||
|     return StyleElement(qname = (STYLENS,'master-page'), **args) | ||||
|     return StyleElement(qname=(STYLENS,'master-page'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageLayout(**args): | ||||
|     return Element(qname = (STYLENS,'page-layout'), **args) | ||||
|     return Element(qname=(STYLENS,'page-layout'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageLayoutProperties(**args): | ||||
|     return Element(qname = (STYLENS,'page-layout-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'page-layout-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ParagraphProperties(**args): | ||||
|     return Element(qname = (STYLENS,'paragraph-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'paragraph-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PresentationPageLayout(**args): | ||||
|     return StyleElement(qname = (STYLENS,'presentation-page-layout'), **args) | ||||
|     return StyleElement(qname=(STYLENS,'presentation-page-layout'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RegionCenter(**args): | ||||
|     return Element(qname = (STYLENS,'region-center'), **args) | ||||
|     return Element(qname=(STYLENS,'region-center'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RegionLeft(**args): | ||||
|     return Element(qname = (STYLENS,'region-left'), **args) | ||||
|     return Element(qname=(STYLENS,'region-left'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RegionRight(**args): | ||||
|     return Element(qname = (STYLENS,'region-right'), **args) | ||||
|     return Element(qname=(STYLENS,'region-right'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RubyProperties(**args): | ||||
|     return Element(qname = (STYLENS,'ruby-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'ruby-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SectionProperties(**args): | ||||
|     return Element(qname = (STYLENS,'section-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'section-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Style(**args): | ||||
|     return StyleElement(qname = (STYLENS,'style'), **args) | ||||
|     return StyleElement(qname=(STYLENS,'style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TabStop(**args): | ||||
|     return Element(qname = (STYLENS,'tab-stop'), **args) | ||||
|     return Element(qname=(STYLENS,'tab-stop'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TabStops(**args): | ||||
|     return Element(qname = (STYLENS,'tab-stops'), **args) | ||||
|     return Element(qname=(STYLENS,'tab-stops'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableCellProperties(**args): | ||||
|     return Element(qname = (STYLENS,'table-cell-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'table-cell-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableColumnProperties(**args): | ||||
|     return Element(qname = (STYLENS,'table-column-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'table-column-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableProperties(**args): | ||||
|     return Element(qname = (STYLENS,'table-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'table-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableRowProperties(**args): | ||||
|     return Element(qname = (STYLENS,'table-row-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'table-row-properties'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TextProperties(**args): | ||||
|     return Element(qname = (STYLENS,'text-properties'), **args) | ||||
|     return Element(qname=(STYLENS,'text-properties'), **args) | ||||
|  | ||||
| @ -23,32 +23,43 @@ from .element import Element | ||||
| from draw import DrawElement | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def DefinitionSrc(**args): | ||||
|     return Element(qname = (SVGNS,'definition-src'), **args) | ||||
|     return Element(qname=(SVGNS,'definition-src'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Desc(**args): | ||||
|     return Element(qname = (SVGNS,'desc'), **args) | ||||
|     return Element(qname=(SVGNS,'desc'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFaceFormat(**args): | ||||
|     return Element(qname = (SVGNS,'font-face-format'), **args) | ||||
|     return Element(qname=(SVGNS,'font-face-format'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFaceName(**args): | ||||
|     return Element(qname = (SVGNS,'font-face-name'), **args) | ||||
|     return Element(qname=(SVGNS,'font-face-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFaceSrc(**args): | ||||
|     return Element(qname = (SVGNS,'font-face-src'), **args) | ||||
|     return Element(qname=(SVGNS,'font-face-src'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FontFaceUri(**args): | ||||
|     return Element(qname = (SVGNS,'font-face-uri'), **args) | ||||
|     return Element(qname=(SVGNS,'font-face-uri'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Lineargradient(**args): | ||||
|     return DrawElement(qname = (SVGNS,'linearGradient'), **args) | ||||
|     return DrawElement(qname=(SVGNS,'linearGradient'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Radialgradient(**args): | ||||
|     return DrawElement(qname = (SVGNS,'radialGradient'), **args) | ||||
|     return DrawElement(qname=(SVGNS,'radialGradient'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Stop(**args): | ||||
|     return Element(qname = (SVGNS,'stop'), **args) | ||||
|     return Element(qname=(SVGNS,'stop'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Title(**args): | ||||
|     return Element(qname = (SVGNS,'title'), **args) | ||||
|     return Element(qname=(SVGNS,'title'), **args) | ||||
|  | ||||
							
								
								
									
										281
									
								
								src/odf/table.py
									
									
									
									
									
								
							
							
						
						
									
										281
									
								
								src/odf/table.py
									
									
									
									
									
								
							| @ -24,284 +24,377 @@ from .element import Element | ||||
| 
 | ||||
| # Autogenerated | ||||
| def Body(**args): | ||||
|     return Element(qname = (TABLENS,'body'), **args) | ||||
|     return Element(qname=(TABLENS,'body'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CalculationSettings(**args): | ||||
|     return Element(qname = (TABLENS,'calculation-settings'), **args) | ||||
|     return Element(qname=(TABLENS,'calculation-settings'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CellAddress(**args): | ||||
|     return Element(qname = (TABLENS,'cell-address'), **args) | ||||
|     return Element(qname=(TABLENS,'cell-address'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CellContentChange(**args): | ||||
|     return Element(qname = (TABLENS,'cell-content-change'), **args) | ||||
|     return Element(qname=(TABLENS,'cell-content-change'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CellContentDeletion(**args): | ||||
|     return Element(qname = (TABLENS,'cell-content-deletion'), **args) | ||||
|     return Element(qname=(TABLENS,'cell-content-deletion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CellRangeSource(**args): | ||||
|     return Element(qname = (TABLENS,'cell-range-source'), **args) | ||||
|     return Element(qname=(TABLENS,'cell-range-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangeDeletion(**args): | ||||
|     return Element(qname = (TABLENS,'change-deletion'), **args) | ||||
|     return Element(qname=(TABLENS,'change-deletion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangeTrackTableCell(**args): | ||||
|     return Element(qname = (TABLENS,'change-track-table-cell'), **args) | ||||
|     return Element(qname=(TABLENS,'change-track-table-cell'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Consolidation(**args): | ||||
|     return Element(qname = (TABLENS,'consolidation'), **args) | ||||
|     return Element(qname=(TABLENS,'consolidation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ContentValidation(**args): | ||||
|     return Element(qname = (TABLENS,'content-validation'), **args) | ||||
|     return Element(qname=(TABLENS,'content-validation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ContentValidations(**args): | ||||
|     return Element(qname = (TABLENS,'content-validations'), **args) | ||||
|     return Element(qname=(TABLENS,'content-validations'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CoveredTableCell(**args): | ||||
|     return Element(qname = (TABLENS,'covered-table-cell'), **args) | ||||
|     return Element(qname=(TABLENS,'covered-table-cell'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CutOffs(**args): | ||||
|     return Element(qname = (TABLENS,'cut-offs'), **args) | ||||
|     return Element(qname=(TABLENS,'cut-offs'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotDisplayInfo(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-display-info'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-display-info'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotField(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-field'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-field'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotFieldReference(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-field-reference'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-field-reference'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotGroup(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-group'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-group'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotGroupMember(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-group-member'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-group-member'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotGroups(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-groups'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-groups'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotLayoutInfo(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-layout-info'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-layout-info'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotLevel(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-level'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-level'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotMember(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-member'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-member'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotMembers(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-members'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-members'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotSortInfo(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-sort-info'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-sort-info'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotSubtotal(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-subtotal'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-subtotal'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotSubtotals(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-subtotals'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-subtotals'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotTable(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-table'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-table'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DataPilotTables(**args): | ||||
|     return Element(qname = (TABLENS,'data-pilot-tables'), **args) | ||||
|     return Element(qname=(TABLENS,'data-pilot-tables'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseRange(**args): | ||||
|     return Element(qname = (TABLENS,'database-range'), **args) | ||||
|     return Element(qname=(TABLENS,'database-range'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseRanges(**args): | ||||
|     return Element(qname = (TABLENS,'database-ranges'), **args) | ||||
|     return Element(qname=(TABLENS,'database-ranges'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseSourceQuery(**args): | ||||
|     return Element(qname = (TABLENS,'database-source-query'), **args) | ||||
|     return Element(qname=(TABLENS,'database-source-query'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseSourceSql(**args): | ||||
|     return Element(qname = (TABLENS,'database-source-sql'), **args) | ||||
|     return Element(qname=(TABLENS,'database-source-sql'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseSourceTable(**args): | ||||
|     return Element(qname = (TABLENS,'database-source-table'), **args) | ||||
|     return Element(qname=(TABLENS,'database-source-table'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeLink(**args): | ||||
|     return Element(qname = (TABLENS,'dde-link'), **args) | ||||
|     return Element(qname=(TABLENS,'dde-link'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeLinks(**args): | ||||
|     return Element(qname = (TABLENS,'dde-links'), **args) | ||||
|     return Element(qname=(TABLENS,'dde-links'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Deletion(**args): | ||||
|     return Element(qname = (TABLENS,'deletion'), **args) | ||||
|     return Element(qname=(TABLENS,'deletion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Deletions(**args): | ||||
|     return Element(qname = (TABLENS,'deletions'), **args) | ||||
|     return Element(qname=(TABLENS,'deletions'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Dependencies(**args): | ||||
|     return Element(qname = (TABLENS,'dependencies'), **args) | ||||
|     return Element(qname=(TABLENS,'dependencies'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Dependency(**args): | ||||
|     return Element(qname = (TABLENS,'dependency'), **args) | ||||
|     return Element(qname=(TABLENS,'dependency'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Detective(**args): | ||||
|     return Element(qname = (TABLENS,'detective'), **args) | ||||
|     return Element(qname=(TABLENS,'detective'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ErrorMacro(**args): | ||||
|     return Element(qname = (TABLENS,'error-macro'), **args) | ||||
|     return Element(qname=(TABLENS,'error-macro'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ErrorMessage(**args): | ||||
|     return Element(qname = (TABLENS,'error-message'), **args) | ||||
|     return Element(qname=(TABLENS,'error-message'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EvenColumns(**args): | ||||
|     return Element(qname = (TABLENS,'even-columns'), **args) | ||||
|     return Element(qname=(TABLENS,'even-columns'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EvenRows(**args): | ||||
|     return Element(qname = (TABLENS,'even-rows'), **args) | ||||
|     return Element(qname=(TABLENS,'even-rows'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Filter(**args): | ||||
|     return Element(qname = (TABLENS,'filter'), **args) | ||||
|     return Element(qname=(TABLENS,'filter'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FilterAnd(**args): | ||||
|     return Element(qname = (TABLENS,'filter-and'), **args) | ||||
|     return Element(qname=(TABLENS,'filter-and'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FilterCondition(**args): | ||||
|     return Element(qname = (TABLENS,'filter-condition'), **args) | ||||
|     return Element(qname=(TABLENS,'filter-condition'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FilterOr(**args): | ||||
|     return Element(qname = (TABLENS,'filter-or'), **args) | ||||
|     return Element(qname=(TABLENS,'filter-or'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FirstColumn(**args): | ||||
|     return Element(qname = (TABLENS,'first-column'), **args) | ||||
|     return Element(qname=(TABLENS,'first-column'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FirstRow(**args): | ||||
|     return Element(qname = (TABLENS,'first-row'), **args) | ||||
|     return Element(qname=(TABLENS,'first-row'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HelpMessage(**args): | ||||
|     return Element(qname = (TABLENS,'help-message'), **args) | ||||
|     return Element(qname=(TABLENS,'help-message'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HighlightedRange(**args): | ||||
|     return Element(qname = (TABLENS,'highlighted-range'), **args) | ||||
|     return Element(qname=(TABLENS,'highlighted-range'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Insertion(**args): | ||||
|     return Element(qname = (TABLENS,'insertion'), **args) | ||||
|     return Element(qname=(TABLENS,'insertion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def InsertionCutOff(**args): | ||||
|     return Element(qname = (TABLENS,'insertion-cut-off'), **args) | ||||
|     return Element(qname=(TABLENS,'insertion-cut-off'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Iteration(**args): | ||||
|     return Element(qname = (TABLENS,'iteration'), **args) | ||||
|     return Element(qname=(TABLENS,'iteration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LabelRange(**args): | ||||
|     return Element(qname = (TABLENS,'label-range'), **args) | ||||
|     return Element(qname=(TABLENS,'label-range'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LabelRanges(**args): | ||||
|     return Element(qname = (TABLENS,'label-ranges'), **args) | ||||
|     return Element(qname=(TABLENS,'label-ranges'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LastColumn(**args): | ||||
|     return Element(qname = (TABLENS,'last-column'), **args) | ||||
|     return Element(qname=(TABLENS,'last-column'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LastRow(**args): | ||||
|     return Element(qname = (TABLENS,'last-row'), **args) | ||||
|     return Element(qname=(TABLENS,'last-row'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Movement(**args): | ||||
|     return Element(qname = (TABLENS,'movement'), **args) | ||||
|     return Element(qname=(TABLENS,'movement'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def MovementCutOff(**args): | ||||
|     return Element(qname = (TABLENS,'movement-cut-off'), **args) | ||||
|     return Element(qname=(TABLENS,'movement-cut-off'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NamedExpression(**args): | ||||
|     return Element(qname = (TABLENS,'named-expression'), **args) | ||||
|     return Element(qname=(TABLENS,'named-expression'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NamedExpressions(**args): | ||||
|     return Element(qname = (TABLENS,'named-expressions'), **args) | ||||
|     return Element(qname=(TABLENS,'named-expressions'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NamedRange(**args): | ||||
|     return Element(qname = (TABLENS,'named-range'), **args) | ||||
|     return Element(qname=(TABLENS,'named-range'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NullDate(**args): | ||||
|     return Element(qname = (TABLENS,'null-date'), **args) | ||||
|     return Element(qname=(TABLENS,'null-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def OddColumns(**args): | ||||
|     return Element(qname = (TABLENS,'odd-columns'), **args) | ||||
|     return Element(qname=(TABLENS,'odd-columns'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def OddRows(**args): | ||||
|     return Element(qname = (TABLENS,'odd-rows'), **args) | ||||
|     return Element(qname=(TABLENS,'odd-rows'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Operation(**args): | ||||
|     return Element(qname = (TABLENS,'operation'), **args) | ||||
|     return Element(qname=(TABLENS,'operation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Previous(**args): | ||||
|     return Element(qname = (TABLENS,'previous'), **args) | ||||
|     return Element(qname=(TABLENS,'previous'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Scenario(**args): | ||||
|     return Element(qname = (TABLENS,'scenario'), **args) | ||||
|     return Element(qname=(TABLENS,'scenario'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Shapes(**args): | ||||
|     return Element(qname = (TABLENS,'shapes'), **args) | ||||
|     return Element(qname=(TABLENS,'shapes'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Sort(**args): | ||||
|     return Element(qname = (TABLENS,'sort'), **args) | ||||
|     return Element(qname=(TABLENS,'sort'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SortBy(**args): | ||||
|     return Element(qname = (TABLENS,'sort-by'), **args) | ||||
|     return Element(qname=(TABLENS,'sort-by'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SortGroups(**args): | ||||
|     return Element(qname = (TABLENS,'sort-groups'), **args) | ||||
|     return Element(qname=(TABLENS,'sort-groups'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SourceCellRange(**args): | ||||
|     return Element(qname = (TABLENS,'source-cell-range'), **args) | ||||
|     return Element(qname=(TABLENS,'source-cell-range'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SourceRangeAddress(**args): | ||||
|     return Element(qname = (TABLENS,'source-range-address'), **args) | ||||
|     return Element(qname=(TABLENS,'source-range-address'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SourceService(**args): | ||||
|     return Element(qname = (TABLENS,'source-service'), **args) | ||||
|     return Element(qname=(TABLENS,'source-service'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SubtotalField(**args): | ||||
|     return Element(qname = (TABLENS,'subtotal-field'), **args) | ||||
|     return Element(qname=(TABLENS,'subtotal-field'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SubtotalRule(**args): | ||||
|     return Element(qname = (TABLENS,'subtotal-rule'), **args) | ||||
|     return Element(qname=(TABLENS,'subtotal-rule'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SubtotalRules(**args): | ||||
|     return Element(qname = (TABLENS,'subtotal-rules'), **args) | ||||
|     return Element(qname=(TABLENS,'subtotal-rules'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Table(**args): | ||||
|     return Element(qname = (TABLENS,'table'), **args) | ||||
|     return Element(qname=(TABLENS,'table'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableCell(**args): | ||||
|     return Element(qname = (TABLENS,'table-cell'), **args) | ||||
|     return Element(qname=(TABLENS,'table-cell'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableColumn(**args): | ||||
|     return Element(qname = (TABLENS,'table-column'), **args) | ||||
|     return Element(qname=(TABLENS,'table-column'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableColumnGroup(**args): | ||||
|     return Element(qname = (TABLENS,'table-column-group'), **args) | ||||
|     return Element(qname=(TABLENS,'table-column-group'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableColumns(**args): | ||||
|     return Element(qname = (TABLENS,'table-columns'), **args) | ||||
|     return Element(qname=(TABLENS,'table-columns'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableHeaderColumns(**args): | ||||
|     return Element(qname = (TABLENS,'table-header-columns'), **args) | ||||
|     return Element(qname=(TABLENS,'table-header-columns'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableHeaderRows(**args): | ||||
|     return Element(qname = (TABLENS,'table-header-rows'), **args) | ||||
|     return Element(qname=(TABLENS,'table-header-rows'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableRow(**args): | ||||
|     return Element(qname = (TABLENS,'table-row'), **args) | ||||
|     return Element(qname=(TABLENS,'table-row'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableRowGroup(**args): | ||||
|     return Element(qname = (TABLENS,'table-row-group'), **args) | ||||
|     return Element(qname=(TABLENS,'table-row-group'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableRows(**args): | ||||
|     return Element(qname = (TABLENS,'table-rows'), **args) | ||||
|     return Element(qname=(TABLENS,'table-rows'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableSource(**args): | ||||
|     return Element(qname = (TABLENS,'table-source'), **args) | ||||
|     return Element(qname=(TABLENS,'table-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableTemplate(**args): | ||||
|     return Element(qname = (TABLENS,'table-template'), **args) | ||||
|     return Element(qname=(TABLENS,'table-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TargetRangeAddress(**args): | ||||
|     return Element(qname = (TABLENS,'target-range-address'), **args) | ||||
|     return Element(qname=(TABLENS,'target-range-address'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TrackedChanges(**args): | ||||
|     return Element(qname = (TABLENS,'tracked-changes'), **args) | ||||
|     return Element(qname=(TABLENS,'tracked-changes'), **args) | ||||
| 
 | ||||
|  | ||||
| @ -31,6 +31,7 @@ from odf.element import Node | ||||
| import odf.opendocument | ||||
| from odf.text import S,LineBreak,Tab | ||||
| 
 | ||||
| 
 | ||||
| class WhitespaceText(object): | ||||
| 
 | ||||
|     def __init__(self): | ||||
| @ -63,7 +64,7 @@ class WhitespaceText(object): | ||||
|                 odfElement.addElement(Tab()) | ||||
|                 i += 1 | ||||
|             elif ch == '\n': | ||||
|                 self._emitTextBuffer(odfElement); | ||||
|                 self._emitTextBuffer(odfElement) | ||||
|                 odfElement.addElement(LineBreak()) | ||||
|                 i += 1 | ||||
|             elif ch == ' ': | ||||
| @ -90,7 +91,6 @@ class WhitespaceText(object): | ||||
|             odfElement.addText(''.join(self.textBuffer)) | ||||
|         self.textBuffer = [] | ||||
| 
 | ||||
| 
 | ||||
|     def _emitSpaces(self, odfElement): | ||||
|         """ Creates a <text:s> element for the current spaceCount. | ||||
|             Side effect: sets spaceCount back to zero | ||||
| @ -100,10 +100,12 @@ class WhitespaceText(object): | ||||
|             odfElement.addElement(spaceElement) | ||||
|         self.spaceCount = 0 | ||||
| 
 | ||||
| 
 | ||||
| def addTextToElement(odfElement, s): | ||||
|     wst = WhitespaceText() | ||||
|     wst.addTextToElement(odfElement, s) | ||||
| 
 | ||||
| 
 | ||||
| def extractText(odfElement): | ||||
|     """ Extract text content from an Element, with whitespace represented | ||||
|         properly. Returns the text, with tabs, spaces, and newlines | ||||
| @ -111,7 +113,7 @@ def extractText(odfElement): | ||||
|         children of the given element, accumulating text and "unwrapping" | ||||
|         <text:s>, <text:tab>, and <text:line-break> elements along the way. | ||||
|     """ | ||||
|     result = []; | ||||
|     result = [] | ||||
| 
 | ||||
|     if len(odfElement.childNodes) != 0: | ||||
|         for child in odfElement.childNodes: | ||||
| @ -119,7 +121,7 @@ def extractText(odfElement): | ||||
|                 result.append(child.data) | ||||
|             elif child.nodeType == Node.ELEMENT_NODE: | ||||
|                 subElement = child | ||||
|                 tagName = subElement.qname; | ||||
|                 tagName = subElement.qname | ||||
|                 if tagName == (u"urn:oasis:names:tc:opendocument:xmlns:text:1.0", u"line-break"): | ||||
|                     result.append("\n") | ||||
|                 elif tagName == (u"urn:oasis:names:tc:opendocument:xmlns:text:1.0", u"tab"): | ||||
|  | ||||
							
								
								
									
										538
									
								
								src/odf/text.py
									
									
									
									
									
								
							
							
						
						
									
										538
									
								
								src/odf/text.py
									
									
									
									
									
								
							| @ -23,539 +23,719 @@ from .element import Element | ||||
| from .style import StyleElement | ||||
| 
 | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def A(**args): | ||||
|     return Element(qname = (TEXTNS,'a'), **args) | ||||
|     return Element(qname=(TEXTNS,'a'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndex(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexAutoMarkFile(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-auto-mark-file'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-auto-mark-file'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexMark(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-mark'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-mark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexMarkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-mark-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-mark-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexMarkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-mark-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-mark-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AlphabeticalIndexSource(**args): | ||||
|     return Element(qname = (TEXTNS,'alphabetical-index-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'alphabetical-index-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AuthorInitials(**args): | ||||
|     return Element(qname = (TEXTNS,'author-initials'), **args) | ||||
|     return Element(qname=(TEXTNS,'author-initials'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def AuthorName(**args): | ||||
|     return Element(qname = (TEXTNS,'author-name'), **args) | ||||
|     return Element(qname=(TEXTNS,'author-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Bibliography(**args): | ||||
|     return Element(qname = (TEXTNS,'bibliography'), **args) | ||||
|     return Element(qname=(TEXTNS,'bibliography'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BibliographyConfiguration(**args): | ||||
|     return Element(qname = (TEXTNS,'bibliography-configuration'), **args) | ||||
|     return Element(qname=(TEXTNS,'bibliography-configuration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BibliographyEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'bibliography-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'bibliography-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BibliographyMark(**args): | ||||
|     return Element(qname = (TEXTNS,'bibliography-mark'), **args) | ||||
|     return Element(qname=(TEXTNS,'bibliography-mark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BibliographySource(**args): | ||||
|     return Element(qname = (TEXTNS,'bibliography-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'bibliography-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Bookmark(**args): | ||||
|     return Element(qname = (TEXTNS,'bookmark'), **args) | ||||
|     return Element(qname=(TEXTNS,'bookmark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BookmarkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'bookmark-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'bookmark-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BookmarkRef(**args): | ||||
|     return Element(qname = (TEXTNS,'bookmark-ref'), **args) | ||||
|     return Element(qname=(TEXTNS,'bookmark-ref'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def BookmarkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'bookmark-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'bookmark-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Change(**args): | ||||
|     return Element(qname = (TEXTNS,'change'), **args) | ||||
|     return Element(qname=(TEXTNS,'change'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangeEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'change-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'change-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangeStart(**args): | ||||
|     return Element(qname = (TEXTNS,'change-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'change-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ChangedRegion(**args): | ||||
|     return Element(qname = (TEXTNS,'changed-region'), **args) | ||||
|     return Element(qname=(TEXTNS,'changed-region'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Chapter(**args): | ||||
|     return Element(qname = (TEXTNS,'chapter'), **args) | ||||
|     return Element(qname=(TEXTNS,'chapter'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CharacterCount(**args): | ||||
|     return Element(qname = (TEXTNS,'character-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'character-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ConditionalText(**args): | ||||
|     return Element(qname = (TEXTNS,'conditional-text'), **args) | ||||
|     return Element(qname=(TEXTNS,'conditional-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CreationDate(**args): | ||||
|     return Element(qname = (TEXTNS,'creation-date'), **args) | ||||
|     return Element(qname=(TEXTNS,'creation-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def CreationTime(**args): | ||||
|     return Element(qname = (TEXTNS,'creation-time'), **args) | ||||
|     return Element(qname=(TEXTNS,'creation-time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Creator(**args): | ||||
|     return Element(qname = (TEXTNS,'creator'), **args) | ||||
|     return Element(qname=(TEXTNS,'creator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseDisplay(**args): | ||||
|     return Element(qname = (TEXTNS,'database-display'), **args) | ||||
|     return Element(qname=(TEXTNS,'database-display'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseName(**args): | ||||
|     return Element(qname = (TEXTNS,'database-name'), **args) | ||||
|     return Element(qname=(TEXTNS,'database-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseNext(**args): | ||||
|     return Element(qname = (TEXTNS,'database-next'), **args) | ||||
|     return Element(qname=(TEXTNS,'database-next'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseRowNumber(**args): | ||||
|     return Element(qname = (TEXTNS,'database-row-number'), **args) | ||||
|     return Element(qname=(TEXTNS,'database-row-number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DatabaseRowSelect(**args): | ||||
|     return Element(qname = (TEXTNS,'database-row-select'), **args) | ||||
|     return Element(qname=(TEXTNS,'database-row-select'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Date(**args): | ||||
|     return Element(qname = (TEXTNS,'date'), **args) | ||||
|     return Element(qname=(TEXTNS,'date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeConnection(**args): | ||||
|     return Element(qname = (TEXTNS,'dde-connection'), **args) | ||||
|     return Element(qname=(TEXTNS,'dde-connection'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeConnectionDecl(**args): | ||||
|     return Element(qname = (TEXTNS,'dde-connection-decl'), **args) | ||||
|     return Element(qname=(TEXTNS,'dde-connection-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def DdeConnectionDecls(**args): | ||||
|     return Element(qname = (TEXTNS,'dde-connection-decls'), **args) | ||||
|     return Element(qname=(TEXTNS,'dde-connection-decls'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Deletion(**args): | ||||
|     return Element(qname = (TEXTNS,'deletion'), **args) | ||||
|     return Element(qname=(TEXTNS,'deletion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Description(**args): | ||||
|     return Element(qname = (TEXTNS,'description'), **args) | ||||
|     return Element(qname=(TEXTNS,'description'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EditingCycles(**args): | ||||
|     return Element(qname = (TEXTNS,'editing-cycles'), **args) | ||||
|     return Element(qname=(TEXTNS,'editing-cycles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def EditingDuration(**args): | ||||
|     return Element(qname = (TEXTNS,'editing-duration'), **args) | ||||
|     return Element(qname=(TEXTNS,'editing-duration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ExecuteMacro(**args): | ||||
|     return Element(qname = (TEXTNS,'execute-macro'), **args) | ||||
|     return Element(qname=(TEXTNS,'execute-macro'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Expression(**args): | ||||
|     return Element(qname = (TEXTNS,'expression'), **args) | ||||
|     return Element(qname=(TEXTNS,'expression'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FileName(**args): | ||||
|     return Element(qname = (TEXTNS,'file-name'), **args) | ||||
|     return Element(qname=(TEXTNS,'file-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def FormatChange(**args): | ||||
|     return Element(qname = (TEXTNS,'format-change'), **args) | ||||
|     return Element(qname=(TEXTNS,'format-change'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def H(**args): | ||||
|     return Element(qname = (TEXTNS, 'h'), **args) | ||||
|     return Element(qname=(TEXTNS, 'h'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HiddenParagraph(**args): | ||||
|     return Element(qname = (TEXTNS,'hidden-paragraph'), **args) | ||||
|     return Element(qname=(TEXTNS,'hidden-paragraph'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def HiddenText(**args): | ||||
|     return Element(qname = (TEXTNS,'hidden-text'), **args) | ||||
|     return Element(qname=(TEXTNS,'hidden-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IllustrationIndex(**args): | ||||
|     return Element(qname = (TEXTNS,'illustration-index'), **args) | ||||
|     return Element(qname=(TEXTNS,'illustration-index'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IllustrationIndexEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'illustration-index-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'illustration-index-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IllustrationIndexSource(**args): | ||||
|     return Element(qname = (TEXTNS,'illustration-index-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'illustration-index-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ImageCount(**args): | ||||
|     return Element(qname = (TEXTNS,'image-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'image-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexBody(**args): | ||||
|     return Element(qname = (TEXTNS,'index-body'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-body'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryBibliography(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-bibliography'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-bibliography'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryChapter(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-chapter'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-chapter'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryLinkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-link-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-link-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryLinkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-link-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-link-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryPageNumber(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-page-number'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-page-number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntrySpan(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-span'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-span'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryTabStop(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-tab-stop'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-tab-stop'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexEntryText(**args): | ||||
|     return Element(qname = (TEXTNS,'index-entry-text'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-entry-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexSourceStyle(**args): | ||||
|     return Element(qname = (TEXTNS,'index-source-style'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-source-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexSourceStyles(**args): | ||||
|     return Element(qname = (TEXTNS,'index-source-styles'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-source-styles'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexTitle(**args): | ||||
|     return Element(qname = (TEXTNS,'index-title'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-title'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def IndexTitleTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'index-title-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'index-title-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def InitialCreator(**args): | ||||
|     return Element(qname = (TEXTNS,'initial-creator'), **args) | ||||
|     return Element(qname=(TEXTNS,'initial-creator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Insertion(**args): | ||||
|     return Element(qname = (TEXTNS,'insertion'), **args) | ||||
|     return Element(qname=(TEXTNS,'insertion'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Keywords(**args): | ||||
|     return Element(qname = (TEXTNS,'keywords'), **args) | ||||
|     return Element(qname=(TEXTNS,'keywords'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LineBreak(**args): | ||||
|     return Element(qname = (TEXTNS,'line-break'), **args) | ||||
|     return Element(qname=(TEXTNS,'line-break'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LinenumberingConfiguration(**args): | ||||
|     return Element(qname = (TEXTNS,'linenumbering-configuration'), **args) | ||||
|     return Element(qname=(TEXTNS,'linenumbering-configuration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def LinenumberingSeparator(**args): | ||||
|     return Element(qname = (TEXTNS,'linenumbering-separator'), **args) | ||||
|     return Element(qname=(TEXTNS,'linenumbering-separator'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def List(**args): | ||||
|     return Element(qname = (TEXTNS,'list'), **args) | ||||
|     return Element(qname=(TEXTNS,'list'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListHeader(**args): | ||||
|     return Element(qname = (TEXTNS,'list-header'), **args) | ||||
|     return Element(qname=(TEXTNS,'list-header'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListItem(**args): | ||||
|     return Element(qname = (TEXTNS,'list-item'), **args) | ||||
|     return Element(qname=(TEXTNS,'list-item'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListLevelStyleBullet(**args): | ||||
|     return Element(qname = (TEXTNS,'list-level-style-bullet'), **args) | ||||
|     return Element(qname=(TEXTNS,'list-level-style-bullet'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListLevelStyleImage(**args): | ||||
|     return Element(qname = (TEXTNS,'list-level-style-image'), **args) | ||||
|     return Element(qname=(TEXTNS,'list-level-style-image'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListLevelStyleNumber(**args): | ||||
|     return Element(qname = (TEXTNS,'list-level-style-number'), **args) | ||||
|     return Element(qname=(TEXTNS,'list-level-style-number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ListStyle(**args): | ||||
|     return StyleElement(qname = (TEXTNS,'list-style'), **args) | ||||
|     return StyleElement(qname=(TEXTNS,'list-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Measure(**args): | ||||
|     return Element(qname = (TEXTNS,'measure'), **args) | ||||
|     return Element(qname=(TEXTNS,'measure'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ModificationDate(**args): | ||||
|     return Element(qname = (TEXTNS,'modification-date'), **args) | ||||
|     return Element(qname=(TEXTNS,'modification-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ModificationTime(**args): | ||||
|     return Element(qname = (TEXTNS,'modification-time'), **args) | ||||
|     return Element(qname=(TEXTNS,'modification-time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Note(**args): | ||||
|     return Element(qname = (TEXTNS,'note'), **args) | ||||
|     return Element(qname=(TEXTNS,'note'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NoteBody(**args): | ||||
|     return Element(qname = (TEXTNS,'note-body'), **args) | ||||
|     return Element(qname=(TEXTNS,'note-body'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NoteCitation(**args): | ||||
|     return Element(qname = (TEXTNS,'note-citation'), **args) | ||||
|     return Element(qname=(TEXTNS,'note-citation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NoteContinuationNoticeBackward(**args): | ||||
|     return Element(qname = (TEXTNS,'note-continuation-notice-backward'), **args) | ||||
|     return Element(qname=(TEXTNS,'note-continuation-notice-backward'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NoteContinuationNoticeForward(**args): | ||||
|     return Element(qname = (TEXTNS,'note-continuation-notice-forward'), **args) | ||||
|     return Element(qname=(TEXTNS,'note-continuation-notice-forward'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NoteRef(**args): | ||||
|     return Element(qname = (TEXTNS,'note-ref'), **args) | ||||
|     return Element(qname=(TEXTNS,'note-ref'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NotesConfiguration(**args): | ||||
|     return Element(qname = (TEXTNS,'notes-configuration'), **args) | ||||
|     return Element(qname=(TEXTNS,'notes-configuration'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Number(**args): | ||||
|     return Element(qname = (TEXTNS,'number'), **args) | ||||
|     return Element(qname=(TEXTNS,'number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def NumberedParagraph(**args): | ||||
|     return Element(qname = (TEXTNS,'numbered-paragraph'), **args) | ||||
|     return Element(qname=(TEXTNS,'numbered-paragraph'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ObjectCount(**args): | ||||
|     return Element(qname = (TEXTNS,'object-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'object-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ObjectIndex(**args): | ||||
|     return Element(qname = (TEXTNS,'object-index'), **args) | ||||
|     return Element(qname=(TEXTNS,'object-index'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ObjectIndexEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'object-index-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'object-index-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ObjectIndexSource(**args): | ||||
|     return Element(qname = (TEXTNS,'object-index-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'object-index-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def OutlineLevelStyle(**args): | ||||
|     return Element(qname = (TEXTNS,'outline-level-style'), **args) | ||||
|     return Element(qname=(TEXTNS,'outline-level-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def OutlineStyle(**args): | ||||
|     return Element(qname = (TEXTNS,'outline-style'), **args) | ||||
|     return Element(qname=(TEXTNS,'outline-style'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def P(**args): | ||||
|     return Element(qname = (TEXTNS, 'p'), **args) | ||||
|     return Element(qname=(TEXTNS, 'p'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Page(**args): | ||||
|     return Element(qname = (TEXTNS,'page'), **args) | ||||
|     return Element(qname=(TEXTNS,'page'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageContinuation(**args): | ||||
|     return Element(qname = (TEXTNS,'page-continuation'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-continuation'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageCount(**args): | ||||
|     return Element(qname = (TEXTNS,'page-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageNumber(**args): | ||||
|     return Element(qname = (TEXTNS,'page-number'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-number'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageSequence(**args): | ||||
|     return Element(qname = (TEXTNS,'page-sequence'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-sequence'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageVariableGet(**args): | ||||
|     return Element(qname = (TEXTNS,'page-variable-get'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-variable-get'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PageVariableSet(**args): | ||||
|     return Element(qname = (TEXTNS,'page-variable-set'), **args) | ||||
|     return Element(qname=(TEXTNS,'page-variable-set'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ParagraphCount(**args): | ||||
|     return Element(qname = (TEXTNS,'paragraph-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'paragraph-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Placeholder(**args): | ||||
|     return Element(qname = (TEXTNS,'placeholder'), **args) | ||||
|     return Element(qname=(TEXTNS,'placeholder'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PrintDate(**args): | ||||
|     return Element(qname = (TEXTNS,'print-date'), **args) | ||||
|     return Element(qname=(TEXTNS,'print-date'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PrintTime(**args): | ||||
|     return Element(qname = (TEXTNS,'print-time'), **args) | ||||
|     return Element(qname=(TEXTNS,'print-time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def PrintedBy(**args): | ||||
|     return Element(qname = (TEXTNS,'printed-by'), **args) | ||||
|     return Element(qname=(TEXTNS,'printed-by'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ReferenceMark(**args): | ||||
|     return Element(qname = (TEXTNS,'reference-mark'), **args) | ||||
|     return Element(qname=(TEXTNS,'reference-mark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ReferenceMarkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'reference-mark-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'reference-mark-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ReferenceMarkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'reference-mark-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'reference-mark-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def ReferenceRef(**args): | ||||
|     return Element(qname = (TEXTNS,'reference-ref'), **args) | ||||
|     return Element(qname=(TEXTNS,'reference-ref'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Ruby(**args): | ||||
|     return Element(qname = (TEXTNS,'ruby'), **args) | ||||
|     return Element(qname=(TEXTNS,'ruby'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RubyBase(**args): | ||||
|     return Element(qname = (TEXTNS,'ruby-base'), **args) | ||||
|     return Element(qname=(TEXTNS,'ruby-base'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def RubyText(**args): | ||||
|     return Element(qname = (TEXTNS,'ruby-text'), **args) | ||||
|     return Element(qname=(TEXTNS,'ruby-text'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def S(**args): | ||||
|     return Element(qname = (TEXTNS,'s'), **args) | ||||
|     return Element(qname=(TEXTNS,'s'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Script(**args): | ||||
|     return Element(qname = (TEXTNS,'script'), **args) | ||||
|     return Element(qname=(TEXTNS,'script'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Section(**args): | ||||
|     return Element(qname = (TEXTNS,'section'), **args) | ||||
|     return Element(qname=(TEXTNS,'section'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SectionSource(**args): | ||||
|     return Element(qname = (TEXTNS,'section-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'section-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderCity(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-city'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-city'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderCompany(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-company'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-company'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderCountry(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-country'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-country'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderEmail(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-email'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-email'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderFax(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-fax'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-fax'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderFirstname(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-firstname'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-firstname'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderInitials(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-initials'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-initials'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderLastname(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-lastname'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-lastname'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderPhonePrivate(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-phone-private'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-phone-private'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderPhoneWork(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-phone-work'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-phone-work'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderPosition(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-position'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-position'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderPostalCode(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-postal-code'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-postal-code'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderStateOrProvince(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-state-or-province'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-state-or-province'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderStreet(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-street'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-street'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SenderTitle(**args): | ||||
|     return Element(qname = (TEXTNS,'sender-title'), **args) | ||||
|     return Element(qname=(TEXTNS,'sender-title'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Sequence(**args): | ||||
|     return Element(qname = (TEXTNS,'sequence'), **args) | ||||
|     return Element(qname=(TEXTNS,'sequence'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SequenceDecl(**args): | ||||
|     return Element(qname = (TEXTNS,'sequence-decl'), **args) | ||||
|     return Element(qname=(TEXTNS,'sequence-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SequenceDecls(**args): | ||||
|     return Element(qname = (TEXTNS,'sequence-decls'), **args) | ||||
|     return Element(qname=(TEXTNS,'sequence-decls'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SequenceRef(**args): | ||||
|     return Element(qname = (TEXTNS,'sequence-ref'), **args) | ||||
|     return Element(qname=(TEXTNS,'sequence-ref'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SheetName(**args): | ||||
|     return Element(qname = (TEXTNS,'sheet-name'), **args) | ||||
|     return Element(qname=(TEXTNS,'sheet-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SoftPageBreak(**args): | ||||
|     return Element(qname = (TEXTNS,'soft-page-break'), **args) | ||||
|     return Element(qname=(TEXTNS,'soft-page-break'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def SortKey(**args): | ||||
|     return Element(qname = (TEXTNS,'sort-key'), **args) | ||||
|     return Element(qname=(TEXTNS,'sort-key'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Span(**args): | ||||
|     return Element(qname = (TEXTNS,'span'), **args) | ||||
|     return Element(qname=(TEXTNS,'span'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Subject(**args): | ||||
|     return Element(qname = (TEXTNS,'subject'), **args) | ||||
|     return Element(qname=(TEXTNS,'subject'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Tab(**args): | ||||
|     return Element(qname = (TEXTNS,'tab'), **args) | ||||
|     return Element(qname=(TEXTNS,'tab'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableCount(**args): | ||||
|     return Element(qname = (TEXTNS,'table-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-count'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableFormula(**args): | ||||
|     return Element(qname = (TEXTNS,'table-formula'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-formula'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableIndex(**args): | ||||
|     return Element(qname = (TEXTNS,'table-index'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-index'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableIndexEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'table-index-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-index-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableIndexSource(**args): | ||||
|     return Element(qname = (TEXTNS,'table-index-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-index-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableOfContent(**args): | ||||
|     return Element(qname = (TEXTNS,'table-of-content'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-of-content'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableOfContentEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'table-of-content-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-of-content-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TableOfContentSource(**args): | ||||
|     return Element(qname = (TEXTNS,'table-of-content-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'table-of-content-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TemplateName(**args): | ||||
|     return Element(qname = (TEXTNS,'template-name'), **args) | ||||
|     return Element(qname=(TEXTNS,'template-name'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TextInput(**args): | ||||
|     return Element(qname = (TEXTNS,'text-input'), **args) | ||||
|     return Element(qname=(TEXTNS,'text-input'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Time(**args): | ||||
|     return Element(qname = (TEXTNS,'time'), **args) | ||||
|     return Element(qname=(TEXTNS,'time'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Title(**args): | ||||
|     return Element(qname = (TEXTNS,'title'), **args) | ||||
|     return Element(qname=(TEXTNS,'title'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TocMark(**args): | ||||
|     return Element(qname = (TEXTNS,'toc-mark'), **args) | ||||
|     return Element(qname=(TEXTNS,'toc-mark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TocMarkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'toc-mark-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'toc-mark-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TocMarkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'toc-mark-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'toc-mark-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def TrackedChanges(**args): | ||||
|     return Element(qname = (TEXTNS,'tracked-changes'), **args) | ||||
|     return Element(qname=(TEXTNS,'tracked-changes'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserDefined(**args): | ||||
|     return Element(qname = (TEXTNS,'user-defined'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-defined'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserFieldDecl(**args): | ||||
|     return Element(qname = (TEXTNS,'user-field-decl'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-field-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserFieldDecls(**args): | ||||
|     return Element(qname = (TEXTNS,'user-field-decls'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-field-decls'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserFieldGet(**args): | ||||
|     return Element(qname = (TEXTNS,'user-field-get'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-field-get'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserFieldInput(**args): | ||||
|     return Element(qname = (TEXTNS,'user-field-input'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-field-input'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndex(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndexEntryTemplate(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index-entry-template'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index-entry-template'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndexMark(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index-mark'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index-mark'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndexMarkEnd(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index-mark-end'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index-mark-end'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndexMarkStart(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index-mark-start'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index-mark-start'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def UserIndexSource(**args): | ||||
|     return Element(qname = (TEXTNS,'user-index-source'), **args) | ||||
|     return Element(qname=(TEXTNS,'user-index-source'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def VariableDecl(**args): | ||||
|     return Element(qname = (TEXTNS,'variable-decl'), **args) | ||||
|     return Element(qname=(TEXTNS,'variable-decl'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def VariableDecls(**args): | ||||
|     return Element(qname = (TEXTNS,'variable-decls'), **args) | ||||
|     return Element(qname=(TEXTNS,'variable-decls'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def VariableGet(**args): | ||||
|     return Element(qname = (TEXTNS,'variable-get'), **args) | ||||
|     return Element(qname=(TEXTNS,'variable-get'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def VariableInput(**args): | ||||
|     return Element(qname = (TEXTNS,'variable-input'), **args) | ||||
|     return Element(qname=(TEXTNS,'variable-input'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def VariableSet(**args): | ||||
|     return Element(qname = (TEXTNS,'variable-set'), **args) | ||||
|     return Element(qname=(TEXTNS,'variable-set'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def WordCount(**args): | ||||
|     return Element(qname = (TEXTNS,'word-count'), **args) | ||||
|     return Element(qname=(TEXTNS,'word-count'), **args) | ||||
|  | ||||
| @ -416,10 +416,12 @@ CGeAjdwhVVv/GQb3GhacACCAWIbY1bGwCKEL0NTU/A+1jxGaABiRIvs/NEcP6du0AAIMANtMxR3x | ||||
| N38FAAAAAElFTkSuQmCC\ | ||||
| """ | ||||
| 
 | ||||
| 
 | ||||
| def thumbnail(): | ||||
|     icon = base64.decodestring(iconstr) | ||||
|     return icon | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == "__main__": | ||||
|     icon = thumbnail() | ||||
|     f = file("thumbnail.png","wb") | ||||
|  | ||||
| @ -24,11 +24,15 @@ from .element import Element | ||||
| # ODF 1.0 section 11.2 | ||||
| # XForms is designed to be embedded in another XML format. | ||||
| # Autogenerated | ||||
| 
 | ||||
| 
 | ||||
| def Model(**args): | ||||
|     return Element(qname = (XFORMSNS,'model'), **args) | ||||
|     return Element(qname=(XFORMSNS,'model'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Instance(**args): | ||||
|     return Element(qname = (XFORMSNS,'instance'), **args) | ||||
|     return Element(qname=(XFORMSNS,'instance'), **args) | ||||
| 
 | ||||
| 
 | ||||
| def Bind(**args): | ||||
|     return Element(qname = (XFORMSNS,'bind'), **args) | ||||
|     return Element(qname=(XFORMSNS,'bind'), **args) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user