Пример #1
0
from simpleodspy.sodsspreadsheet import SodsSpreadSheet

t = SodsSpreadSheet(10, 10)

print("Test spreadsheet naming:")
print("-----------------------")

# setting values and formulas
t.setValue("A1", "Hello world !")

t.setValue("B2:C2", 123.4)
t.setValue("B3", "=B2+3")
t.setValue("B4", "=sum(B2:B3)")

# cell styles
t.setStyle("A1", color="#0000ff")
t.setStyle("A1:A5", background_color="#00ff00")
t.setStyle("B1:B5",
           border_left="1pt solid #ff0000",
           background_color="#ffff00")

# conditional styles
t.setStyle("B1:B5", condition="cell-content()<=125")
t.setStyle("B1:B5", condition_color="#ff0000")

# export
from simpleodspy.sodsxml import SodsXml

tw = SodsXml(t)
tw.save("test.xml")
Пример #2
0
        str_columnName = chr(65 + int_modulo) + str_columnName
        int_dividend = (int_dividend - int_modulo) / 26
    return str_columnName


Sods_table = SodsSpreadSheet(len(LILI_TABLE) + 1, len(LILI_TABLE[0]) + 1)

rowsOutput = 0
for rowIndex in range(len(LILI_TABLE)):
    rowsOutput = rowsOutput + 1
    for colIndex in range(len(LILI_TABLE[rowIndex])):
        str_coordinate = GetColumnName(colIndex + 1) + str(
            rowIndex + 1)  #Spreadsheet is not 0 based.
        Sods_table.setValue(str_coordinate,
                            str(LILI_TABLE[rowIndex][colIndex]))
        if LILI_TABLE[rowIndex][colIndex] == "aa":
            Sods_table.setStyle(str_coordinate, background_color="#33ff33")
        elif LILI_TABLE[rowIndex][colIndex] == "bb":
            Sods_table.setStyle(str_coordinate, background_color="#3399ff")
        elif LILI_TABLE[rowIndex][colIndex] == "ab":
            Sods_table.setStyle(str_coordinate, background_color="#00ffff")

if bool_keepSDCO == False:
    str_outFile = (str_vcfName.split(".")[0]) + "_noSDCO.ods"
else:
    str_outFile = (str_vcfName.split(".")[0]) + ".ods"

sys.stderr.write("Outputting %s markers to .ods\n" % str(rowsOutput - 1))
Sods_ods = SodsOds(Sods_table)
Sods_ods.save(str_outFile)
Пример #3
0
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# Copyright (C) 2010 Yaacov Zamir (2010) <*****@*****.**>
# Author: Yaacov Zamir (2010) <*****@*****.**>

from simpleodspy.sodsspreadsheet import SodsSpreadSheet
from simpleodspy.sodshtml import SodsHtml

t = SodsSpreadSheet()

t.setValue("A1:A3", "green")
t.setStyle("A1:A3", background_color="#00ff00")
t.setValue("B1:B3", "blue")
t.setStyle("B1:B3", background_color="#0000ff")
t.setStyle("B3", border_top="1pt solid #ff0000", border_bottom="1pt solid #ff0000")

tw = SodsHtml(t)
tw.save("test.html")
Пример #4
0
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# Copyright (C) 2010 Yaacov Zamir (2010) <*****@*****.**>
# Author: Yaacov Zamir (2010) <*****@*****.**>

from simpleodspy.sodsspreadsheet import SodsSpreadSheet
from simpleodspy.sodshtml import SodsHtml
 
t = SodsSpreadSheet()
 
t.setValue("A1:A3", "green")
t.setStyle("A1:A3", background_color = "#00ff00")
t.setValue("B1:B3", "blue")
t.setStyle("B1:B3", background_color = "#0000ff")
t.setStyle("B3", border_top = "1pt solid #ff0000", border_bottom = "1pt solid #ff0000")
 
tw = SodsHtml(t)
tw.save("test.html")

Пример #5
0
from simpleodspy.sodsspreadsheet import SodsSpreadSheet

t = SodsSpreadSheet(10, 10)
	
print("Test spreadsheet naming:")
print("-----------------------")

# setting values and formulas
t.setValue("A1", "Hello world !")

t.setValue("B2:C2", 123.4)
t.setValue("B3", "=B2+3")
t.setValue("B4", "=sum(B2:B3)")

# cell styles
t.setStyle("A1", color = "#0000ff")
t.setStyle("A1:A5", background_color = "#00ff00")
t.setStyle("B1:B5", border_left = "1pt solid #ff0000", background_color = "#ffff00")

# conditional styles
t.setStyle("B1:B5", condition = "cell-content()<=125")
t.setStyle("B1:B5", condition_color = "#ff0000")

# export
from simpleodspy.sodsxml import SodsXml
tw = SodsXml(t)
tw.save("test.xml")

# import
t2 = SodsSpreadSheet(10, 10)
tw = SodsXml(t2)
Пример #6
0
                            "        {0}".format(appointment_other.start.strftime("%d.%m.")))
            course_other_dates_str = ""
            if len(course_other_dates) > 0:
                course_other_dates_str = "; auch " + ", ".join(course_other_dates)
            print_cell(spreadsheet_timetable, course_row_start, weekday_column + 1, ", ".join(course_rooms))
            print_cell(spreadsheet_timetable, course_row_start + 2, weekday_column, ", ".join(course_dates) + course_other_dates_str)
        block_row_start += block_height[block] * appointment_height


# set borders on timetable

# first the horizontal ones
block_row_start = row_start + 1
timetable_last_row = sum(block_height.values()) * appointment_height + block_row_start
for row in range(block_row_start, timetable_last_row, 3):
    spreadsheet_timetable.setStyle("{0}:{1}".format(cell_coordinate(row, column_start+1), cell_coordinate(row, 5*appointment_width + column_start)), border_top=block_separator_appointments)

# print first column: block numbers
current_row = row_start + 1
for block in range(1, 9):
    spreadsheet_timetable.setStyle("{0}:{1}".format(cell_coordinate(current_row, column_start+1), cell_coordinate(current_row, 5*appointment_width + column_start)), border_top=block_separator_border)
    current_row += block_height[block] * appointment_height

# now the vertical ones
# no border right of Friday
for weekday in range(1, 5):
    weekday_column = column_start + 1 + (weekday-1) * appointment_width + 1
    spreadsheet_timetable.setStyle("{0}:{1}".format(cell_coordinate(row_start, weekday_column), cell_coordinate(timetable_last_row - 1, weekday_column)), border_right=block_separator_border)

print("Für die folgenden {0} Veranstaltungen wurde kein Termin im gewählten Zeitfenster gefunden:".format(len(courses_missed.values())))
if not courses_missed: