some fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
import datetime
|
import datetime
|
||||||
import httplib
|
import http.client as httplib
|
||||||
import re
|
import re
|
||||||
class FeiertageApi(object):
|
class FeiertageApi(object):
|
||||||
def __init__(self, jahr, nur_land):
|
def __init__(self, jahr, nur_land):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
import datetime
|
import datetime
|
||||||
import httplib
|
import http.client as httplib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class FerienApi(object):
|
class FerienApi(object):
|
||||||
@@ -23,7 +23,10 @@ class FerienApi(object):
|
|||||||
return self.__format(json.loads(body))
|
return self.__format(json.loads(body))
|
||||||
|
|
||||||
def __convert_date(self, strDate):
|
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))
|
return "{}-{}-{}".format(m.group(1), m.group(2), m.group(3))
|
||||||
|
|
||||||
def __format(self, data):
|
def __format(self, data):
|
||||||
@@ -47,5 +50,5 @@ class FerienApi(object):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
api = FerienApi(2021, "BY")
|
api = FerienApi(2023, "BY")
|
||||||
print(json.dumps(api.get(), indent=4))
|
print(json.dumps(api.get(), indent=4))
|
||||||
|
|||||||
@@ -200,7 +200,8 @@ class UserDefinedObjects(CalendarObject):
|
|||||||
scribus.copyObject(obj)
|
scribus.copyObject(obj)
|
||||||
scribus.gotoPage(currentPage)
|
scribus.gotoPage(currentPage)
|
||||||
scribus.setActiveLayer(layerName)
|
scribus.setActiveLayer(layerName)
|
||||||
scribus.pasteObject(obj)
|
#scribus.pasteObject(obj)
|
||||||
|
scribus.pasteObject()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -189,13 +189,14 @@ class MonthlyGrid(MonthlyCalendarObject):
|
|||||||
|
|
||||||
|
|
||||||
def initSubObjects(self):
|
def initSubObjects(self):
|
||||||
if type(self.weekDayClass) == unicode :
|
if type(self.weekDayClass) == str :
|
||||||
|
print(type(self.weekDayClass))
|
||||||
self.weekDayClass = class_from_name(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)
|
self.dayClass = class_from_name(self.dayClass)
|
||||||
|
|
||||||
if type(self.calendarWeekClass) == unicode:
|
if type(self.calendarWeekClass) == str:
|
||||||
self.calendarWeekClass = class_from_name(self.calendarWeekClass)
|
self.calendarWeekClass = class_from_name(self.calendarWeekClass)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user