Changeset 8ba2f9 in indico
- Timestamp:
- 02/23/12 17:26:18 (15 months ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 12d2c2
- Parents:
- e3def0
- git-author:
- Matthew Pugh <matthew.alexander.pugh@…> (02/23/12 15:05:21)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (02/23/12 17:26:18)
- File:
-
- 1 edited
-
indico/MaKaC/plugins/Collaboration/http_api.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/plugins/Collaboration/http_api.py
r4bd5a7 r8ba2f9 47 47 alarm.set('trigger', trigger) 48 48 alarm.set('action', 'DISPLAY') 49 alarm.set('summary', "[" + fossil['type'] + "] " + fossil['status'] + " - " + fossil['title'].decode('utf-8')) 49 alarm.set('summary', VideoExportUtilities.getCondensedPrefix(fossil['type'], 50 fossil['status']) + fossil['title'].decode('utf-8')) 50 51 alarm.set('description', str(fossil['url'])) 51 52 … … 62 63 event.set('url', url) 63 64 event.set('categories', "VideoService - " + fossil['type']) 64 event.set('summary', "[" + fossil['type'] + "] " + fossil['status'] + " - " + fossil['title'].decode('utf-8')) 65 event.set('summary', VideoExportUtilities.getCondensedPrefix(fossil['type'], 66 fossil['status']) + fossil['title'].decode('utf-8')) 65 67 event.set('description', url) 66 68 … … 73 75 # the iCal serializer needs some extra info on how to display things 74 76 ICalSerializer.register_mapper('collaborationMetadata', serialize_collaboration) 77 78 79 class VideoExportUtilities(): 80 81 SERVICE_MAP = { 82 'CERNMCU': 'MCU', 83 'WebcastRequest': 'W', 84 'RecordingRequest': 'R' 85 } 86 STATUS_MAP = { 87 'Accepted': 'A', 88 'Rejected': 'R', 89 'Pending': 'P' 90 } 91 92 @staticmethod 93 def getCondensedPrefix(service, status): 94 """ Condense down the summary lines based on the above dictionaries 95 for easier reading in calendar applications. 96 """ 97 prefix = "" 98 99 if VideoExportUtilities.SERVICE_MAP.has_key(service): 100 prefix += VideoExportUtilities.SERVICE_MAP.get(service) 101 else: 102 prefix += service 103 104 prefix += '-' 105 106 if VideoExportUtilities.STATUS_MAP.has_key(status): 107 prefix += VideoExportUtilities.STATUS_MAP.get(status) 108 else: 109 prefix += status 110 111 return (prefix + ": ") 75 112 76 113
Note: See TracChangeset
for help on using the changeset viewer.
