def test_ooo4_calc(self): """ Тестирование генерации xml для OpenOffice.org Calc. """ import icexcel app = icexcel.icVExcel() work_book = app.getActiveWorkbook() work_sheet = work_book.createWorksheet() table = work_sheet.createTable() new_range = work_sheet.getRange(3, 1, 3, 3) new_range.setBorderOn(border_left={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_top={ 'LineStyle': 'Continuous', 'Weight': 2 }, border_right={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_bottom={ 'LineStyle': 'Continuous', 'Weight': 2 }) app.SaveAs(self.test_path + '/testfiles/ooo4.xml')
def test_oc1(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/OC1/OC1.ods') excel.SaveAs('./testfiles/OC1/result_oc1.xml') excel.SaveAs('./testfiles/OC1/result_oc1.ods')
def test_11(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/tabbnew.ods') # excel.SaveAs('./testfiles/tabbnew_result.ods') excel.SaveAs('./testfiles/tabbnew_result.xml')
def test_merge(self): """ Тестирование поддержки объединенных ячеек. """ import icexcel app = icexcel.icVExcel() app.Load(self.test_path + '/testfiles/merge0.xml') app.SaveAs(self.test_path + '/testfiles/merge_ok.xml')
def test_ods(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/ods/schm_19.ods') excel.SaveAs('./testfiles/ods/result.ods') cmd = 'libreoffice ./testfiles/ods/result.ods' os.system(cmd)
def test_report(): import icexcel excel = icexcel.icVExcel() excel.Load('/home/xhermit/.icreport/rep_tmpl_report_result.xml') excel.SaveAs('/home/xhermit/.icreport/rep_tmpl_report_result.ods') cmd = 'libreoffice /home/xhermit/.icreport/rep_tmpl_report_result.ods' os.system(cmd)
def test_sum(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/test.ods') excel.SaveAs('./testfiles/test_result.ods') # excel.SaveAs('./testfiles/test_result.xml') cmd = 'soffice ./testfiles/test_result.ods' # cmd='soffice ./testfiles/test_result.xml' os.system(cmd)
def test_1(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/test.ods') excel.setCellValue('Лист1', 10, 9, 1.99) excel.setCellValue('Лист1', 11, 9, '=SUM(I8:I10)') excel.SaveAs('./testfiles/test_result.ods') excel.SaveAs('./testfiles/test_result.xml')
def test_7(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/tabmilk.ods') excel.SaveAs('./testfiles/tabmilk_result.ods') cmd = 'soffice ./testfiles/tabmilk.ods' os.system(cmd) cmd = 'soffice ./testfiles/tabmilk_result.ods' os.system(cmd)
def test_10(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/new/narjadpv.ods') excel.SaveAs('./testfiles/new/narjadpv_result.ods') excel.SaveAs('./testfiles/new/narjadpv_result.xml') cmd = 'soffice ./testfiles/new/narjadpv.ods' os.system(cmd) cmd = 'soffice ./testfiles/new/narjadpv_result.ods' os.system(cmd)
def test_19(): if os.path.exists('./log/virtual_excel.log'): os.remove('./log/virtual_excel.log') import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/oc1.ods') excel.SaveAs('./testfiles/oc1_test.ods') cmd = 'libreoffice ./testfiles/oc1_test.ods' os.system(cmd)
def test_worksheet_options(): import icexcel # if os.path.exists('./log/virtual_excel.log'): # os.remove('./log/virtual_excel.log') excel = icexcel.icVExcel() excel.Load('./testfiles/month_params_report.ods') excel.SaveAs('./testfiles/ods/result.ods') cmd = 'libreoffice ./testfiles/ods/result.ods' os.system(cmd)
def test_ooo2_calc(self): """ Тестирование генерации xml для OpenOffice.org Calc. """ import icexcel app = icexcel.icVExcel() work_book = app.getActiveWorkbook() work_sheet = work_book.createWorksheet() table = work_sheet.createTable() new_range = work_sheet.getRange(1, 1, 3, 2) new_range.setValues([[11.2, '222'], [333, 333.2], ['444', '5555']]) app.SaveAs(self.test_path + '/testfiles/ooo2.xml')
def test_hello_word(self): """ Тестирование генерации xml для OpenOffice.org Calc. """ import icexcel app = icexcel.icVExcel() work_book = app.getActiveWorkbook() work_sheet = work_book.createWorksheet() table = work_sheet.createTable() cell = table.createCell(3, 3) cell.setValue('Привет') app.SaveAs(self.test_path + '/testfiles/ooo1.xml')
def test_15(): if os.path.exists('./log/virtual_excel.log'): os.remove('./log/virtual_excel.log') import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/ttn/ttn_original.ods') # excel.Load('./testfiles/ttn/ttn.xml') excel.SaveAs('./testfiles/ttn/ttn_result.ods') excel.SaveAs('./testfiles/ttn/ttn_result.xml') cmd = 'libreoffice ./testfiles/ttn/ttn_result.ods' os.system(cmd)
def test_12(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/test.ods') excel.setCellValue('Лист1', 10, 9, 1.99) excel.setCellValue('Лист1', 11, 9, '=SUM(I8:I10)') excel.SaveAs('./testfiles/test_result.ods') excel.SaveAs('./testfiles/test_result.xml') cmd = 'soffice ./testfiles/test_result.ods' # cmd='soffice ./testfiles/test_result.xml' os.system(cmd)
def test_5(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/narjad.ods') excel.setCellValue('Сдельн.', 19, 13, 1.99) excel.SaveAs('./testfiles/narjad_result.ods') excel.SaveAs('./testfiles/narjad_result.xml') # cmd='soffice ./testfiles/narjad.ods' # os.system(cmd) cmd = 'soffice ./testfiles/narjad_result.ods' os.system(cmd)
def test_ooo5_hidden(self): """ Тестирование генерации xml для OpenOffice.org Calc. """ import icexcel app = icexcel.icVExcel() app.Load(self.test_path + '/testfiles/example.xml') work_book = app.getActiveWorkbook() work_sheet = work_book.findWorksheet('Worksheet1') cell = work_sheet.getCell(3, 3) cell.setValue('Привет') app.SaveAs(self.test_path + '/testfiles/ooo5.xml')
def test_ooo3_calc(self): """ Тестирование генерации xml для OpenOffice.org Calc. """ import icexcel app = icexcel.icVExcel() work_book = app.getActiveWorkbook() work_sheet = work_book.createWorksheet() table = work_sheet.createTable() new_range = work_sheet.getRange(1, 1, 3, 2) new_range.setValues([[11.2, '222'], [333, 333.2], ['444', '5555']]) new_range = work_sheet.getRange(1, 1, 2, 2) new_range.setStyle(font={ 'Bold': 1, 'Size': 16, 'Italic': 1 }, interior={'Color': '#00FF00'}) app.SaveAs(self.test_path + '/testfiles/ooo3.xml')
def test_schm19(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/schm/19.ods') excel.SaveAs('./testfiles/schm/result_19.xml')
def test_4(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/bpr1137.ods') excel.SaveAs('./testfiles/bpr1137_result.ods')
def test_all(self): """ Тестирование генерации XML. """ import icexcel app = icexcel.icVExcel() app.Load(self.test_path + '/testfiles/example.xml') work_book = app.getActiveWorkbook() work_sheet = work_book.findWorksheet('Worksheet1') table = work_sheet.getTable() cell = table.getCell(5, 5) cell.setValue('Yea') cell = table.getCell(3, 3) cell.setValue('Привет') row = table.getRow(3) cell = row.createCellIdx(2) cell.setValue('Проба') new_range = work_sheet.getRange(1, 1, 3, 2) new_range.setValues([[11.2, '222'], [333, 333.2], ['444', '5555']]) new_range = work_sheet.getRange(1, 1, 2, 2) new_range.setStyle(font={ 'Bold': 1, 'Size': 16, 'Italic': 1 }, interior={'Color': '#00FF00'}) # Проверка обрамления new_range = work_sheet.getRange(3, 3, 4, 5) new_range.setBorderOn(border_left={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_top={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_right={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_bottom={ 'LineStyle': 'Continuous', 'Weight': 1 }) new_range.updateStyle(font={ 'Bold': 1, 'Size': 14, 'Italic': 1 }, style_auto_create=True) new_range = work_sheet.getRange(10, 1, 1, 6) new_range.setBorderOn(border_left={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_top={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_right={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_bottom={ 'LineStyle': 'Continuous', 'Weight': 1 }) new_range = work_sheet.getRange(1, 10, 10, 1) new_range.setBorderOn(border_left={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_top={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_right={ 'LineStyle': 'Continuous', 'Weight': 1 }, border_bottom={ 'LineStyle': 'Continuous', 'Weight': 1 }) styles = work_book.getStyles() id1 = styles.createStyle().get_attributes()['ID'] id2 = styles.createStyle().get_attributes()['ID'] ids = styles.clearUnUsedStyles() app.SaveAs(self.test_path + '/testfiles/result.xml') app.Load(self.test_path + '/testfiles/result.xml') app.SaveAs(self.test_path + '/testfiles/result_ok.xml')
def test_3(): import icexcel excel = icexcel.icVExcel() excel.Load('./testfiles/test3.ods') excel.SaveAs('./testfiles/result_test3.ods')