Skip to content

Commit 20dcb38

Browse files
committed
bugfix
1 parent a168ad4 commit 20dcb38

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

docs/source/tutorial.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inspect the return objects you get from the library calls.
1010
To follow this tutorial as intended, each code block should be run
1111
towards a clean-slate Radicale server. To do this, you need:
1212

13-
* The source code of caldav with tests, for instance: ``git clone https://github.com/python-caldav/caldav.git ; cd caldav``
13+
* The source code of caldav with tests: ``git clone https://github.com/python-caldav/caldav.git ; cd caldav``
1414
* The Radicale python package: ``pip install radicale``
1515
* An environmental variable set: ``export PYTHON_CALDAV_USE_TEST_SERVER=1``
1616

@@ -19,8 +19,7 @@ up a Radicale server.
1919

2020
When you've run the tutorial as intended, I recommend going through the examples again towards your own calendar server:
2121

22-
* Set the environment variables ``CALDAV_URL``, ``CALDAV_USER`` and
23-
``CALDAV_PASSWORD`` to point to your personal calendar server.
22+
* Set the environment variables ``CALDAV_URL``, ``CALDAV_USER`` and ``CALDAV_PASSWORD`` to point to your personal calendar server.
2423
* Be aware that different calendar servers may behave differently. For instance, not all of them allows you to create a calendar. Some are even read-only.
2524
* You will need to revert all changes done. The code examples below does not do any cleanup. If your calendar server supports creating and deleting calendars, then it should be easy enough: ```my_new_calendar.delete()``` inside the with-block. Events also has a ``.delete()``-method. Beware that there is no ``undo``. You're adviced to have a local backup of your calendars. I'll probably write a HOWTO on that one day.
2625
* Usage of a context manager is considered best practice, but not really needed - you may skip the with-statement and write just ``client = get_davclient()``. This will make it easier to test code from the python shell.

examples/scheduling_examples.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,25 @@ def __init__(self, i):
3333
self.client = DAVClient(**conndata)
3434
else:
3535
self.client = DAVClient(
36-
username="testuser%i" % i,
37-
password="testpass%i" % i,
38-
url="http://calendar.tobixen.no/caldav.php/",
36+
username="testaccount%i" % i,
37+
password="hunter2",
38+
url="http://davical.bekkenstenveien53c.oslo.no/caldav.php/",
3939
)
4040
self.principal = self.client.principal()
4141
calendar_id = "schedulingtestcalendar%i" % i
4242
calendar_name = "calendar #%i for scheduling demo" % i
43-
self.cleanup(calendar_name)
43+
self.cleanup(calendar_name, calendar_id)
4444
self.calendar = self.principal.make_calendar(
4545
name=calendar_name, cal_id=calendar_id
4646
)
4747

48-
def cleanup(self, calendar_name):
48+
def cleanup(self, calendar_name, calendar_id):
4949
## Cleanup from earlier runs
5050
try:
5151
self.calendar = self.principal.calendar(name=calendar_name)
5252
self.calendar.delete()
53+
self.calendar = self.principal.calendar(cal_id=calendar_id)
54+
self.calendar.delete()
5355
except error.NotFoundError:
5456
pass
5557

0 commit comments

Comments
 (0)