Projects
Kolab:16
libkolabxml
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 26
View file
libkolabxml.spec
Changed
@@ -63,7 +63,7 @@ %else Name: libkolabxml %endif -Version: 1.2.0 +Version: 1.2.1 Release: 1%{?dist} Summary: Kolab XML format collection parser library @@ -658,6 +658,9 @@ %endif %changelog +* Tue Feb 15 2022 Christian Mollekopf <mollekopf@kolabsys.com> - 1.2.1 +- Release of version 1.2.1 + * Tue May 14 2019 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.2.0 - Release of version 1.2.0
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +libkolabxml (1.2.1-0~kolab1) unstable; urgency=low + + * Fix timezone support for timezones with three name elements e.g. America/Indiana/Indianapolis + + -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Thu, 24 Jun 2021 16:38:05 +0200 + libkolabxml (1.2.0-0~kolab11) unstable; urgency=low * Fix building for distributions without plesk-php70-dev
View file
libkolabxml-1.2.0.tar.gz/CMakeLists.txt -> libkolabxml-1.2.1.tar.gz/CMakeLists.txt
Changed
@@ -40,7 +40,7 @@ set (Libkolabxml_VERSION_MAJOR 1) set (Libkolabxml_VERSION_MINOR 2) # Enable the full x.y.z version only for release versions -set (Libkolabxml_VERSION_PATCH 0) +set (Libkolabxml_VERSION_PATCH 1) set (Libkolabxml_VERSION "${Libkolabxml_VERSION_MAJOR}.${Libkolabxml_VERSION_MINOR}.${Libkolabxml_VERSION_PATCH}" ) #set (Libkolabxml_VERSION "${Libkolabxml_VERSION_MAJOR}.${Libkolabxml_VERSION_MINOR}" )
View file
libkolabxml-1.2.0.tar.gz/tests/validationtest.cpp -> libkolabxml-1.2.1.tar.gz/tests/validationtest.cpp
Changed
@@ -121,6 +121,15 @@ QCOMPARE(Kolab::error(), Kolab::Error); } +void ValidationTest::test3PartTimezone() +{ + Event event; + event.setCreated(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC + event.setStart(cDateTime("America/Indiana/Indianapolis",2013,1,1,1,1,1)); + writeEvent(event); + QCOMPARE(Kolab::error(), Kolab::NoError); +} + QTEST_MAIN( ValidationTest )
View file
libkolabxml-1.2.0.tar.gz/tests/validationtest.h -> libkolabxml-1.2.1.tar.gz/tests/validationtest.h
Changed
@@ -32,6 +32,7 @@ void testUTCwithTimezone(); void testTimezoneZ(); void testWindowsTimezone(); + void test3PartTimezone(); }; #endif
View file
libkolabxml-1.2.0.tar.gz/tztable.h -> libkolabxml-1.2.1.tar.gz/tztable.h
Changed
@@ -59,6 +59,19 @@ "America/Anguilla", "America/Antigua", "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", @@ -113,12 +126,22 @@ "America/Halifax", "America/Havana", "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", "America/Indianapolis", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Jujuy", "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", "America/Knox_IN", "America/Kralendijk", "America/La_Paz", @@ -149,6 +172,9 @@ "America/Nipigon", "America/Nome", "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", "America/Ojinaga", "America/Panama", "America/Pangnirtung", @@ -207,19 +233,6 @@ "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", - "Argentina/Buenos_Aires", - "Argentina/Catamarca", - "Argentina/ComodRivadavia", - "Argentina/Cordoba", - "Argentina/Jujuy", - "Argentina/La_Rioja", - "Argentina/Mendoza", - "Argentina/Rio_Gallegos", - "Argentina/Salta", - "Argentina/San_Juan", - "Argentina/San_Luis", - "Argentina/Tucuman", - "Argentina/Ushuaia", "Asia/Aden", "Asia/Almaty", "Asia/Amman", @@ -495,20 +508,10 @@ "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", - "Indiana/Indianapolis", - "Indiana/Knox", - "Indiana/Marengo", - "Indiana/Petersburg", - "Indiana/Tell_City", - "Indiana/Vevay", - "Indiana/Vincennes", - "Indiana/Winamac", "Iran", "Israel", "Jamaica", "Japan", - "Kentucky/Louisville", - "Kentucky/Monticello", "Kwajalein", "Libya", "MET", @@ -520,9 +523,6 @@ "NZ", "NZ-CHAT", "Navajo", - "North_Dakota/Beulah", - "North_Dakota/Center", - "North_Dakota/New_Salem", "PRC", "PST8PDT", "Pacific/Apia",
View file
libkolabxml-1.2.1.tar.gz/utils/kolabformatchecker.py
Added
@@ -0,0 +1,157 @@ +#!/usr/bin/env python + +import argparse +import email +from os import listdir +from os.path import isfile, join, basename +import kolabformat + + + +def check_file(filename, messageType, objectType, verbose): + if filename.endswith(args.fileType): + if verbose: + print("NAME %s" % filename) + + if messageType == 'mime': + f = open(filename, "r") + msg = email.message_from_string(f.read()) + + kolabType = msg.get('X-Kolab-Type') + if not kolabType: + print("Missing kolab type X-Kolab-Type") + elif verbose: + print("Found X-Kolab-Type ", kolabType) + + version = msg.get('X-Kolab-Mime-Version') + if not version: + print("Missing kolab type X-Kolab-Mime-Version") + elif verbose: + print("Found X-Kolab-Mime-Version ", version) + + for part in msg.walk(): + if part.get_content_type() in [ + 'application/calendar+xml', + 'application/vcard+xml', + 'application/vnd.kolab+xml', + 'application/x-vnd.kolab.contact.distlist', + 'application/x-vnd.kolab.contact']: + xml = part.get_payload(decode=True) + try: + xml = xml.decode('utf-8') + except UnicodeDecodeError as err: + print("Failed to decode as utf-8", err, filename, xml) + print() + try: + xml = xml.decode('cp1252') + print("cp1252 fallback worked", err, filename, xml) + except UnicodeDecodeError as err: + print("Failed to decode as cp1252", err, filename, xml) + print() + # Final fallback, just replace the characters we fail to decode + xml = xml.decode('utf-8', "replace") + + if verbose: + print("Content type of part is ", part.get_content_type()) + print("Filename of part is ", part.get_filename()) + print("Found xml \n%s" % xml) + + isPath = False + else: + xml = filename + isPath = True + + if objectType == 'auto': + if kolabType is None: + raise Exception("Failed to detect the object type") + elif 'event' in kolabType: + objectType = 'event' + elif 'todo' in kolabType: + objectType = 'todo' + elif 'contact' in kolabType: + objectType = 'contact' + elif 'note' in kolabType: + objectType = 'note' + elif 'journal' in kolabType: + objectType = 'journal' + elif 'configuration' in kolabType: + objectType = 'configuration' + else: + raise Exception("Invalid object type") + + + if objectType == 'event': + kolabObject = kolabformat.readEvent(xml, isPath) + if verbose: + print("Event uid is: %s" % kolabObject.uid()) + print("Event is valid: %s" % kolabObject.isValid()) + print("Event start_date is valid: %s" % kolabObject.start().isValid()) + print("Event end_date is valid: %s" % kolabObject.end().isValid()) + print("Event URL is: %s" % kolabObject.url()) + print("Event summary is: %s" % kolabObject.summary()) + print("Event description is: %s" % kolabObject.description()) + print("Event comment is: %s" % kolabObject.comment()) + elif objectType == 'todo': + kolabObject = kolabformat.readTodo(xml, isPath) + elif objectType == 'contact': + kolabObject = kolabformat.readContact(xml, isPath) + elif objectType == 'journal': + kolabObject = kolabformat.readJournal(xml, isPath) + elif objectType == 'distlist': + kolabObject = kolabformat.readDistlist(xml, isPath) + elif objectType == 'note': + kolabObject = kolabformat.readNote(xml, isPath) + elif objectType == 'configuration': + kolabObject = kolabformat.readConfiguration(xml, isPath) + elif objectType == 'file': + kolabObject = kolabformat.readFile(xml, isPath) + else: + print("Unknown object type", objectType, filename) + raise Exception("Unknown object type") + + if kolabformat.error(): + raise Exception(kolabformat.errorMessage()) + + print("Successfully parsed file %s with kolab object %s" % + (basename(filename), kolabObject.uid()) + ) + + +parser = argparse.ArgumentParser(description='Check kolab xml objects.') + +parser.add_argument('--messagetype', '-m', + dest='messageType', + choices=['xml', 'mime'], + required=True, + help='The type of the object to parse') +parser.add_argument('--kolabtype', '-k', + dest='kolabType', + choices=['event', 'todo', 'contact', 'journal', 'distlist', 'note', 'configuration', 'file', 'auto'], + required=True, + help='The type of the object to parse ("auto" only for mime messages)') +parser.add_argument('--verbose', '-v', + dest='verbose', + default=False, + action='store_true', + help='Verbose output') +parser.add_argument('-p', '--path', + dest='path', + required=True, + help='The file to read') +parser.add_argument('-f', '--filetype', + dest='fileType', + default='', + help='Pattern for file name/type matching in directory') + +args = parser.parse_args() + +if isfile(args.path): + filenames = [args.path] +else: + filenames = [join(args.path, fn) for fn in listdir(args.path)] + +for filename in filenames: + try: + check_file(filename, args.messageType, args.kolabType, args.verbose) + except Exception as e: + print("There was an error while parsing ", e, filename)
View file
libkolabxml-1.2.0.tar.gz/utils/zonetabconversion.py -> libkolabxml-1.2.1.tar.gz/utils/zonetabconversion.py
Changed
@@ -2,10 +2,10 @@ import os - timezones = [] +directory = '/usr/share/zoneinfo/' -for root, directories, filenames in os.walk('/usr/share/zoneinfo/'): +for root, directories, filenames in os.walk(directory): for filename in filenames: if filename.endswith('.tab'): continue @@ -19,13 +19,15 @@ if filename == 'posixrules': continue - if os.path.basename(root) == "posix": + zone = os.path.join(root[len(directory):], filename) + + if zone.startswith("posix/"): continue - if os.path.basename(root) == "right": + if zone.startswith("right/"): continue - timezones.append(os.path.join(os.path.basename(root), filename)) + timezones.append(zone) timezones = sorted(list(set(timezones)))
View file
libkolabxml.dsc
Changed
@@ -2,7 +2,7 @@ Source: libkolabxml Binary: libkolabxml1v5, php-kolabformat, python-kolabformat, libkolabxml-dev Architecture: any -Version: 1.2.0-0~kolab11 +Version: 1.2.1-0~kolab1 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://git.kolab.org/libkolabxml @@ -34,5 +34,5 @@ php-kolabformat deb libs optional python-kolabformat deb python optional Files: - 00000000000000000000000000000000 0 libkolabxml-1.2.0.tar.gz + 00000000000000000000000000000000 0 libkolabxml-1.2.1.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.