1.1 --- a/tests/common.sh Tue Feb 09 15:01:40 2016 +0100
1.2 +++ b/tests/common.sh Tue Feb 09 15:17:50 2016 +0100
1.3 @@ -11,13 +11,13 @@
1.4 ARGS="-S $STORE -P $STATIC -p $PREFS -j $JOURNAL -d"
1.5
1.6 ACCEPT_SCRIPT="$THIS_DIR/test_handle.py"
1.7 -ACCEPT_ARGS="accept $STORE $PREFS"
1.8 +ACCEPT_ARGS="accept $STORE $JOURNAL $PREFS"
1.9
1.10 COUNTER_SCRIPT="$THIS_DIR/test_handle.py"
1.11 -COUNTER_ARGS="counter $STORE $PREFS"
1.12 +COUNTER_ARGS="counter $STORE $JOURNAL $PREFS"
1.13
1.14 DECLINE_SCRIPT="$THIS_DIR/test_handle.py"
1.15 -DECLINE_ARGS="decline $STORE $PREFS"
1.16 +DECLINE_ARGS="decline $STORE $JOURNAL $PREFS"
1.17
1.18 FREEBUSY_SCRIPT="$BASE_DIR/tools/make_freebusy.py"
1.19 FREEBUSY_ARGS="-s -n"
2.1 --- a/tests/test_handle.py Tue Feb 09 15:01:40 2016 +0100
2.2 +++ b/tests/test_handle.py Tue Feb 09 15:17:50 2016 +0100
2.3 @@ -3,7 +3,7 @@
2.4 """
2.5 A handler to help with testing.
2.6
2.7 -Copyright (C) 2014, 2015 Paul Boddie <paul@boddie.org.uk>
2.8 +Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
2.9
2.10 This program is free software; you can redistribute it and/or modify it under
2.11 the terms of the GNU General Public License as published by the Free Software
2.12 @@ -94,13 +94,13 @@
2.13
2.14 if __name__ == "__main__":
2.15 try:
2.16 - action, store_dir, preferences_dir, user = sys.argv[1:5]
2.17 + action, store_dir, journal_dir, preferences_dir, user = sys.argv[1:6]
2.18 if action == "counter":
2.19 - start, end = sys.argv[5:7]
2.20 - i = 7
2.21 + start, end = sys.argv[6:8]
2.22 + i = 8
2.23 else:
2.24 start, end = None, None
2.25 - i = 5
2.26 + i = 6
2.27 uid, recurrenceid = (sys.argv[i:i+2] + [None] * 2)[:2]
2.28 except ValueError:
2.29 print >>sys.stderr, """\
2.30 @@ -121,6 +121,7 @@
2.31 sys.exit(1)
2.32
2.33 store = imip_store.FileStore(store_dir)
2.34 + journal = imip_store.FileJournal(journal_dir)
2.35
2.36 if uid is not None:
2.37 fragment = store.get_event(user, uid, recurrenceid)
2.38 @@ -132,7 +133,7 @@
2.39 fragment = parse_object(sys.stdin, "utf-8")
2.40
2.41 obj = Object(fragment)
2.42 - handler = TestClient(obj, user, Messenger(), store, None, preferences_dir)
2.43 + handler = TestClient(obj, user, Messenger(), store, None, journal, preferences_dir)
2.44 response = handler.handle_request(action, start, end)
2.45
2.46 if response:
3.1 --- a/tools/make_freebusy.py Tue Feb 09 15:01:40 2016 +0100
3.2 +++ b/tools/make_freebusy.py Tue Feb 09 15:17:50 2016 +0100
3.3 @@ -5,7 +5,7 @@
3.4 availability schedule or the schedule of another user (using details provided
3.5 when scheduling events with that user).
3.6
3.7 -Copyright (C) 2014, 2015 Paul Boddie <paul@boddie.org.uk>
3.8 +Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
3.9
3.10 This program is free software; you can redistribute it and/or modify it under
3.11 the terms of the GNU General Public License as published by the Free Software
3.12 @@ -38,7 +38,7 @@
3.13 from imiptools.data import get_window_end, Object
3.14 from imiptools.dates import get_default_timezone, to_utc_datetime
3.15 from imiptools.period import insert_period
3.16 -from imip_store import FileStore, FilePublisher
3.17 +from imip_store import FileStore, FilePublisher, FileJournal
3.18
3.19 def make_freebusy(client, participant, store_and_publish, include_needs_action,
3.20 reset_updated_list, verbose):
3.21 @@ -150,6 +150,7 @@
3.22 args = []
3.23 store_dir = []
3.24 publishing_dir = []
3.25 + journal_dir = []
3.26 preferences_dir = []
3.27 ignored = []
3.28
3.29 @@ -166,6 +167,8 @@
3.30 l = store_dir
3.31 elif arg == "-P":
3.32 l = publishing_dir
3.33 + elif arg == "-j":
3.34 + l = journal_dir
3.35 elif arg == "-p":
3.36 l = preferences_dir
3.37 else:
3.38 @@ -185,9 +188,10 @@
3.39
3.40 General options:
3.41
3.42 --S indicate the store directory location
3.43 +-j indicate the journal directory location
3.44 +-p indicate the preferences directory location
3.45 -P indicate the publishing directory location
3.46 --p indicate the preferences directory location
3.47 +-S indicate the store directory location
3.48 """ % split(sys.argv[0])[1]
3.49 sys.exit(1)
3.50
3.51 @@ -203,12 +207,14 @@
3.52
3.53 store_dir = store_dir and store_dir[0] or None
3.54 publishing_dir = publishing_dir and publishing_dir[0] or None
3.55 + journal_dir = journal_dir and journal_dir[0] or None
3.56 preferences_dir = preferences_dir and preferences_dir[0] or None
3.57
3.58 # Obtain store-related objects.
3.59
3.60 store = FileStore(store_dir)
3.61 publisher = FilePublisher(publishing_dir)
3.62 + journal = FileJournal(journal_dir)
3.63
3.64 # Obtain a list of users for processing.
3.65
3.66 @@ -223,7 +229,7 @@
3.67 if verbose:
3.68 print >>sys.stderr, user
3.69 make_freebusy(
3.70 - Client(user, None, store, publisher, preferences_dir), participant,
3.71 + Client(user, None, store, publisher, journal, preferences_dir), participant,
3.72 store_and_publish, include_needs_action, reset_updated_list, verbose)
3.73
3.74 # vim: tabstop=4 expandtab shiftwidth=4