Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few improvements when integrating with DavMail #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mistotebe
Copy link

First commit allows using proxies natively.
Second actually sends a valid request when PROPFINDing the addressbook data.

@untitaker
Copy link
Contributor

The issue with PROPFIND is likely fixed with #92.

@untitaker
Copy link
Contributor

You can achieve proxy support by setting environment variables: http://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies

But i am not sure why you'd need proxy support for DavMail. I ran it locally and just had to point the client against a local URL.

@mistotebe
Copy link
Author

The proxy support was helpful when trying to find out what was going wrong, going through an intercepting proxy like mitmproxy, but I believe it is useful nevertheless, which is why I included it here.

By issue #92, do you mean pycarddav being replaced by vdirsyncer? At the moment, I also use pycarddav as a library, is there a way to do that with vdirsyncer?

@untitaker
Copy link
Contributor

By issue #92, do you mean pycarddav being replaced by vdirsyncer?

Not really. Vdirsyncer is just the synchronization part. It stores contacts e.g. in a directory of .vcf files. There are already a few apps with functionality equivalent to pycarddav: https://vdirsyncer.readthedocs.org/en/latest/supported.html#client-applications

At the moment, I also use pycarddav as a library, is there a way to do that with vdirsyncer?

You can use vdirsyncer as a library, but as it's not an exact replacement, you'll have to see if the particular feature implementation you want to use is actually within its scope. I suppose you want to take a look at the CarddavStorage class in https://github.com/untitaker/vdirsyncer/blob/master/vdirsyncer/storage/dav.py

@geier
Copy link
Owner

geier commented Dec 2, 2014

Hi, sorry for not getting back to you on this sooner.

First let me thank you for this pull request: thanks!

Second, it does not currently work for me, I get this error:

Traceback (most recent call last):
  File "/home/cg/.virtualenvs/khal/bin/pycardsyncer", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/cg/workspace/pycarddav/bin/pycardsyncer", line 55, in <module>
    sync(conf)
  File "/home/cg/workspace/pycarddav/pycarddav/controllers/sync.py", line 50, in sync
    abook = syncer.get_abook()  # type(abook): dict
  File "/home/cg/workspace/pycarddav/pycarddav/carddav.py", line 134, in get_abook
    abook = self._process_xml_props(xml)
  File "/home/cg/workspace/pycarddav/pycarddav/carddav.py", line 278, in _process_xml_props
    props.text.split(';')[0].strip() in ['text/vcard', 'text/x-vcard']):
AttributeError: 'NoneType' object has no attribute 'split'

If you fix this, I'll merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants