diff --git a/test_files/simple_2_0_test.ics b/test_files/simple_2_0_test.ics index 9e50610..badd055 100644 --- a/test_files/simple_2_0_test.ics +++ b/test_files/simple_2_0_test.ics @@ -1,6 +1,6 @@ BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//PYVOBJECT//NONSGML Version 1//EN +PRODID:-//PYVOBJECT//NONSGML Version %s//EN BEGIN:VEVENT UID:Not very random UID DTSTART:20060509T000000 diff --git a/tests.py b/tests.py index 1991b9a..8b6deb4 100644 --- a/tests.py +++ b/tests.py @@ -12,7 +12,7 @@ from dateutil.tz import tzutc from dateutil.rrule import rrule, rruleset, WEEKLY, MONTHLY -from vobject import base, iCalendar +from vobject import VERSION, base, iCalendar from vobject import icalendar from vobject.base import __behaviorRegistry as behavior_registry @@ -56,7 +56,7 @@ def test_scratchbuild(self): """ CreateCalendar 2.0 format from scratch """ - test_cal = get_test_file("simple_2_0_test.ics") + test_cal = get_test_file("simple_2_0_test.ics") % VERSION cal = base.newFromBehavior('vcalendar', '2.0') cal.add('vevent') cal.vevent.add('dtstart').value = datetime.datetime(2006, 5, 9) diff --git a/vobject/__init__.py b/vobject/__init__.py index 6f5e28b..8a8f28d 100644 --- a/vobject/__init__.py +++ b/vobject/__init__.py @@ -76,12 +76,12 @@ """ -from .base import newFromBehavior, readOne, readComponents +from .base import VERSION, newFromBehavior, readOne, readComponents from . import icalendar, vcard # Package version -__version__ = VERSION = "1.0.0" +__version__ = VERSION def iCalendar(): diff --git a/vobject/base.py b/vobject/base.py index 83239bd..93077ee 100644 --- a/vobject/base.py +++ b/vobject/base.py @@ -9,6 +9,10 @@ import six import sys +# Package version +VERSION = "1.0.0" + + # ------------------------------------ Python 2/3 compatibility challenges ---- # Python 3 no longer has a basestring type, so.... try: diff --git a/vobject/icalendar.py b/vobject/icalendar.py index e12f2dd..dcabafc 100644 --- a/vobject/icalendar.py +++ b/vobject/icalendar.py @@ -29,7 +29,7 @@ class NonExistentTimeError(Exception): pytz = Pytz # keeps quantifiedcode happy from . import behavior -from .base import (VObjectError, NativeError, ValidateError, ParseError, +from .base import (VERSION, VObjectError, NativeError, ValidateError, ParseError, Component, ContentLine, logger, registerBehavior, backslashEscape, foldOneLine) @@ -38,7 +38,7 @@ class NonExistentTimeError(Exception): DATENAMES = ("rdate", "exdate") RULENAMES = ("exrule", "rrule") DATESANDRULES = ("exrule", "rrule", "rdate", "exdate") -PRODID = u"-//PYVOBJECT//NONSGML Version 1//EN" +PRODID = u"-//PYVOBJECT//NONSGML Version %s//EN" % VERSION WEEKDAYS = "MO", "TU", "WE", "TH", "FR", "SA", "SU" FREQUENCIES = ('YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY',