some fixes

This commit is contained in:
2022-12-17 00:35:20 +01:00
parent 369b3655da
commit 4c0859480a
5 changed files with 15 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import copy
import json
import datetime
import httplib
import http.client as httplib
import re
class FeiertageApi(object):
def __init__(self, jahr, nur_land):

View File

@@ -1,7 +1,7 @@
import copy
import json
import datetime
import httplib
import http.client as httplib
import re
class FerienApi(object):
@@ -23,7 +23,10 @@ class FerienApi(object):
return self.__format(json.loads(body))
def __convert_date(self, strDate):
m = re.match(r'^([0-9]{4})-([0-9]{2})-([0-9]{2})T.+Z$', strDate)
m = re.match(r'^([0-9]{4})-([0-9]{2})-([0-9]{2}).*$', strDate)
if m is None:
print(strDate)
return "{}-{}-{}".format(m.group(1), m.group(2), m.group(3))
def __format(self, data):
@@ -47,5 +50,5 @@ class FerienApi(object):
if __name__ == "__main__":
api = FerienApi(2021, "BY")
print(json.dumps(api.get(), indent=4))
api = FerienApi(2023, "BY")
print(json.dumps(api.get(), indent=4))

View File

@@ -200,7 +200,8 @@ class UserDefinedObjects(CalendarObject):
scribus.copyObject(obj)
scribus.gotoPage(currentPage)
scribus.setActiveLayer(layerName)
scribus.pasteObject(obj)
#scribus.pasteObject(obj)
scribus.pasteObject()

View File

@@ -189,13 +189,14 @@ class MonthlyGrid(MonthlyCalendarObject):
def initSubObjects(self):
if type(self.weekDayClass) == unicode :
if type(self.weekDayClass) == str :
print(type(self.weekDayClass))
self.weekDayClass = class_from_name(self.weekDayClass)
if type(self.dayClass) == unicode:
if type(self.dayClass) == str:
self.dayClass = class_from_name(self.dayClass)
if type(self.calendarWeekClass) == unicode:
if type(self.calendarWeekClass) == str:
self.calendarWeekClass = class_from_name(self.calendarWeekClass)

View File

@@ -1,6 +1,6 @@
{
"settings": {
"year": 2021,
"year": 2023,
"bundesland": "BY",
"calendarClass": "MonthlyCalendar",
"numMonths": 12