tbaxter / vobject Goto Github PK
View Code? Open in Web Editor NEWThis project forked from adieu/vobject
Git clone of the official vobject project
Home Page: http://vobject.skyhouseconsulting.com/
This project forked from adieu/vobject
Git clone of the official vobject project
Home Page: http://vobject.skyhouseconsulting.com/
python2 requires the following patch to work (I guess this is -- at least partly -- in pull request #6):
--- vobject/__init__.py.orig 2015-08-26 15:03:18.000000000 +0200 +++ vobject/__init__.py 2015-08-26 15:00:01.000000000 +0200 @@ -76,6 +76,7 @@ """ +import base, icalendar, vcard from .base import newFromBehavior, readOne, readComponents
It seems that your version of vobject breaks both pycarddav and khard. It might be ok, but I just wanted to let you know. Upstream issues are lucc/khard#30 and geier/pycarddav#119
It would be nice to have this published on pypi.
I don't really care about the name. Other projects can't move to python3 because of vobject not supporting it.
divio/aldryn-people#28
Would you mind if I make a pull request for a whole pep8 formatting on your fork ?
It will be important change as original code base is really old and have it's own code style.
It's not so important of course, but it will make my linter feel really less stressed ;)
I have also idea to had more testing around vcard parsing features (2.1, 3.0, 4.0) has it's currently my focus (I do not have current usage of ical). That will be another PR than a formatting one, of course.
And may thanks for your work. I can't find a better vcard package in python world except this old vobject one that disappear from pypi, and as py3 is mandatory for me, it fit perfectly when I found your work.
Haha, finally!
I tried to use your fork of vobject, because it supports python3. Actually, it supports python3 pretty well.
I've still noticed one little difference between the behaviour of vobject for python2 and yours.
I'm using this vobject as a dependance for caldav, which is supposed to support python3. But the DTSTART field is a datetime on python2 and only a string representing it on python3. I have this little test code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import caldav
url = 'https://username:[email protected]/'
davclient = caldav.DAVClient(url)
print('davclient', type(davclient))
calendar = davclient.principal().calendars()[0]
print('calendar', type(calendar))
event = calendar.events()[0]
print('event', type(event))
print('event.instance', type(event.instance))
print('event.instance.vevent', type(event.instance.vevent))
print('event.instance.vevent.dtstart', type(event.instance.vevent.dtstart))
print('event.instance.vevent.dtstart.value', type(event.instance.vevent.dtstart.value))
print('event.instance.vevent.dtstart.value', event.instance.vevent.dtstart.valueRepr)
On python2, this outputs:
(u'davclient', <type 'instance'>)
(u'calendar', <class 'caldav.objects.Calendar'>)
(u'event', <class 'caldav.objects.Event'>)
(u'event.instance', <class 'vobject.base.Component'>)
(u'event.instance.vevent', <class 'vobject.icalendar.RecurringComponent'>)
(u'event.instance.vevent.dtstart', <class 'vobject.base.ContentLine'>)
(u'event.instance.vevent.dtstart.value', <type 'datetime.date'>)
(u'event.instance.vevent.dtstart.value', datetime.date(2015, 4, 28))
and on python3:
davclient <class 'caldav.davclient.DAVClient'>
calendar <class 'caldav.objects.Calendar'>
event <class 'caldav.objects.Event'>
event.instance <class 'vobject.base.Component'>
event.instance.vevent <class 'vobject.base.Component'>
event.instance.vevent.dtstart <class 'vobject.base.ContentLine'>
event.instance.vevent.dtstart.value <class 'str'>
event.instance.vevent.dtstart.value 20150505
Note: this script supposes that you have calendars, and that none of them is empty. It can fail otherwise.
Here are my (shortened) pipN show vobject
:
pip2 show vobject
---
Version: 0.6.6
Author: Jeffrey Harris
pip3 show vobject
---
Version: 0.8.2
Author: Jeffrey Harris, Tim Baxter
Sorry, that's a lot of code. I'll try to be as available as possible.
Non-related question: is this repo intended to become the reference for vobject for python3?
Do you really need dateutil to be at exactly 2.4.0 or can it be a little different? My distribution and pypi have 2.4.2.
I'm trying to package your vobject in my distribution (nix). However, the default handling of python packages fails with the error below. Your setup.py
references a test_vobject
module that can't be found.
running build_ext
Traceback (most recent call last):
File "setup.py", line 73, in <module>
Topic :: Text Processing""".strip().splitlines()
File "python3.4-distutils.cfg/lib/python3.4/site-packages/distutils/core.py", line 148, in setup
dist.run_commands()
File "python3.4-distutils.cfg/lib/python3.4/site-packages/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "python3.4-distutils.cfg/lib/python3.4/site-packages/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setuptools-18.2/lib/python3.4/site-packages/setuptools-18.2-py3.4.egg/setuptools/command/test.py", line 142, in run
self.with_project_on_sys_path(self.run_tests)
File "setuptools-18.2/lib/python3.4/site-packages/setuptools-18.2-py3.4.egg/setuptools/command/test.py", line 122, in with_project_on_sys_path
func()
File "setuptools-18.2/lib/python3.4/site-packages/setuptools-18.2-py3.4.egg/setuptools/command/test.py", line 163, in run_tests
testRunner=self._resolve_as_ep(self.test_runner),
File "python3-3.4.3/lib/python3.4/unittest/main.py", line 92, in __init__
self.parseArgs(argv)
File "python3-3.4.3/lib/python3.4/unittest/main.py", line 139, in parseArgs
self.createTests()
File "python3-3.4.3/lib/python3.4/unittest/main.py", line 146, in createTests
self.module)
File "python3-3.4.3/lib/python3.4/unittest/loader.py", line 146, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "python3-3.4.3/lib/python3.4/unittest/loader.py", line 146, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "python3-3.4.3/lib/python3.4/unittest/loader.py", line 105, in loadTestsFromName
module = __import__('.'.join(parts_copy))
ImportError: No module named 'test_vobject'
builder for ‘/nix/store/xyj0gb5yczw89w5gi7rhhqfd0vlhfrrz-python3.4-vobject-0.8.3.drv’ failed with exit code 1
If I create two files with slightly overlapping series of events:
foo: a b c
bar: b c d
(where a b c d are events in chronologically increasing order)
and then "ics_diff foo bar" and "ics_diff bar foo" show different number of changes.
This seems to be because processComponentLists doesn't process the end of rightList once leftList is processed (leaving some events unaccounted for)
The version on pypi is 0.8.1: https://pypi.python.org/pypi/vobject
The repo has only 1 tag: 0.8.3: https://github.com/tBaxter/vobject/releases
The version in the setup.py is 0.8.5: https://github.com/tBaxter/vobject/blob/master/setup.py#L50
So looking at this it seems a few releases have been made but only one got tagged. Would it be possible to tag them and push them to github?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.