PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/indico/MaKaC/plugins/Collaboration/Vidyo/fossils.py

https://github.com/flannery/indico-flannery
Python | 74 lines | 50 code | 5 blank | 19 comment | 0 complexity | b6f74d2602443f713758b79e38172802 MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. ##
  3. ## This file is part of CDS Indico.
  4. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
  5. ##
  6. ## CDS Indico is free software; you can redistribute it and/or
  7. ## modify it under the terms of the GNU General Public License as
  8. ## published by the Free Software Foundation; either version 2 of the
  9. ## License, or (at your option) any later version.
  10. ##
  11. ## CDS Indico is distributed in the hope that it will be useful, but
  12. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. ## General Public License for more details.
  15. ##
  16. ## You should have received a copy of the GNU General Public License
  17. ## along with CDS Indico; if not, write to the Free Software Foundation, Inc.,
  18. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  19. from MaKaC.plugins.Collaboration.fossils import ICSErrorBaseFossil, \
  20. ICSBookingBaseConfModifFossil, ICSBookingBaseIndexingFossil
  21. from MaKaC.common.fossilize import IFossil
  22. class ICSBookingConfModifFossil(ICSBookingBaseConfModifFossil):
  23. def getRoomId(self):
  24. """ returns the public room Vidyo id """
  25. def getExtension(self):
  26. """ returns the public room's extension """
  27. def getOwnerAccount(self):
  28. """ returns the Viydo account of the owner that was used to create the room """
  29. def getURL(self):
  30. """ returns the public room auto-join url """
  31. getURL.name = 'url'
  32. def removePin(bookingParams):
  33. del bookingParams["pin"]
  34. return bookingParams
  35. class ICSBookingIndexingFossil(ICSBookingBaseIndexingFossil):
  36. def getBookingParams(self):
  37. """ Overloading of ICSBookingBaseFossil's getBookingParams to remove the pin """
  38. getBookingParams.convert = lambda bookingParams: removePin(bookingParams)
  39. def getExtension(self):
  40. """ returns the public room's extension """
  41. def isCreated(self):
  42. """ Returns False if the public room is no longer in Vidyo and someone tried to checkStatus / modify it,
  43. otherwise True.
  44. """
  45. class IVidyoErrorFossil(ICSErrorBaseFossil):
  46. def getErrorType(self):
  47. """ A string with the error type """
  48. def getOperation(self):
  49. """ A string with the operation (creation, edition, etc.) that produced the error """
  50. class IFakeAvatarOwnerFossil(IFossil):
  51. def getId(self):
  52. """ returns None, always """
  53. def getName(self):
  54. """ returns the account name """