This commit is contained in:
Markus Unterwaditzer 2014-03-28 21:44:43 +01:00
parent 1ff6469767
commit 762a3b219b
3 changed files with 7 additions and 5 deletions

View file

@ -104,7 +104,8 @@ class StorageTests(object):
# Create collections on-the-fly for most storages # Create collections on-the-fly for most storages
# Except ownCloud, which already has all of them, and more # Except ownCloud, which already has all of them, and more
i += 1 i += 1
s = self.storage_class(**self.get_storage_args(collection=collection)) s = self.storage_class(
**self.get_storage_args(collection=collection))
item = self._create_bogus_item(str(i)) item = self._create_bogus_item(str(i))
s.upload(item) s.upload(item)
items.add(item.raw) items.add(item.raw)

View file

@ -12,6 +12,7 @@ from .http import HttpStorageBase
import vdirsyncer.exceptions as exceptions import vdirsyncer.exceptions as exceptions
import vdirsyncer.log as log import vdirsyncer.log as log
import requests import requests
import datetime
import urlparse import urlparse
from lxml import etree from lxml import etree
@ -233,8 +234,6 @@ class DavStorage(HttpStorageBase):
yield href, etag yield href, etag
class CaldavStorage(DavStorage): class CaldavStorage(DavStorage):
fileext = '.ics' fileext = '.ics'

View file

@ -100,7 +100,8 @@ def get_password(username, resource):
password = None password = None
while True: while True:
password = keyring.get_password(password_key_prefix + key, username) password = keyring.get_password(password_key_prefix + key,
username)
if password is not None: if password is not None:
return password return password
@ -139,6 +140,7 @@ def get_password(username, resource):
prompt = 'Save this password in the keyring? [y/N] ' prompt = 'Save this password in the keyring? [y/N] '
answer = raw_input(prompt).lower() answer = raw_input(prompt).lower()
if answer == 'y': if answer == 'y':
keyring.set_password(password_key_prefix + resource, username, password) keyring.set_password(password_key_prefix + resource,
username, password)
return password return password