function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def desactiveCFA(self): self._activated = False
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addAuthorizedSubmitter(self, av): try: if self._authorizedSubmitter: pass except AttributeError: self._authorizedSubmitter = PersistentList() if not av in self._authorizedSubmitter: self._authorizedSubmitter.append(av)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getCFAStatus(self): return self._activated
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def isActive(self): return self._activated
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getStartSubmissionDate(self): return timezone(self.getTimezone()).localize(self._submissionStartDate)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getEndSubmissionDate(self): return timezone(self.getTimezone()).localize(self._submissionEndDate)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getModificationDeadline(self): """Returns the deadline for modifications on the submitted abstracts. """ try: if self._modifDeadline: pass except AttributeError, e: self._modifDeadline = None if self._modifDeadline is not None: ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def inModificationPeriod(self, date=None): """Tells whether is possible to modify a submitted abstract in a certain date. """ if date is None: date = nowutc() if not self.getModificationDeadline(): return True return date <= self.getModificatio...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setAnnouncement(self, newAnnouncement): self._announcement = newAnnouncement.strip()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def newAbstract(self, av, **data): """Creates a new abstract under this manager """ from indico.modules.events.contributions import Contribution new_abstract = self._new_abstract(self.getConference().as_event) # sanity checks to avoid collisions assert str(new_abstract.id...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def removeAbstract(self, abstract): if self._abstracts.has_key(abstract.getId()): #for auth in abstract.getPrimaryAuthorList(): # self.unindexAuthor(auth) # * Remove dependencies with another abstracts: # - If it's an accepted abstract-->remove abstract f...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getAbstractList(self): return self._abstracts.values()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def registerParticipation(self, p): self._participationIdx.index(p)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getAbstractListForAvatar(self, av): try: if self._participationIdx: pass except AttributeError, e: self._participationIdx = self._partipationIdx self._partipationIdx = None res = [] for participation in self._participationIdx.getPar...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getNotificationTplList(self): try: if self._notifTpls: pass except AttributeError: self._notifTpls = IOBTree() try: if self._notifTplsOrder: pass except AttributeError: self._notifTplsOrder = PersistentLi...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def removeNotificationTpl(self, tpl): try: if self._notifTpls: pass except AttributeError: self._notifTpls = IOBTree() try: if self._notifTplsOrder: pass except AttributeError: self._notifTplsOrder = Persiste...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getNotificationTplById(self, id): try: if self._notifTpls: pass except AttributeError: self._notifTpls = IOBTree() return self._notifTpls.get(int(id), None)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def moveUpNotifTpl(self, tpl): """ """ try: if self._notifTplsOrder: pass except AttributeError: self._notifTplsOrder = PersistentList() for tpl in self._notifTpls.values(): self._notifTplsOrder.append(tpl) if tp...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def indexAuthor(self, auth): a = auth.getAbstract() if a.isPrimaryAuthor(auth): self._getPrimAuthIndex().index(auth) self._getAuthEmailIndex().index(auth)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _getPrimAuthIndex(self): try: if self._primAuthIdx: pass except AttributeError: self._primAuthIdx = _PrimAuthIdx(self) return self._primAuthIdx
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getAbstractsMatchingAuth(self, query, onlyPrimary=True): if str(query).strip() == "": return self.getAbstractList() res = self._getPrimAuthIndex().match(query) return [self.getAbstractById(id) for id in res]
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def hasEnabledAbstractField(self, key): return self.getAbstractFieldsMgr().hasActiveField(key)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setSubmissionNotification(self, sn): self._submissionNotification = sn
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def removeAnswersOfQuestion(self, questionId): ''' Remove a question results for each abstract ''' for abs in self.getAbstractList(): abs.removeAnswersOfQuestion(questionId)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def __init__(self): self._toList = PersistentList() self._ccList = PersistentList()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getToList(self): return self._toList
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addToList(self, to): self._toList.append(to)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getCCList(self): return self._ccList
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addCCList(self, cc): self._ccList.append(cc)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clone(self): nsn = SubmissionNotification() for i in self.getToList(): nsn.addToList(i) for i in self.getCCList(): nsn.addCCList(i) return nsn
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def __init__(self, res, content=""): self._abstract = None self._id = "" self._responsible = res self._content = "" self._creationDate = nowutc() self._modificationDate = nowutc()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def includeInAbstract(self, abstract, id): self._abstract = abstract self._id = id
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def recover(self): TrashCanManager().remove(self)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getResponsible(self): return self._responsible
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getId(self): return self._id
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setContent(self, newContent): self._content = newContent self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getModificationDate(self): return self._modificationDate
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def canUserModify(self, user): abstract = self.getAbstract() conf = abstract.getConference() return self.getResponsible() == user and \ (abstract.canUserModify(user) or \ len(conf.getConference().getCoordinatedTracks(user)) > 0)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def __init__(self, owner, id, submitter, **abstractData): self._setOwner( owner ) self._setId( id ) self._title = "" self._authorGen = Counter() self._authors = OOBTree() self._primaryAuthors = PersistentList() self._coAuthors = PersistentList() self._spea...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clone(self, conference, abstractId): # abstractId - internal in abstract manager of the conference abs = Abstract(conference.getAbstractMgr(), abstractId, self.getSubmitter().getAvatar()) abs.setTitle(self.getTitle()) for key in self.getFields().keys(): abs.setField(key,...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getMergeFromList(self): try: return self._mergeFromList except AttributeError: self._mergeFromList = PersistentList() return self._mergeFromList
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def removeMergeFromAbstract(self, abstract): try: if self._mergeFromList: pass except AttributeError: self._mergeFromList = PersistentList() if abstract in self._mergeFromList: self._mergeFromList.remove(abstract)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setComments(self, comments): self._comments = comments
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def saveFiles(self, files): cfg = Config.getInstance() from MaKaC.conference import LocalFile for fileUploaded in files: if fileUploaded.filename: # create a temp file tempPath = cfg.getUploadedFilesTempDir() tempFileName = tempfile.mks...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _deleteFile(self, key): file = self.getAttachments()[key] file.delete() del self.getAttachments()[key] self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getOwner( self ): return self._owner
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getId(self): return self._id
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setModificationDate(self, dt = None): if dt: self._modificationDate = dt else: self._modificationDate = nowutc()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getModificationDate( self ): return self._modificationDate
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def recoverSubmitter(self, subm): if not subm: raise MaKaCError( _("An abstract must have a submitter")) if self._submitter: self.getOwner().unregisterParticipation( self._submitter ) self._submitter.delete() self._submitter = subm self._submitter.setA...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getSubmitter( self ): return self._submitter
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def setTitle(self, title): self._title = title.strip() self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def title(self): return self._title
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getConference( self ): mgr = self.getOwner() return mgr.getOwner() if mgr else None
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _removeAuthor(self,part): if not self.isAuthor(part): return part.delete() del self._authors[part.getId()]
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getAuthorList( self ): return self._authors.values()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clearAuthors( self ): self.clearPrimaryAuthors() self.clearCoAuthors() self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def isPrimaryAuthor( self, part ): return part in self._primaryAuthors
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getPrimaryAuthorEmailList(self, lower=False): emailList = [] for pAuthor in self.getPrimaryAuthorList(): emailList.append(pAuthor.getEmail().lower() if lower else pAuthor.getEmail()) return emailList
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _addPrimaryAuthor( self, part ): if not self.isAuthor( part ): raise MaKaCError( _("The participation you want to set as primary author is not an author of the abstract")) if part in self._primaryAuthors: return self._primaryAuthors.append( part ) self.getOwne...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def recoverPrimaryAuthor(self, auth): self._authors[ auth.getId() ] = auth auth.setAbstract(self) self._addPrimaryAuthor(auth) auth.recover() self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _comp_CoAuthors(self): try: if self._coAuthors!=None: return except AttributeError: self._coAuthors=PersistentList() for auth in self._authors.values(): if not self.isPrimaryAuthor(auth): self._addCoAuthor(auth)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getCoAuthorList( self ): self._comp_CoAuthors() return self._coAuthors
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clearCoAuthors(self): while len(self._coAuthors)>0: self._removeCoAuthor(self._coAuthors[0]) self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _removeCoAuthor(self,part): if not self.isCoAuthor(part): return if self.isSpeaker(part): self.removeSpeaker(part) self._coAuthors.remove(part) self._removeAuthor(part)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addSpeaker( self, part ): if not self.isAuthor( part ): raise MaKaCError( _("The participation you want to set as speaker is not an author of the abstract")) if part in self._speakers: return self._speakers.append( part ) self._notifyModification()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clearSpeakers( self ): while len(self.getSpeakerList()) > 0: self.removeSpeaker(self.getSpeakerList()[0]) self._speakers = PersistentList()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def isSpeaker( self, part ): return part in self._speakers
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addTrack( self, track ): self._changeTracksImpl() if not self._tracks.has_key( track.getId() ): self._addTrack( track ) self.getCurrentStatus().update()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def removeTrack( self, track ): if self._tracks.has_key( track.getId() ): self._removeTrack( track ) self.getCurrentStatus().update() if isinstance(self.getCurrentStatus(), AbstractStatusAccepted): self.getCurrentStatus()._setTrack(None)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getTrackList( self ): self._changeTracksImpl() return self._tracks.values()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def hasTrack( self, track ): self._changeTracksImpl() return self._tracks.has_key( track.getId() )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clearTracks( self ): self._changeTracksImpl() while len(self.getTrackList())>0: track = self.getTrackList()[0] self._removeTrack( track ) self.getCurrentStatus().update()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def isProposedForTrack( self, track ): return self._tracks.has_key( track.getId() )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getLocator(self): loc = self.getConference().getLocator() loc["abstractId"] = self.getId() return loc
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def canAuthorAccess(self, user): if user is None: return False el = self.getCoAuthorEmailList(True)+self.getPrimaryAuthorEmailList(True) for e in user.getEmails(): if e.lower() in el: return True return False
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def canAccess(self, aw): #if the conference is protected, then only allowed AW can access return self.isAllowedToAccess(aw.getUser())
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def canModify(self, aw_or_user): if hasattr(aw_or_user, 'getUser'): aw_or_user = aw_or_user.getUser() return self.canUserModify(aw_or_user)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getModifKey(self): return ""
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getAccessController(self): return self.getConference().getAccessController()
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def delete(self): if self._owner: self.getOwner().unregisterParticipation(self._submitter) self._submitter.getUser().unlinkTo(self, "submitter") self._submitter.delete() self._submitter = None self.clearAuthors() self.clearSpeakers() ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getCurrentStatus(self): try: if self._currentStatus: pass except AttributeError, e: self._currentStatus = AbstractStatusSubmitted(self) return self._currentStatus
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def accept(self, responsible, destTrack, type, comments="", session=None): """ """ self.getCurrentStatus().accept(responsible, destTrack, type, comments) # add the abstract to the track for which it has been accepted so it # is visible for it. if destTrack is not None: ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _cmpByDate(self, tj1, tj2): return cmp(tj1.getDate(), tj2.getDate())
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getJudgementHistoryByTrack(self, track): id = "notrack" if track is not None: id = track.getId() if self.getTrackJudgementsHistorical().has_key(id): return self.getTrackJudgementsHistorical()[id] return []
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _removeTrackAcceptance( self, track ): """ """ if self.getTrackAcceptances().has_key( track.getId() ): del self.getTrackAcceptances()[ track.getId() ]
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _removeTrackRejection( self, track ): """ """ if self.getTrackRejections().has_key( track.getId() ): del self.getTrackRejections()[ track.getId() ]
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _removeTrackReallocation( self, track ): """ """ if self.getTrackReallocations().has_key( track.getId() ): del self.getTrackReallocations()[ track.getId() ]
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _clearTrackRejections( self ): while len(self.getTrackRejections().values())>0: t = self.getTrackRejections().values()[0].getTrack() self._removeTrackRejection( t )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _clearTrackReallocations( self ): while len(self.getTrackReallocations().values())>0: t = self.getTrackReallocations().values()[0].getTrack() self._removeTrackReallocation(t)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def proposeToAccept( self, responsible, track, contribType, comment="", answers=[] ): """ """ # the proposal has to be done for a track if track is None: raise MaKaCError( _("You have to choose a track in order to do the proposal. If there are not tracks to select, please cha...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def proposeForOtherTracks( self, responsible, track, comment, propTracks, answers=[] ): """ """ #We check the track which proposes to allocate the abstract is in the # current abstract if not self.isProposedForTrack( track ): raise MaKaCError( _("Cannot propose to r...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def recover( self ): """Puts a withdrawn abstract back in the list of submitted abstracts. HAS NOTHING TO DO WITH THE RECOVERY PROCESS... """ #we must clear any track judgement #self._clearTrackAcceptances() #self._clearTrackRejections() #self._clearTrackReallo...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getTrackAcceptances( self ): try: if self._trackAcceptances: pass except AttributeError, e: self._trackAcceptances = OOBTree() return self._trackAcceptances
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getNumProposedToAccept( self ): return len( intersection( self._tracks, self.getTrackAcceptances() ) )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getNumProposedToReject( self ): return len( intersection( self._tracks, self.getTrackRejections() ) )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getNumProposedToReallocate( self ): return len( intersection( self._tracks, self.getTrackReallocations() ) )
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def getReallocationTargetedList( self, track ): #XXX: not optimal res = [] for r in self.getTrackReallocations().values(): if track in r.getProposedTrackList(): res.append( r ) return res
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def addIntComment(self,newComment): try: if self._intComments: pass except AttributeError: self._intComments=PersistentList() try: if self._intCommentsGen: pass except AttributeError: self._intCommentsGen=Cou...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def clearIntCommentList(self): while len(self.getIntCommentList()) > 0: self.removeIntComment(self.getIntCommentList()[0])
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]