Changeset a217dc in indico


Ignore:
Timestamp:
05/12/10 15:30:42 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
b25817
Parents:
1881c6
git-author:
Ian Rolewicz <ian.rolewicz@…> (03/26/10 16:37:59)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (05/12/10 15:30:42)
Message:

[OPT] Optimization of the timetable display

  • fixes #307
  • Replaced pickling by fossilization for the generation of the data structures needed for the display of the timetable. The fossils contain the minimal amount of information needed to display the timetable, which is less than what the pickling was retrieving
  • New minimal fossils were added for the managment timetable too.
  • Optimized the loop that is grouping entries by day
  • Removed dead code used for the management timetable generation
  • Added a argument to the Fossils.fossilize(), ScheduleToJson?.process() and ScheduleToJson?.processEntry() method in order to use the attributes cache, useful for fossils that have fields that are repeated.
  • Displaying the 'view event' timetable of a conference like 'CHEP 2009' takes now less than 8 seconds
  • Displaying the 'managment' timetable of a conference like 'CHEP 2009' takes now less than 4 seconds
Location:
indico
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/common/Conversion.py

    r021579 ra217dc  
    6363    def parentSlot(cls, entry): 
    6464        from MaKaC.schedule import ContribSchEntry, BreakTimeSchEntry 
    65         from MaKaC.conference import SessionSlot, Session 
     65        from MaKaC.conference import SessionSlot#, Session 
    6666 
    6767        slot = None 
    6868 
    69         if type(entry) == ContribSchEntry: 
    70             contrib = entry.getOwner() 
    71             session = contrib.getSession() 
    72  
    73             # If the contribution is not owned by a session return nothing 
    74             if type(session) != Session: 
    75                 return None 
    76  
    77             # TODO: This should be fixed. There's currently no easy way 
    78             # of knowing in which session slot a contribution belongs. 
    79             # Loop through all the session slots and look if the contribution 
    80             # exists in the schedule. 
    81             for sl in session.getSlotList(): 
    82                 for e in sl.getEntries(): 
    83                     if e.getOwner() == contrib: 
    84                         slot = sl 
    85                         break 
     69        if type(entry) == ContribSchEntry and entry.getSchedule() is not None: 
     70            slot = entry.getSchedule().getOwner() 
    8671 
    8772        elif type(entry) == BreakTimeSchEntry: 
     
    10287    @classmethod 
    10388    def locatorString(cls, obj): 
     89 
    10490        locator = obj.getOwner().getLocator() 
    10591        if not locator.has_key('sessionId'): 
     
    119105        """ 
    120106        return int(obj.seconds / 60) 
     107 
     108#    @classmethod 
     109#    def resourceType(cls, obj): 
     110# 
     111#        from MaKaC.conference import Link 
     112#        if type(obj) == Link: 
     113#            return 'external' 
     114#        else: 
     115#            return 'stored' 
  • indico/MaKaC/common/fossilize.py

    r1881c6 ra217dc  
    3333import zope.interface 
    3434from types import NoneType, ClassType, TypeType 
    35 from persistent.interfaces import IPersistent 
    3635 
    3736 
     
    8685    __fossilNameRE = re.compile('^I(\w+)Fossil$') 
    8786    __methodNameRE = re.compile('^get(\w+)|(has\w+)|(is\w+)$') 
    88     __methodNameRE = re.compile('^get(.*)|(has.+)|(is.+)$') 
    8987    __methodNameCache = {} 
    9088    __fossilNameCache = {} 
     89    __fossilAttrsCache = {} # Attribute Cache for Fossils with 
     90                            # fields that are repeated 
    9191 
    9292    @classmethod 
     
    148148        if interfaceArg is None: 
    149149            #we try to take the 1st interface declared with fossilizes 
    150             implementedInterfaces = list(zope.interface.implementedBy(self.__class__)) 
    151             if not implementedInterfaces or implementedInterfaces[0] == IPersistent: 
     150            implementedInterfaces = list(i for i in zope.interface.implementedBy(self.__class__) if i.extends(IFossil)) 
     151            if not implementedInterfaces: 
    152152                raise NonFossilizableException("Object %s of class %s cannot be fossilized," 
    153153                                               "no fossils were declared for it" % 
     
    159159        elif type(interfaceArg) is dict: 
    160160 
    161             found = False 
    162             clazz = self.__class__ 
    163  
    164             for key in interfaceArg.iterkeys(): 
    165                 if (key == clazz.__name__ or #class name 
    166                     key == "%s.%s" % (clazz.__module__, clazz.__name__) or #full class name 
    167                     key == clazz or #class 
    168                     (type(key) == ClassType or type(key) == TypeType or type(key) == tuple) and isinstance(self, key)): #class (including base classes) 
    169  
    170                     interface = interfaceArg[key] 
    171                     found = True 
    172                     break 
    173  
    174             if not found: 
     161            className = self.__class__.__module__ + '.' + \ 
     162                        self.__class__.__name__ 
     163 
     164            # interfaceArg is a dictionary of class:Fossil pairs 
     165            if className in interfaceArg: 
     166                interface = interfaceArg[className] 
     167            else: 
    175168                raise NonFossilizableException("Object %s of class %s cannot be fossilized; " 
    176169                                               "its class was not a key in the provided fossils dictionary" % 
     
    181174 
    182175        if not interface.providedBy(self): 
     176 
    183177            raise WrongFossilTypeException("Interface '%s' not provided" 
    184178                                           " by '%s'" % 
     
    190184 
    191185    @classmethod 
    192     def _fossilizeIterable(cls, target, interface, **kwargs): 
     186    def _fossilizeIterable(cls, target, interface, useAttrCache = False, **kwargs): 
    193187        """ 
    194188        Fossilizes an object, be it a 'direct' fossilizable 
     
    197191 
    198192        if isinstance(target, Fossilizable): 
    199             return target.fossilize(interface, **kwargs) 
     193            return target.fossilize(interface, useAttrCache, **kwargs) 
    200194        else: 
    201195            ttype = type(target) 
     
    205199                container = [] #we turn sets and tuples into lists since JSON does not have sets / tuples 
    206200                for elem in target: 
    207                     container.append(fossilize(elem, interface, **kwargs)) 
     201                    container.append(fossilize(elem, interface, useAttrCache, **kwargs)) 
    208202                return container 
    209203            elif ttype is dict: 
    210204                container = {} 
    211205                for key, value in target.iteritems(): 
    212                     container[key] = fossilize(value, interface, **kwargs) 
     206                    container[key] = fossilize(value, interface, useAttrCache, **kwargs) 
    213207                return container 
    214208            else: 
    215209                raise NonFossilizableException() 
    216210 
    217             return fossilize(target, interface) 
    218  
    219  
    220     def fossilize(self, interfaceArg = None, **kwargs): 
     211            return fossilize(target, interface, useAttrCache) 
     212 
     213    def fossilize(self, interfaceArg = None, useAttrCache = False, **kwargs): 
    221214        """ 
    222215        Fossilizes the object, using the fossil provided by `interface`. 
     
    224217        :param interfaceArg: the target fossile type 
    225218        :type interfaceArg: IFossil, NoneType, or dict 
     219        :param useAttrCache: use caching of attributes if same fields are 
     220            repeated for a fossil 
     221        :type useAttrCache: boolean 
    226222        """ 
    227223 
     
    236232 
    237233            tags = interface[method].getTaggedValueTags() 
    238             #Please use 'produce' as little as possible; there is almost always a more elegant and modular solution! 
    239             if 'produce' in tags: 
    240                 methodResult = interface[method].getTaggedValue('produce')(self) 
    241             else: 
    242                 methodResult = getattr(self, method)() 
     234 
     235            # In some cases it is better to use the attribute cache to 
     236            # speed up the fossilization 
     237            cacheUsed = False 
     238            if useAttrCache: 
     239                try: 
     240                    methodResult = self.__fossilAttrsCache[self._p_oid][method] 
     241                    cacheUsed = True 
     242                except KeyError: 
     243                    pass 
     244            if not cacheUsed: 
     245                #Please use 'produce' as little as possible; there is almost always a more elegant and modular solution! 
     246                if 'produce' in tags: 
     247                    methodResult = interface[method].getTaggedValue('produce')(self) 
     248                else: 
     249                    methodResult = getattr(self, method)() 
     250 
     251                if hasattr(self, "_p_oid"): 
     252                    try: 
     253                        self.__fossilAttrsCache[self._p_oid] 
     254                    except KeyError: 
     255                        self.__fossilAttrsCache[self._p_oid] = {} 
     256                    self.__fossilAttrsCache[self._p_oid][method] = methodResult 
    243257 
    244258            # Result conversion 
     
    246260                targetInterface = interface[method].getTaggedValue('result') 
    247261                #targetInterface = globals()[targetInterfaceName] 
     262 
    248263                methodResult = Fossilizable._fossilizeIterable( 
    249264                    methodResult, targetInterface, **kwargs) 
     
    264279                attrName = self.__extractName(method) 
    265280 
    266             result[attrName] = methodResult 
     281            # In case the name contains dots, each of the 'domains' but the 
     282            # last one are translated into nested dictionnaries. For example, 
     283            # if we want to re-name an attribute into "foo.bar.tofu", the 
     284            # corresponding fossilized attribute will be of the form: 
     285            # {"foo":{"bar":{"tofu": res,...},...},...} 
     286            # instead of: 
     287            # {"foo.bar.tofu": res, ...} 
     288 
     289            current = result 
     290            attrList = attrName.split('.') 
     291 
     292            while len(attrList) > 1: 
     293                attr = attrList.pop(0) 
     294                try: 
     295                    current = current[attr] 
     296                except KeyError: 
     297                    current[attr] = {} 
     298                    current = current[attr] 
     299 
     300            # For the last attribute level 
     301            current[attrList[0]] = methodResult 
    267302 
    268303        if "_type" in result or "_fossil" in result: 
     
    279314 
    280315 
    281 def fossilize(target, interfaceArg = None, **kwargs): 
     316def fossilize(target, interfaceArg = None, useAttrCache = False, **kwargs): 
    282317    """ 
    283318    Method that allows the "fossilization" process to 
     
    289324    :param interfaceArg: target fossil type 
    290325    :type interfaceArg: IFossil, NoneType, or dict 
    291     """ 
    292     return Fossilizable._fossilizeIterable(target, interfaceArg, **kwargs) 
     326    :param useAttrCache: use the attribute caching 
     327    :type useAttrCache: boolean 
     328    """ 
     329    return Fossilizable._fossilizeIterable(target, interfaceArg, useAttrCache, **kwargs) 
  • indico/MaKaC/conference.py

    r0b2441 ra217dc  
    2525    ISubContributionFossil, ISubContributionWithSpeakersFossil 
    2626from MaKaC.fossils.contribution import IContributionParticipationFossil,\ 
    27     IContributionFossil, IContributionWithSpeakersFossil,\ 
    28     IContributionWithSubContribsFossil 
    29 from MaKaC.fossils.conference import IConferenceMinimalFossil 
     27    IContributionFossil, IContributionWithSpeakersFossil, IContributionParticipationMinimalFossil, \ 
     28    IContributionWithSubContribsFossil,\ 
     29    IContributionParticipationTTDisplayFossil, \ 
     30    IContributionParticipationTTMgmtFossil 
     31from MaKaC.fossils.conference import IConferenceMinimalFossil,\ 
     32    ISessionFossil, ISessionSlotFossil, IMaterialFossil,\ 
     33    IConferenceParticipationFossil, IResourceFossil, ILinkFossil,\ 
     34    ILocalFileFossil 
    3035from MaKaC.common.fossilize import fossilizes, Fossilizable 
    3136 
     
    15051510 
    15061511 
    1507 class ConferenceParticipation(Persistent): 
     1512class ConferenceParticipation(Persistent, Fossilizable): 
     1513 
     1514    fossilizes(IConferenceParticipationFossil) 
    15081515 
    15091516    @Retrieves(['MaKaC.conference.ConferenceParticipation', 
     
    53515358 
    53525359 
    5353 class Session(Persistent): 
     5360class Session(Persistent, Fossilizable): 
    53545361    """This class implements a conference session, being the different parts 
    53555362        in which the conference can be divided and the contributions can be 
     
    53605367    """ 
    53615368 
     5369    fossilizes(ISessionFossil) 
    53625370 
    53635371    @Retrieves(['MaKaC.conference.Session'], 'numSlots', lambda x : len(x.getSlotList())) 
     
    68416849    _cmpTitle=staticmethod(_cmpTitle) 
    68426850 
    6843 class SessionSlot(Persistent): 
     6851class SessionSlot(Persistent, Fossilizable): 
     6852 
     6853    fossilizes(ISessionSlotFossil) 
    68446854 
    68456855    def __init__(self,session,**sessionSlotData): 
     
    74887498class ContributionParticipation(Persistent, Fossilizable): 
    74897499 
    7490     fossilizes(IContributionParticipationFossil) 
     7500    fossilizes(IContributionParticipationFossil, IContributionParticipationMinimalFossil,\ 
     7501               IContributionParticipationTTDisplayFossil,\ 
     7502               IContributionParticipationTTMgmtFossil) 
    74917503 
    74927504    def __init__( self ): 
     
    79027914    """ 
    79037915 
    7904     fossilizes(IContributionFossil, IContributionWithSpeakersFossil, IContributionWithSubContribsFossil) 
     7916    fossilizes(IContributionFossil, IContributionWithSpeakersFossil,\ 
     7917                IContributionWithSubContribsFossil) 
    79057918 
    79067919    def __init__(self,**contribData): 
     
    97999812            return maxDatetime() 
    98009813 
     9814    @Retrieves(['MaKaC.conference.Contribution'], 'color') 
     9815    def getColor(self): 
     9816        res="" 
     9817        if self.getSession() is not None: 
     9818            res=self.getSession().getColor() 
     9819        return res 
     9820 
     9821    @Retrieves(['MaKaC.conference.Contribution'], 'textColor') 
     9822    def getTextColor(self): 
     9823        res="" 
     9824        if self.getSession() is not None: 
     9825            res=self.getSession().getTextColor() 
     9826        return res 
    98019827 
    98029828class AcceptedContribution( Contribution ): 
     
    1084010866        self._reportNumberHolder=rnh 
    1084110867 
    10842 class Material(Persistent): 
     10868class Material(Persistent, Fossilizable): 
    1084310869    """This class represents a set of electronic documents (resources) which can 
    1084410870        be attached to a conference, a session or a contribution. 
     
    1086010886            by their unique relative id. 
    1086110887    """ 
     10888 
     10889    fossilizes(IMaterialFossil) 
    1086210890 
    1086310891    def __init__( self, materialData=None ): 
     
    1158511613 
    1158611614 
    11587 class Resource(Persistent): 
     11615class Resource(Persistent, Fossilizable): 
    1158811616    """This is the base class for representing individual resources which can 
    1158911617        be included in material containers for lately being attached to 
     
    1160411632    """ 
    1160511633 
     11634    fossilizes(IResourceFossil) 
     11635 
    1160611636    @Retrieves (['MaKaC.conference.Link', 
    1160711637                 'MaKaC.conference.LocalFile'], 'type', lambda r: if_else(type(r) == Link , 'external', 'stored')) 
     
    1194411974        url -- (string) Contains the URL to the internet target resource. 
    1194511975    """ 
     11976 
     11977    fossilizes(ILinkFossil) 
    1194611978 
    1194711979    def __init__( self, resData = None ): 
     
    1198212014    """ 
    1198312015 
     12016    fossilizes(ILocalFileFossil) 
     12017 
    1198412018    def __init__( self, resData = None ): 
    1198512019        Resource.__init__( self, resData ) 
  • indico/MaKaC/fossils/conference.py

    r5a8326 ra217dc  
    2121from MaKaC.common.fossilize import IFossil 
    2222from MaKaC.common.Conversion import Conversion 
     23from MaKaC.webinterface import urlHandlers 
    2324 
    2425class IConferenceMinimalFossil(IFossil): 
     
    5556        """ Support Email """ 
    5657 
     58class IConferenceParticipationFossil(IFossil): 
    5759 
     60    def getFirstName( self ): 
     61        """ Conference Participation First Name """ 
     62 
     63    def getFamilyName( self ): 
     64        """ Conference Participation Family Name """ 
     65 
     66 
     67class IResourceFossil(IFossil): 
     68 
     69    def getName(self): 
     70        """ Name of the Resource """ 
     71 
     72 
     73class ILinkFossil(IResourceFossil): 
     74 
     75    def getURL(self): 
     76        """ URL of the file pointed by the link """ 
     77    getURL.name = "url" 
     78 
     79class ILocalFileFossil(IResourceFossil): 
     80 
     81    def getURL(self): 
     82        """ URL of the Local File """ 
     83    getURL.produce = lambda s: str(urlHandlers.UHFileAccess.getURL(s)) 
     84    getURL.name = "url" 
     85 
     86 
     87class IMaterialFossil(IFossil): 
     88 
     89    def getTitle( self ): 
     90        """ Material Title """ 
     91 
     92    def getResourceList(self): 
     93        """ Material Resource List """ 
     94    getResourceList.result = {"MaKaC.conference.Link": ILinkFossil, "MaKaC.conference.LocalFile": ILocalFileFossil} 
     95    getResourceList.name = "resources" 
     96 
     97 
     98class ISessionFossil(IFossil): 
     99 
     100    def getTitle(self): 
     101        """ Session Title """ 
     102 
     103    def getId(self): 
     104        """ Session Id """ 
     105    getId.name = "sessionId" 
     106 
     107    def getDescription(self): 
     108        """ Session Description """ 
     109 
     110    def getAllMaterialList(self): 
     111        """ Session List of all material """ 
     112    getAllMaterialList.result = IMaterialFossil 
     113    getAllMaterialList.name = "material" 
     114 
     115    def getColor(self): 
     116        """ Session Color """ 
     117 
     118    def getTextColor(self): 
     119        """ Session Text Color """ 
     120 
     121    def isPoster(self): 
     122        """ Is self a Poster Session ? """ 
     123    isPoster.produce = lambda s: s.getScheduleType() == 'poster' 
     124 
     125 
     126class ISessionSlotFossil(IFossil): 
     127 
     128    def getSession(self): 
     129        """ Slot Session """ 
     130    getSession.result = ISessionFossil 
     131 
     132    def getId(self): 
     133        """ Session Slot Id """ 
     134    getId.name = "sessionSlotId" 
     135 
     136    def getTitle(self): 
     137        """ Session Slot Title """ 
     138    getTitle.name = "slotTitle" 
     139 
     140    def getConference(self): 
     141        """ Session Slot Conference """ 
     142    getConference.result = IConferenceMinimalFossil 
     143 
     144    def getRoom(self): 
     145        """ Session Slot Room """ 
     146    getRoom.convert = Conversion.roomName 
     147 
     148    def getLocationName(self): 
     149        """ Session Slot Location Name """ 
     150    getLocationName.produce = lambda s: s.getLocation() 
     151    getLocationName.convert = Conversion.locationName 
     152    getLocationName.name = "location" 
     153 
     154    def getLocationAddress(self): 
     155        """ Session Slot Location Address """ 
     156    getLocationAddress.produce = lambda s: s.getLocation() 
     157    getLocationAddress.convert = Conversion.locationAddress 
     158    getLocationAddress.name = "address" 
     159 
     160    def inheritRoom(self): 
     161        """ Does the Session inherit a Room ?""" 
     162    inheritRoom.produce = lambda s: s.getOwnRoom() is None 
     163    inheritRoom.name = "inheritRoom" 
     164 
     165    def inheritLocation(self): 
     166        """ Does the Session inherit a Location ?""" 
     167    inheritLocation.produce = lambda s: s.getOwnLocation() is None 
     168    inheritLocation.name = "inheritLoc" 
     169 
     170    def getOwnConvenerList(self): 
     171        """ Session Slot Conveners List """ 
     172    getOwnConvenerList.result = IConferenceParticipationFossil 
     173    getOwnConvenerList.name = "conveners" 
  • indico/MaKaC/fossils/contribution.py

    r2adefc ra217dc  
    5151    getDuration.convert = Conversion.duration 
    5252 
    53 class IContributionParticipationFossil(IFossil): 
     53    def getDescription(self): 
     54        pass 
     55 
     56 
     57class IContributionParticipationTTDisplayFossil(IFossil): 
     58    """ 
     59    Minimal Fossil for Contribution Participation to be 
     60    used by the timetable display 
     61    """ 
     62 
     63    def getAffiliation(self): 
     64        pass 
     65 
     66    def getFullNameNoTitle(self): 
     67        pass 
     68    getFullNameNoTitle.name = "name" 
     69 
     70 
     71class IContributionParticipationTTMgmtFossil(IFossil): 
     72    """ 
     73    Minimal Fossil for Contribution Participation to be 
     74    used by the timetable management 
     75    """ 
     76 
     77    def getFullNameNoTitle(self): 
     78        pass 
     79    getFullNameNoTitle.name = "name" 
     80 
     81class IContributionParticipationMinimalFossil(IFossil): 
    5482 
    5583    def getId(self): 
    5684        pass 
     85 
     86    def getFullName(self): 
     87        pass 
     88 
     89class IContributionParticipationFossil(IContributionParticipationMinimalFossil): 
    5790 
    5891    def getTitle(self): 
     
    6396 
    6497    def getFamilyName(self): 
    65         pass 
    66  
    67     def getFullName(self): 
    6898        pass 
    6999 
     
    84114 
    85115 
    86  
    87116class IContributionWithSpeakersFossil(IContributionFossil): 
    88117 
    89118    def getSpeakerList(self): 
    90119        pass 
    91     getSpeakerList.result = IContributionParticipationFossil 
     120    getSpeakerList.result = IContributionParticipationMinimalFossil 
    92121 
    93122class IContributionWithSubContribsFossil(IContributionFossil): 
  • indico/MaKaC/plugins/Collaboration/RecordingRequest/tpls/Indexing.js

    r57b8a9 ra217dc  
    11{ 
    22    "customText": function(booking, viewBy) { 
    3         if (booking.statusMessage == "Request rejected by responsible" && booking.rejectionReason && trim(booking.rejectionReason)) { 
    4             return "Rejection reason: " + trim(booking.rejectionReason); 
     3        if (booking.statusMessage == "Request rejected by responsible" && booking.rejectReason && trim(booking.rejectReason)) { 
     4            return "Rejection reason: " + trim(booking.rejectReason); 
    55        } 
    66    } 
  • indico/MaKaC/plugins/Collaboration/RecordingRequest/tpls/Main.js

    rbe7613 ra217dc  
    4343 
    4444    customText : function(booking) { 
    45         if (booking.acceptRejectStatus === false && trim(booking.rejectionReason)) { 
    46             return $T("Rejection reason: ") + trim(booking.rejectionReason); 
     45        if (booking.acceptRejectStatus === false && trim(booking.rejectReason)) { 
     46            return $T("Rejection reason: ") + trim(booking.rejectReason); 
    4747        } 
    4848    }, 
  • indico/MaKaC/plugins/Collaboration/WebcastRequest/tpls/Indexing.js

    r57b8a9 ra217dc  
    11{ 
    22    "customText": function(booking, viewBy) { 
    3         if (booking.statusMessage == "Request rejected by responsible" && booking.rejectionReason && trim(booking.rejectionReason)) { 
    4             return "Rejection reason: " + trim(booking.rejectionReason); 
     3        if (booking.statusMessage == "Request rejected by responsible" && booking.rejectReason && trim(booking.rejectReason)) { 
     4            return "Rejection reason: " + trim(booking.rejectReason); 
    55        } 
    66    } 
  • indico/MaKaC/plugins/Collaboration/WebcastRequest/tpls/Main.js

    r626e2c ra217dc  
    1 {  
     1{ 
    22    checkParams : function () { 
    33        return { 
     
    2525        } 
    2626    }, 
    27      
     27 
    2828    errorHandler: function(event, error) { 
    2929        if (error.operation == "create") { 
     
    4040        } 
    4141    }, 
    42      
     42 
    4343    customText : function(booking) { 
    44         if (booking.acceptRejectStatus === false && trim(booking.rejectionReason)) { 
    45             return $T("Rejection reason: ") + trim(booking.rejectionReason); 
     44        if (booking.acceptRejectStatus === false && trim(booking.rejectReason)) { 
     45            return $T("Rejection reason: ") + trim(booking.rejectReason); 
    4646        } 
    4747    }, 
    48      
     48 
    4949    clearForm : function () { 
    5050        var formNodes = IndicoUtil.findFormFields($E('WebcastRequestForm')); 
     
    5454            IndicoUI.Effect.disappear($E('contributionsDiv')); 
    5555        } 
    56          
     56 
    5757        $E('permissionYesRB').dom.checked = false; 
    5858        $E('permissionNoRB').dom.checked = false; 
     
    6161        $E('postingUrgency').dom.value = "never"; 
    6262    }, 
    63      
     63 
    6464    onLoad : function() { 
    65          
     65 
    6666        WRUpdateContributionList(); 
    67          
     67 
    6868        IndicoUtil.enableDisableForm($E("WRForm"), WRWebcastCapable); 
    69          
     69 
    7070        if (!isLecture) { 
    7171            if (singleBookings['WebcastRequest'] && singleBookings['WebcastRequest'].bookingParams.talks == 'choose') { 
     
    7373            } 
    7474        } 
    75          
     75 
    7676        if(!singleBookings['WebcastRequest']) { 
    7777            callFunction('WebcastRequest', 'clearForm'); 
  • indico/MaKaC/schedule.py

    r0b2441 ra217dc  
    3636from MaKaC.common.Conversion import Conversion 
    3737from MaKaC.common.contextManager import ContextManager 
     38from MaKaC.common.fossilize import Fossilizable, fossilizes 
     39from MaKaC.fossils.schedule import IContribSchEntryDisplayFossil,\ 
     40        IContribSchEntryMgmtFossil, IBreakTimeSchEntryFossil,\ 
     41        IBreakTimeSchEntryMgmtFossil,\ 
     42        ILinkedTimeSchEntryDisplayFossil, ILinkedTimeSchEntryMgmtFossil 
    3843 
    3944class Schedule: 
     
    464469 
    465470 
    466 class SchEntry(Persistent): 
     471class SchEntry(Persistent, Fossilizable): 
    467472    """base schedule entry class. Do NOT instantiate 
    468473    """ 
     
    555560        pass 
    556561 
    557 class ConferenceSchedule(TimeSchedule): 
     562class ConferenceSchedule(TimeSchedule, Fossilizable): 
    558563    """ 
    559564    """ 
     565 
     566#    fossilizes(IConferenceScheduleDisplayFossil, IConferenceScheduleMgmtFossil) 
    560567 
    561568    def __init__(self,conf): 
     
    585592        #not very smart, should be improved: contribs with same start date, 
    586593        #   can cause overlapings 
     594 
    587595        if not tz: 
    588596            tz = self.getTimezone() 
     
    931939class LinkedTimeSchEntry(TimeSchEntry): 
    932940 
     941    fossilizes(ILinkedTimeSchEntryDisplayFossil, 
     942               ILinkedTimeSchEntryMgmtFossil) 
    933943    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'title', lambda x: x.getOwner().getSession().getTitle()) 
    934944    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'slotTitle', lambda x: x.getOwner().getTitle()) 
     
    938948    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'entryType', lambda x: 'Session') 
    939949    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'material', lambda x: DictPickler.pickle(x.getOwner().getSession().getAllMaterialList())) 
    940     @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'color', lambda x: x.getOwner().getSession().getColor()) 
    941     @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'textColor', lambda x: x.getOwner().getSession().getTextColor()) 
     950    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'color', lambda x: x.getOwner().getColor()) 
     951    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'textColor', lambda x: x.getOwner().getTextColor()) 
    942952    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'isPoster', lambda x: x.getOwner().getSession().getScheduleType() == 'poster') 
    943953    @Retrieves (['MaKaC.schedule.LinkedTimeSchEntry'], 'room', lambda x: Conversion.roomName(x.getOwner().getRoom())) 
     
    11191129class BreakTimeSchEntry(IndTimeSchEntry): 
    11201130 
     1131    fossilizes(IBreakTimeSchEntryFossil, IBreakTimeSchEntryMgmtFossil) 
    11211132    @Retrieves(['MaKaC.schedule.BreakTimeSchEntry'], 'entryType', lambda x: 'Break') 
    11221133    @Retrieves(['MaKaC.schedule.BreakTimeSchEntry'], 'conferenceId', lambda x: x.getOwner().getConference().getId()) 
     
    14181429class ContribSchEntry(LinkedTimeSchEntry): 
    14191430 
     1431    fossilizes(IContribSchEntryDisplayFossil, 
     1432               IContribSchEntryMgmtFossil ) 
     1433 
    14201434    @Retrieves (['MaKaC.schedule.ContribSchEntry'], 'entryType', lambda x: 'Contribution') 
    14211435    @Retrieves (['MaKaC.schedule.ContribSchEntry'], 'sessionId', Conversion.parentSession) 
     
    14551469 
    14561470    @staticmethod 
    1457     def processEntry(obj, tz, aw): 
    1458  
    1459         #raise "duration: " + (datetime(1900,1,1)+obj.getDuration()).strftime("%Hh%M'") + '' 
    1460         entry = DictPickler.pickle(obj, timezone=tz) 
     1471    def processEntry(obj, tz, aw, mgmtMode = False, useAttrCache = False): 
     1472 
     1473        if mgmtMode: 
     1474            if isinstance(obj, BreakTimeSchEntry): 
     1475                entry = obj.fossilize(IBreakTimeSchEntryMgmtFossil, useAttrCache = useAttrCache) 
     1476            elif isinstance(obj, ContribSchEntry): 
     1477                entry = obj.fossilize(IContribSchEntryMgmtFossil, useAttrCache = useAttrCache) 
     1478            elif isinstance(obj, LinkedTimeSchEntry): 
     1479                entry = obj.fossilize(ILinkedTimeSchEntryMgmtFossil, useAttrCache = useAttrCache) 
     1480            else: 
     1481                entry = obj.fossilize(useAttrCache = useAttrCache) 
     1482        else: 
     1483            # the fossils used for the display of entries 
     1484            # will be taken by default, since they're first 
     1485            # in the list of their respective Fossilizable 
     1486            # objects 
     1487            entry = obj.fossilize(useAttrCache = useAttrCache) 
    14611488 
    14621489        genId = entry['id'] 
     
    14711498            for contrib in sessionSlot.getSchedule().getEntries(): 
    14721499                if ScheduleToJson.checkProtection(contrib, aw): 
    1473                     contribData = DictPickler.pickle(contrib, timezone=tz) 
     1500                    if mgmtMode: 
     1501                        if isinstance(contrib, ContribSchEntry): 
     1502                            contribData = contrib.fossilize(IContribSchEntryMgmtFossil, useAttrCache = useAttrCache) 
     1503                        elif isinstance(contrib, BreakTimeSchEntry): 
     1504                            contribData = contrib.fossilize(IBreakTimeSchEntryMgmtFossil, useAttrCache = useAttrCache) 
     1505                        else: 
     1506                            contribData = contrib.fossilize(useAttrCache = useAttrCache) 
     1507                    else: 
     1508                        # the fossils used for the display of entries 
     1509                        # will be taken by default, since they're first 
     1510                        # in the list of their respective Fossilizable 
     1511                        # objects 
     1512                        contribData = contrib.fossilize(useAttrCache = useAttrCache) 
     1513 
    14741514                    entries[contribData['id']] = contribData 
    14751515 
     
    14971537        return canBeDisplayed 
    14981538 
    1499  
    15001539    @staticmethod 
    1501     def process(schedule, tz, aw, days = None): 
     1540    def process(schedule, tz, aw, days = None, mgmtMode = False, useAttrCache = False): 
    15021541 
    15031542        scheduleDict={} 
     
    15061545            days = daysBetween(schedule.getAdjustedStartDate(tz), schedule.getAdjustedEndDate(tz)) 
    15071546 
    1508         for day in days: 
    1509             dayEntry = {} 
    1510  
    1511             for obj in schedule.getEntriesOnDay(day): 
    1512  
    1513                 if ScheduleToJson.checkProtection(obj, aw): 
    1514                     genId, pickledData = ScheduleToJson.processEntry(obj, tz, aw) 
    1515  
    1516                     # exclude entries that start in the day before 
    1517                     if obj.getAdjustedStartDate(tz).date() == day.date(): 
    1518                         dayEntry[genId] = pickledData 
    1519  
    1520             scheduleDict[day.strftime("%Y%m%d")] = dayEntry 
     1547        dates = [d.strftime("%Y%m%d") for d in days] 
     1548 
     1549        # Generating the days dictionnary 
     1550        for d in dates: 
     1551            scheduleDict[d] = {} 
     1552 
     1553        # Filling the day dictionnary with entries 
     1554        for obj in schedule.getEntries(): 
     1555 
     1556            if ScheduleToJson.checkProtection(obj, aw): 
     1557                genId, resultData = ScheduleToJson.processEntry(obj, tz, aw, mgmtMode, useAttrCache) 
     1558                day = obj.getAdjustedStartDate(tz).strftime("%Y%m%d") 
     1559                # verify that start date is in dates 
     1560                if day in dates: 
     1561                    scheduleDict[day][genId] = resultData 
    15211562 
    15221563        return scheduleDict 
  • indico/MaKaC/services/implementation/schedule.py

    r021579 ra217dc  
    535535 
    536536            # retrieve results 
    537             pickledData = schedule.ScheduleToJson.process(self._schEntry.getSchedule(), self._conf.getTimezone(), None, days = [self._schEntry.getAdjustedStartDate()]) 
     537            pickledData = schedule.ScheduleToJson.process(self._schEntry.getSchedule(), self._conf.getTimezone(), 
     538                                                          None, days = [self._schEntry.getAdjustedStartDate()], 
     539                                                          mgmtMode = True) 
    538540            entryId = pickledData.keys()[0] 
    539541            pickledData = pickledData.values()[0] 
    540542        else: 
    541             entryId, pickledData = schedule.ScheduleToJson.processEntry(self._schEntry, self._conf.getTimezone(), None) 
     543            entryId, pickledData = schedule.ScheduleToJson.processEntry(self._schEntry, self._conf.getTimezone(), 
     544                                                                        None, mgmtMode = True) 
    542545 
    543546        return {'day': self._schEntry.getAdjustedStartDate().strftime("%Y%m%d"), 
     
    663666        else: 
    664667            schEntry = self._slot.getConfSchEntry() 
    665         entryId, pickledData = schedule.ScheduleToJson.processEntry(schEntry, self._conf.getTimezone(), None) 
     668        entryId, pickledData = schedule.ScheduleToJson.processEntry(schEntry, self._conf.getTimezone(), 
     669                                                                    None, mgmtMode = True) 
    666670 
    667671        return {'day': schEntry.getAdjustedStartDate().strftime("%Y%m%d"), 
     
    10501054            sched.moveDownEntry(schEntry) 
    10511055 
    1052         return schedule.ScheduleToJson.process(sched, self._conf.getTimezone(), None, days = [ schEntry.getAdjustedStartDate() ]) 
     1056        return schedule.ScheduleToJson.process(sched, self._conf.getTimezone(), None, 
     1057                                               days = [ schEntry.getAdjustedStartDate() ], 
     1058                                               mgmtMode = True) 
    10531059 
    10541060 
  • indico/MaKaC/webinterface/meeting.py

    rbdd862 ra217dc  
    884884class WPMConfModifSchedule(conferences.WPConfModifScheduleGraphic): 
    885885    pass 
    886  
    887 class WMConfModifSchedule(conferences.WConfModifScheduleGraphic): 
    888  
    889     def __init__(self, conf, aw, timetable, days): 
    890         conferences.WConfModifScheduleGraphic.__init__(self, conf, aw, timetable, days, tpl_name='ConfModifScheduleGraphic') 
    891886 
    892887## Add Contributions to main meeting ## 
  • indico/MaKaC/webinterface/pages/conferences.py

    r0a4b4c ra217dc  
    11541154        vars = wcomponents.WTemplated.getVars( self ) 
    11551155        tz = DisplayTZ(self._aw,self._conf).getDisplayTZ() 
    1156         vars["ttdata"] = simplejson.dumps(schedule.ScheduleToJson.process(self._conf.getSchedule(), tz, self._aw)) 
     1156        vars["ttdata"] = simplejson.dumps(schedule.ScheduleToJson.process(self._conf.getSchedule(), 
     1157                                                                          tz, self._aw, 
     1158                                                                          useAttrCache = True)) 
    11571159        vars['eventInfo'] = simplejson.dumps(DictPickler.pickle(self._conf, timezone=tz)) 
    11581160        return vars 
     
    31433145class WConfModifScheduleGraphic(wcomponents.WTemplated): 
    31443146 
    3145     def __init__(self, conference, aw, timetable, dayList, **params): 
     3147    def __init__(self, conference, **params): 
    31463148        wcomponents.WTemplated.__init__(self, **params) 
    31473149        self._conf = conference 
    3148         self._aw = aw 
    3149         self._timetable = timetable 
    3150         self._dayList = dayList 
    31513150 
    31523151    def getVars( self ): 
     
    31643163        vars["editURL"]=quoteattr(str(urlHandlers.UHConfModScheduleDataEdit.getURL(self._conf))) 
    31653164 
    3166         # the list of days specified by the user through the option box 
    3167         vars["daysParam"] = self._dayList 
    3168         # the list of days from the timetable 
    3169         vars["dayList"]=self._timetable.getDayList() 
    3170         # the first day of the list 
    3171         vars["dayDate"]=self._dayList[0].getDate() 
    3172  
    3173         vars["addSessionURL"]=urlHandlers.UHConfAddSession.getURL(self._conf) 
    3174         vars["addBreakURL"]=urlHandlers.UHConfAddBreak.getURL(self._conf) 
    3175  
    3176         originURL = urlHandlers.UHConfModifSchedule.getURL(self._conf) 
    3177         newContribURL = urlHandlers.UHConfModScheduleNewContrib.getURL(self._conf) 
    3178         newContribURL.addParam("originURL",originURL) 
    3179         newContribURL.addParam("eventType","meeting") 
    3180         vars["newContribURL"] = newContribURL 
    3181         vars['rbActive'] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getRoomBookingModuleActive() 
    3182  
    3183         vars['ttdata'] = simplejson.dumps(schedule.ScheduleToJson.process(self._conf.getSchedule(), tz, None)) 
     3165        vars['ttdata'] = simplejson.dumps(schedule.ScheduleToJson.process(self._conf.getSchedule(), tz, None, 
     3166                                                                          days = None, mgmtMode = True)) 
    31843167        vars['eventInfo'] = simplejson.dumps(DictPickler.pickle(self._conf, timezone=tz)) 
    31853168 
     
    31923175    def __init__(self, rh, conf): 
    31933176        WPConferenceModifBase.__init__(self, rh, conf) 
    3194         self._session = None 
    31953177        self._contrib = None 
    31963178 
     
    32023184               self._includeJSPackage('Timetable') 
    32033185 
    3204     def _generateTimetable(self): 
    3205         tz = self._conf.getTimezone() 
    3206         timeTable = timetable.TimeTable(self._conf.getSchedule(), tz) 
    3207         ####################################### 
    3208         # Fermi timezone awareness            # 
    3209         ####################################### 
    3210         sDate = self._conf.getSchedule().getStartDate(tz) 
    3211         eDate = self._conf.getSchedule().getEndDate(tz) 
    3212         ####################################### 
    3213         # Fermi timezone awareness(end)       # 
    3214         ####################################### 
    3215         timeTable.setStartDate(sDate) 
    3216         timeTable.setEndDate(eDate) 
    3217         #timeTable.setStartDayTime(7,0) 
    3218         #timeTable.setEndDayTime(21,59) 
    3219         timeTable.mapEntryList(self._conf.getSchedule().getEntries()) 
    3220  
    3221         return timeTable 
    3222  
    3223     def _getSchedule(self): 
    3224         return WConfModifScheduleGraphic( self._conf, self._getAW(), self._timetable, self._days) 
    3225  
    32263186    def _getTTPage( self, params ): 
    3227  
    3228         params["session"] = self._session 
    3229  
    3230         days = params.get("days", None) 
    3231  
    3232         timeTable= self._generateTimetable() 
    3233  
    3234         if days == None or days == 'all': 
    3235             dayList = timeTable.getDayList() 
    3236         else: 
    3237             dayList = [timeTable.getDayList()[int(days)]] 
    3238  
    3239         self._days = dayList 
    3240         self._timetable = timeTable 
    3241  
    3242         wc = self._getSchedule() 
     3187        wc = WConfModifScheduleGraphic( self._conf) 
    32433188        return wc.getHTML(params) 
    32443189 
  • indico/MaKaC/webinterface/pages/sessions.py

    r8989f6 ra217dc  
    14981498        vars['rbActive'] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getRoomBookingModuleActive() 
    14991499 
    1500         vars['ttdata'] = simplejson.dumps(schedule.ScheduleToJson.process(self._session.getSchedule(), tz, None)) 
     1500        vars['ttdata'] = simplejson.dumps(schedule.ScheduleToJson.process(self._session.getSchedule(), tz, 
     1501                                                                           None, days = None, mgmtMode = True)) 
    15011502 
    15021503        eventInfo = DictPickler.pickle(self._session.getConference(), timezone=tz) 
  • indico/MaKaC/webinterface/timetable.py

    rbdd862 ra217dc  
    2929 
    3030class TimeTable(object): 
    31      
     31 
    3232    def __init__( self, schedule, tz = 'UTC'): 
    3333        self.setSlotLengthInMin(5) 
     
    3737        self._sch = schedule 
    3838        #self.listEntries = schedule.getEntries() 
    39         self._tz = tz          
     39        self._tz = tz 
    4040        self.mapEntryList(self._sch.getEntries()) 
    4141 
    4242 
    43          
    44  
    45          
     43 
     44 
     45 
    4646    def setStartDate( self, date): 
    4747        self.__startDate = date 
     
    4949    def getStartDate( self ): 
    5050        return self.__startDate 
    51      
     51 
    5252    def setEndDate( self, date ): 
    5353        self.__endDate = date 
    54      
     54 
    5555    def getEndDate( self ): 
    5656        return self.__endDate 
     
    6464    def setSlotLengthInMin( self, minutes ): 
    6565        self._slotLength = timedelta( minutes=int(minutes) ) 
    66      
     66 
    6767    def getSlotLength( self ): 
    6868        return self._slotLength 
     
    7171        self._days = [] 
    7272        iDate = self.getStartDate() 
    73         eDate = self.getEndDate()  
     73        eDate = self.getEndDate() 
    7474        dayDict = {} 
    7575        dayList = [] 
    76          
     76 
    7777        while iDate.date()<=eDate.date(): 
    7878            sTime = timedelta(hours=8) 
    7979            eTime = timedelta(hours=18, minutes=59) 
    80             if self._sch:  
     80            if self._sch: 
    8181                s = self._sch.calculateDayStartDate(iDate) 
    8282                schSTime = timedelta(hours=s.hour) 
     
    9595    def reGenerate( self ): 
    9696        self.__initialise() 
    97      
     97 
    9898    def getDayList( self ): 
    9999        return self._days 
     
    103103        for day in self.getDayList(): 
    104104            day.clean() 
    105         #to be optimised 
    106         for day in self.getDayList(): 
    107             day.mapEntryList( entryList )  
    108  
     105            day.mapEntryList( entryList ) 
    109106 
    110107    def mapContainerList( self, containerList ): 
     
    128125 
    129126class Day(object): 
    130      
     127 
    131128    # def __init__( self, date, startTime, endTime, slotLength): 
    132129        # self.__date = date.replace(hour=0,minute=0,second=0) 
     
    150147            # self.__slots.append( TimeSlot( sDate, eDate ) ) 
    151148            # iTime = iTime + slotLength 
    152            
     149 
    153150 
    154151    # def getStartHour( self ): 
     
    157154        # except: 
    158155            # return 23 
    159      
     156 
    160157    # def getEndHour( self ): 
    161158        # try: 
     
    186183    # def mapContainerList( self, l ): 
    187184        ##to be MUCH optimised 
    188          
     185 
    189186        # for sesSlot in l: 
    190187            # entryList = [] 
     
    193190            # container = Container(sesSlot) 
    194191            # container.setEntries(entryList) 
    195             # if entryList:  
     192            # if entryList: 
    196193                # for entry in entryList: 
    197194                    # for slot in self.getSlotList(): 
     
    233230                        # if slot.getEntryList() != []: 
    234231                            # slot.mapContainer(container) 
    235             # else:  
     232            # else: 
    236233                # for slot in self.getSlotList(): 
    237234                    # slot.mapEntry(session) 
     
    270267                # return self.getSlotList()[i+1] 
    271268        # return None 
    272      
     269 
    273270 
    274271    # def hasEntryOverlaps(self,entry): 
     
    367364                # max = num 
    368365        # return max 
    369   
     366 
    370367    def __init__( self, date, startTime, endTime, slotLength): 
    371368        self.__date = date.replace(hour=0,minute=0,second=0) 
     
    392389            self.__slots.append( TimeSlot( sDate, eDate ) ) 
    393390            iTime = iTime + slotLength 
    394            
     391 
    395392 
    396393    def getStartHour( self ): 
     
    399396        except: 
    400397            return 23 
    401      
     398 
    402399    def getEndHour( self ): 
    403400        try: 
     
    422419    def getEntryList(self ): 
    423420        return self.__entries 
    424          
     421 
    425422 
    426423    def addEntry(self, entry): 
     
    444441    def mapContainerList( self, l ): 
    445442        # to be MUCH optimised 
    446          
     443 
    447444        for sesSlot in l: 
    448445            entryList = [] 
     
    451448            container = Container(sesSlot) 
    452449            container.setEntries(entryList) 
    453             if entryList:  
     450            if entryList: 
    454451                for entry in entryList: 
    455452                    for slot in self.getSlotList(): 
     
    491488                        if slot.getEntryList() != []: 
    492489                            slot.mapContainer(container) 
    493             else:  
     490            else: 
    494491                for slot in self.getSlotList(): 
    495492                    slot.mapEntry(session) 
     
    528525                return self.getSlotList()[i+1] 
    529526        return None 
    530      
     527 
    531528 
    532529    def hasEntryOverlaps(self,entry): 
     
    624621            if max < num: 
    625622                max = num 
    626         return max                
     623        return max 
    627624 
    628625class TimeSlot(object): 
    629      
     626 
    630627    def __init__( self, startDateTime, endDateTime ): 
    631628        self.__start = startDateTime 
     
    634631        self._containers = [] 
    635632        self._header = False 
    636         self._footer = False  
     633        self._footer = False 
    637634        self._tz = startDateTime.tzinfo 
    638635 
    639636    def getStartDate( self ): 
    640637        return self.__start 
    641      
     638 
    642639    def getAdjustedStartDate( self, tz=None ): 
    643640        if not tz: 
     
    646643            tz = timezone(tz) 
    647644        return self.__start.astimezone(tz) 
    648      
     645 
    649646    def getEndDate( self ): 
    650647        return self.__end 
     
    656653            tz = timezone(tz) 
    657654        return self.__end.astimezone(tz) 
    658      
     655 
    659656    def getTZ( self ): 
    660657        return self._tz 
     
    696693            l.append( entry.getTitle() ) 
    697694        return "; ".join( l ) 
    698      
     695 
    699696    def getNumEntriesOverlaped(self): 
    700697        return len(self.__entries) 
     
    743740    def hasHeaders(self): 
    744741        return self._header 
    745      
     742 
    746743    def hasFooters(self): 
    747744        return self._footer 
     
    769766 
    770767class Container(object): 
    771      
     768 
    772769    def __init__(self, sesSlot ): 
    773770        self._sesSlot = sesSlot 
     
    800797    def getStartDate(self): 
    801798        return self._sesSlot.getStartDate() 
    802      
     799 
    803800    def getAdjustedStartDate(self, tz=None): 
    804801        return self._sesSlot.getAdjustedStartDate(tz) 
    805      
     802 
    806803    def getEndDate(self): 
    807804        return self._sesSlot.getEndDate() 
     
    809806    def getAdjustedEndDate(self, tz=None): 
    810807        return self._sesSlot.getAdjustedEndDate(tz) 
    811      
     808 
    812809    def getRoom(self): 
    813810        return self._sesSlot.getRoom() 
     
    845842        # lastSlot is a day object which is not timezone aware. 
    846843        d = lastSlot.getStartDate().astimezone(timezone(tz)) 
    847         lastSlotStartDate = d.astimezone(timezone(tz))  
     844        lastSlotStartDate = d.astimezone(timezone(tz)) 
    848845        if lastSlot: 
    849846            return entry.getEndDate() > lastSlotStartDate 
     
    870867 
    871868class PlainTimeTable(object): 
    872      
     869 
    873870    def __init__( self, schedule=None, tz = 'UTC' ): 
    874871        self._tz = tz 
     
    879876    def getTZ(self): 
    880877        return self._tz 
    881   
     878 
    882879    def setStartDate( self, date): 
    883880        self._startDate = date 
     
    885882    def getStartDate( self ): 
    886883        return self._startDate 
    887      
     884 
    888885    def setEndDate( self, date): 
    889886        self._endDate = date 
    890      
     887 
    891888    def getEndDate( self ): 
    892889        return self._endDate 
     
    915912 
    916913class PlainDay(object): 
    917      
     914 
    918915    def __init__( self, date ): 
    919916        self._date = date 
     
    936933        # to be MUCH optimised 
    937934        addedSessions = [] 
    938         lastIndex=-1  
     935        lastIndex=-1 
    939936        tz = self.getTZ() 
    940937        for entry in l: 
     
    955952 
    956953class SessionSlot(object): 
    957      
     954 
    958955    def __init__(self,sesSlot,day): 
    959956        self._sesSlot=sesSlot 
     
    10341031 
    10351032class ConfEntry(object): 
    1036      
     1033 
    10371034    def __init__(self, entry): 
    10381035        self._entry = entry 
  • indico/htdocs/js/indico/Timetable/Base.js

    r2d7696 ra217dc  
    869869            (result.entry.endDate.time.replaceAll(':','') > 
    870870             this.eventInfo.endDate.time.replaceAll(':',''))) { 
    871             this.eventInfo.endDate.time = result.endTime; 
     871            this.eventInfo.endDate.time = result.entry.endDate.time; 
    872872        } 
    873873 
Note: See TracChangeset for help on using the changeset viewer.