# HG changeset patch # User Paul Boddie # Date 1441028686 -7200 # Node ID 9356528e54d7d4506bffb764a0e1255d9c8be4f6 # Parent 4d441e96f22fe180587ff68aaeb33d9ac619eea5 Added the ability to enable/disable manager interface links in notifications. Improved the notification texts. Tidied the install script, adding a simple backup of any existing configuration. diff -r 4d441e96f22f -r 9356528e54d7 imiptools/client.py --- a/imiptools/client.py Sat Aug 29 00:14:32 2015 +0200 +++ b/imiptools/client.py Mon Aug 31 15:44:46 2015 +0200 @@ -20,6 +20,7 @@ """ from datetime import datetime +from imiptools.config import MANAGER_INTERFACE from imiptools.data import Object, get_address, get_uri, get_window_end, \ is_new_object, make_freebusy, to_part, \ uri_dict, uri_items, uri_values @@ -85,6 +86,9 @@ prefs = self.get_preferences() return prefs and prefs.get("freebusy_messages") == "notify" or False + def have_manager(self): + return MANAGER_INTERFACE + def get_scheduling_resolution(self): """ diff -r 4d441e96f22f -r 9356528e54d7 imiptools/config.py --- a/imiptools/config.py Sat Aug 29 00:14:32 2015 +0200 +++ b/imiptools/config.py Mon Aug 31 15:44:46 2015 +0200 @@ -32,6 +32,12 @@ DEFAULT_DIR_PERMISSIONS = 02770 +# The availability of a management interface for calendar information. +# True: provide links in notifications to the interface described below. +# False: omit links in notifications. + +MANAGER_INTERFACE = True + # The published location of the manager application. # This must match any Web site configuration details for the manager. diff -r 4d441e96f22f -r 9356528e54d7 imiptools/handlers/__init__.py --- a/imiptools/handlers/__init__.py Sat Aug 29 00:14:32 2015 +0200 +++ b/imiptools/handlers/__init__.py Mon Aug 31 15:44:46 2015 +0200 @@ -70,7 +70,7 @@ texts = [] texts.append(text) - if link: + if link and self.have_manager(): texts.append("If your mail program cannot handle this " "message, you may view the details here:\n\n%s" % get_object_url(self.uid, self.recurrenceid)) diff -r 4d441e96f22f -r 9356528e54d7 imiptools/handlers/person.py --- a/imiptools/handlers/person.py Sat Aug 29 00:14:32 2015 +0200 +++ b/imiptools/handlers/person.py Mon Aug 31 15:44:46 2015 +0200 @@ -153,19 +153,19 @@ "Queue a cancellation of any active event." if self._record(from_organiser=True, queue=False, cancel=True): - return self.wrap("A cancellation has been received.", link=False) + return self.wrap("An event cancellation has been received.", link=False) def counter(self): # NOTE: Queue a suggested modification to any active event. - return self.wrap("A counter proposal has been received.", link=False) + return self.wrap("A counter proposal to an event invitation has been received.", link=False) def declinecounter(self): # NOTE: Queue a rejected modification to any active event. - return self.wrap("A declining counter proposal has been received.", link=False) + return self.wrap("Your counter proposal to an event invitation has been declined.", link=False) def publish(self): @@ -187,14 +187,14 @@ "Record replies and notify the recipient." if self._record(from_organiser=False, queue=False): - return self.wrap("A reply has been received.") + return self.wrap("A reply to an event invitation has been received.") def request(self): "Hold requests and notify the recipient." if self._record(from_organiser=True, queue=True): - return self.wrap("A request has been received.") + return self.wrap("An event invitation has been received.") class Freebusy(PersonHandler, CommonFreebusy): diff -r 4d441e96f22f -r 9356528e54d7 tools/install.sh --- a/tools/install.sh Sat Aug 29 00:14:32 2015 +0200 +++ b/tools/install.sh Mon Aug 31 15:44:46 2015 +0200 @@ -13,14 +13,20 @@ cp $MODULES "$INSTALL_DIR" if [ ! -e "$INSTALL_DIR/imiptools" ]; then - mkdir "$INSTALL_DIR"/imiptools + mkdir "$INSTALL_DIR/imiptools" if [ ! -e "$INSTALL_DIR/imiptools" ]; then - mkdir "$INSTALL_DIR"/imiptools/handlers + mkdir "$INSTALL_DIR/imiptools/handlers" fi fi -cp imiptools/*.py "$INSTALL_DIR"/imiptools/ -cp imiptools/handlers/*.py "$INSTALL_DIR"/imiptools/handlers/ +if [ -e "$INSTALL_DIR/imiptools/config.py" ]; then + if [ ! -e "$INSTALL_DIR/imiptools/config.py.backup" ]; then + mv "$INSTALL_DIR/imiptools/config.py" "$INSTALL_DIR/imiptools/config.py.backup" + fi +fi + +cp imiptools/*.py "$INSTALL_DIR/imiptools/" +cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/" if [ ! -e "$WEB_INSTALL_DIR" ]; then mkdir -p "$WEB_INSTALL_DIR" @@ -30,7 +36,7 @@ cp htdocs/styles.css "$WEB_INSTALL_DIR" if [ ! -e "$WEB_INSTALL_DIR/imipweb" ]; then - mkdir "$WEB_INSTALL_DIR"/imipweb + mkdir "$WEB_INSTALL_DIR/imipweb" fi -cp imipweb/*.py "$WEB_INSTALL_DIR"/imipweb/ +cp imipweb/*.py "$WEB_INSTALL_DIR/imipweb/"