def test_register_family(self): register_element_class('office:dummy3', self.dummy_element, family='graphics') element = odf_create_element('<office:dummy3/>') self.assert_(type(element) is odf_element) element = odf_create_element('<office:dummy3 ' 'style:family="graphics"/>') self.assert_(type(element) is self.dummy_element) element = odf_create_element('<office:dummy4 ' 'style:family="graphics"/>') self.assert_(type(element) is odf_element)
def odf_create_chart_axis_title_style(name, angle): """ Create a basic style for an axis title name - str (name used in chart to use this style) """ s = odf_create_chart_style(name) s.set_auto_position("true") s.set_rotation_angle(angle) s.set_font_size("9pt") return s def odf_create_chart_wall_style(name): """ Create a basic style for a wall name - str (name used in chart to use this style) """ s = odf_create_chart_style(name) s.set_stroke("solid", "#b3b3b3") s.set_fill("none", "#e6e6e6") return s # register register_element_class("style:style", odf_chart_style, family="chart")
manifest.add_full_path(name+'/meta.xml' , "text/xml") return name def attach_chart_to_cell(name_obj, cell): """ create a frame in 'cell' in order to display the chart 'name_obj' name_obj - str cell - odf_cell """ #We need a frame frame = odf_create_frame(size=("10cm", "10cm")) #We need a draw:object element element = odf_create_element("draw:object") element.set_attribute("xlink:href", "./"+name_obj) element.set_attribute("xlink:type", "simple") element.set_attribute("xlink:show", "embed") element.set_attribute("xlink:actuate", "onLoad") frame.append(element) cell.append(frame) return cell #register register_element_class('chart:chart', odf_chart) register_element_class('chart:plot-area', odf_plot_area)
def test_register(self): register_element_class('office:dummy1', self.dummy_element) element = odf_create_element('office:dummy1') self.assert_(type(element) is self.dummy_element)
manifest.add_full_path(name + '/meta.xml', "text/xml") return name def attach_chart_to_cell(name_obj, cell): """ create a frame in 'cell' in order to display the chart 'name_obj' name_obj - str cell - odf_cell """ #We need a frame frame = odf_create_frame(size=("10cm", "10cm")) #We need a draw:object element element = odf_create_element("draw:object") element.set_attribute("xlink:href", "./" + name_obj) element.set_attribute("xlink:type", "simple") element.set_attribute("xlink:show", "embed") element.set_attribute("xlink:actuate", "onLoad") frame.append(element) cell.append(frame) return cell #register register_element_class('chart:chart', odf_chart) register_element_class('chart:plot-area', odf_plot_area)
def odf_create_chart_axis_title_style(name, angle): """ Create a basic style for an axis title name - str (name used in chart to use this style) """ s = odf_create_chart_style(name) s.set_auto_position("true") s.set_rotation_angle(angle) s.set_font_size("9pt") return s def odf_create_chart_wall_style(name): """ Create a basic style for a wall name - str (name used in chart to use this style) """ s = odf_create_chart_style(name) s.set_stroke("solid", "#b3b3b3") s.set_fill("none", "#e6e6e6") return s #register register_element_class('style:style', odf_chart_style, family='chart')