Giter VIP home page Giter VIP logo

vobject's People

Contributors

adieu avatar doismellburning avatar hadleyrich avatar sdiemer avatar tbaxter avatar tobixen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vobject's Issues

python2: vobject.base.VObjectError: 'No behavior found named VCALENDAR'

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

About pep8 and more testing ?

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.

dtstart is a datetime on vobject for python2 but a string on your vobject for python3

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?

setup.py fails

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

"ics_diff foo bar" and "ics_diff bar foo" can show different number of changes

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.