本文整理汇总了Python中MaKaC.services.implementation.base.ParameterManager类的典型用法代码示例。如果您正苦于以下问题:Python ParameterManager类的具体用法?Python ParameterManager怎么用?Python ParameterManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParameterManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _checkParams
def _checkParams(self):
pm = ParameterManager(self._params)
userId = pm.extract("userId", str, False, "")
self._currentUser = self.getAW().getUser()
self._target = self._avatar = user.AvatarHolder().getById(userId)
if self._target == None:
raise ServiceAccessError((_("The user with does not exist")))
开发者ID:bubbas,项目名称:indico,代码行数:7,代码来源:user.py
示例2: _checkParams
def _checkParams(self):
CollaborationBase._checkParams(self)
pm = ParameterManager(self._params)
self._bookingType = pm.extract("type", pType=str, allowEmpty=False)
self._query = pm.extract("query", pType=str, allowEmpty=False)
self._limit = pm.extract("limit", pType=int, allowEmpty=True, defaultValue=None)
self._offset = pm.extract("offset", pType=int, allowEmpty=True, defaultValue=0)
开发者ID:Ictp,项目名称:indico,代码行数:7,代码来源:services.py
示例3: _checkParams
def _checkParams(self):
CategoryControlUserListBase._checkParams(self)
pm = ParameterManager(self._params)
self._principals = [
principal_from_fossil(f, allow_pending=True) for f in pm.extract("userList", pType=list, allowEmpty=False)
]
self._sendEmailManagers = pm.extract("sendEmailManagers", pType=bool, allowEmpty=True, defaultValue=True)
开发者ID:MichelCordeiro,项目名称:indico,代码行数:7,代码来源:category.py
示例4: _checkParams
def _checkParams(self):
AdminService._checkParams(self)
pm = ParameterManager(self._params)
self._userId = pm.extract("userId", pType=str, allowEmpty=False)
self._av = AvatarHolder().getById(self._userId)
if self._av == None:
raise ServiceError("ER-U0", _("Cannot find user with id %s") % self._userId)
开发者ID:aninhalacerda,项目名称:indico,代码行数:7,代码来源:admin.py
示例5: _checkParams
def _checkParams(self):
AbstractReviewingBase._checkParams(self)
pm = ParameterManager(self._params)
self._trackId = pm.extract("track", pType=str, allowEmpty=False)
self._reviewerId = pm.extract("userId", pType=str, allowEmpty=True, defaultValue=None)
if (self._reviewerId == None):
self._reviewerId = pm.extract("user", pType=str, allowEmpty=False)
开发者ID:dbourillot,项目名称:indico,代码行数:7,代码来源:abstractReviewing.py
示例6: _checkParams
def _checkParams(self):
ConferenceChairPersonBase._checkParams(self)
pm = ParameterManager(self._params)
self._userData = pm.extract("userData", pType=dict, allowEmpty=False)
self._chairId = pm.extract("userId", pType=str, allowEmpty=False)
if self._userData.get("email", "") != "" and self._isEmailAlreadyUsed():
raise ServiceAccessError(_("The email address is already used by another chairperson. Chairperson not modified."))
开发者ID:hennogous,项目名称:indico,代码行数:7,代码来源:conference.py
示例7: _checkParams
def _checkParams(self):
ConferenceModifBase._checkParams(self)
pm = ParameterManager(self._params)
submitterId = pm.extract("submitterId", pType=str, allowEmpty=False)
abstractId = pm.extract("abstractId", pType=str, allowEmpty=False)
self._abstract = self._conf.getAbstractMgr().getAbstractById(abstractId)
self._submitter = user.AvatarHolder().getById(submitterId)
开发者ID:aninhalacerda,项目名称:indico,代码行数:7,代码来源:abstracts.py
示例8: _checkParams
def _checkParams(self):
AdminService._checkParams(self)
pm = ParameterManager(self._params)
user_id = pm.extract("userId", pType=int, allowEmpty=False)
self._user = User.get(user_id)
if self._user is None:
raise NoReportError(_("The user that you are trying to login as does not exist anymore in the database"))
开发者ID:MichelCordeiro,项目名称:indico,代码行数:7,代码来源:admin.py
示例9: _checkParams_POST
def _checkParams_POST(self):
defaultArrivalOffset = [-2, 0]
defaultDepartureOffset = [1, 3]
post_pm = ParameterManager(decode(request.data))
self._arrivalOffsetDates = post_pm.extract(
'arrivalOffsetDates',
pType=list,
allowEmpty=False,
defaultValue=defaultArrivalOffset)
self._departureOffsetDates = post_pm.extract(
'departureOffsetDates',
pType=list,
allowEmpty=False,
defaultValue=defaultDepartureOffset)
self._items = post_pm.extract('items', pType=list, allowEmpty=False)
if (len(self._arrivalOffsetDates) != 2 or
self._arrivalOffsetDates[0] == '' or
self._arrivalOffsetDates[1] == ''):
self._arrivalOffsetDates = defaultArrivalOffset
if (len(self._departureOffsetDates) != 2 or
self._departureOffsetDates[0] == '' or
self._departureOffsetDates[1] == ''):
self._departureOffsetDates = defaultDepartureOffset
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:25,代码来源:registrationFormModif.py
示例10: _checkParams
def _checkParams(self):
AdminService._checkParams(self)
pm = ParameterManager(self._params)
self._userId = pm.extract("userId", pType=str, allowEmpty=False)
self._av = AvatarHolder().getById(self._userId)
if self._av == None:
raise NoReportError(_("The user that you are trying to login as does not exist anymore in the database"))
开发者ID:Ictp,项目名称:indico,代码行数:7,代码来源:admin.py
示例11: _checkParams
def _checkParams(self):
ConferenceModifBase._checkParams(self)
pm = ParameterManager(self._params.get("value"), timezone=self._conf.getTimezone())
self._startDate = pm.extract("startDate", pType=datetime.datetime)
self._endDate = pm.extract("endDate", pType=datetime.datetime)
开发者ID:lukasnellen,项目名称:indico,代码行数:8,代码来源:conference.py
示例12: AgentModificationService
class AgentModificationService(AdminService):
def _checkParams(self):
self._pm = ParameterManager(self._params)
self._id = self._pm.extract("id", pType=str)
self._name = self._pm.extract("name", pType=str)
self._description = self._pm.extract("description", pType=str)
self._specificParams = self._params["specific"]
开发者ID:aninhalacerda,项目名称:indico,代码行数:8,代码来源:handlers.py
示例13: _checkParams
def _checkParams(self):
ConferenceModifBase._checkParams(self)
pm = ParameterManager(self._params)
ah = AvatarHolder()
userId = pm.extract("userId", pType=str, allowEmpty=False)
self._user = ah.getById(userId)
if self._user == None:
raise ServiceError("ERR-U0", _("User '%s' does not exist.") % userId)
开发者ID:NIIF,项目名称:indico,代码行数:8,代码来源:abstracts.py
示例14: _checkParams
def _checkParams(self):
AdminService._checkParams(self)
pm = ParameterManager(self._params)
self._title = pm.extract("title", pType=str, allowEmpty=False)
self._type = pm.extract("type", pType=str, allowEmpty=False)
self._content = pm.extract("content", pType=str, allowEmpty=True)
开发者ID:davidmorrison,项目名称:indico,代码行数:8,代码来源:news.py
示例15: _checkParams
def _checkParams(self):
pManager = ParameterManager(self._params)
self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
self._code = pManager.extract("code", pType=str, allowEmpty=True)
self._message = pManager.extract("message", pType=str, allowEmpty=True)
inner = self._params.get('inner', '')
self._inner = '\n'.join(inner) if isinstance(inner, list) else inner
self._requestInfo = pManager.extract("requestInfo", pType=dict)
开发者ID:k3njiy,项目名称:indico,代码行数:8,代码来源:error.py
示例16: _checkParams
def _checkParams(self):
SessionConvenersBase._checkParams(self)
pm = ParameterManager(self._params)
self._userList = pm.extract("userList", pType=list, allowEmpty=False)
# Check if there is already a user with the same email
for user in self._userList:
if self._isEmailAlreadyUsed(user["email"]):
raise ServiceAccessError(_("The email address (%s) of a user you are trying to add is already used by another convener or the user is already added to the list. Convener(s) not added.") % user["email"])
开发者ID:bubbas,项目名称:indico,代码行数:8,代码来源:session.py
示例17: SendElectronicAgreement
class SendElectronicAgreement(ConferenceModifBase):
def _checkParams(self):
ConferenceModifBase._checkParams(self)
self._pm = ParameterManager(self._params)
self.uniqueIdList = self._pm.extract("uniqueIdList", list, False, [])
fromMail = self._pm.extract("from", dict, False, {})
self.fromEmail = fromMail['email']
self.fromName = fromMail['name']
self.content = self._pm.extract("content", str, False, "")
p_cc = self._pm.extract("cc", str, True, "").strip()
self.cc = setValidEmailSeparators(p_cc).split(',') if p_cc else []
self.emailToList = []
manager = self._conf.getCSBookingManager()
for uniqueId in self.uniqueIdList:
spk = manager.getSpeakerWrapperByUniqueId(uniqueId)
if spk.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
self.emailToList.extend(manager.getSpeakerEmailByUniqueId(uniqueId, self._aw.getUser()))
def processContent(self, speakerWrapper):
fullUrl = UHCollaborationElectronicAgreementForm().getURL(self._conf.getId(), speakerWrapper.getUniqueIdHash())
url = "<a href='%s'>%s</a>"%(fullUrl, fullUrl)
talkTitle = speakerWrapper.getContribution().getTitle() if speakerWrapper.getContribution() else self._conf.getTitle()
mailEnv = dict(url=url, talkTitle = talkTitle, name= speakerWrapper.getObject().getDirectFullName())
return permissive_format(self.content, mailEnv)
def _getAnswer(self):
report = ""
i = 0
for email in self.emailToList:
i += 1
if i != len(self.emailToList):
report += "%s, "%email
else:
report += "%s."%email
#{url} and {talkTitle} are mandatory to send the EA link
if self.content.find('{url}') == -1:
report = "url_error"
elif self.content.find('{talkTitle}') == -1:
report = "talkTitle_error"
else:
manager = self._conf.getCSBookingManager()
for uniqueId in self.uniqueIdList:
sw = manager.getSpeakerWrapperByUniqueId(uniqueId)
if sw.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]:
sw.setStatus(SpeakerStatusEnum.PENDING)
subject = """[Indico] Electronic Agreement: '%s'"""%(self._conf.getTitle())
notification = ElectronicAgreementNotification([sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject)
GenericMailer.sendAndLog(notification, self._conf,
"MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py",
None)
return report
开发者ID:arturodr,项目名称:indico,代码行数:57,代码来源:services.py
示例18: _checkParams
def _checkParams(self):
params = self._params or {} # if params is not specified it's an empty list
pManager = ParameterManager(params)
self._userMail = pManager.extract("userMail", pType=str, allowEmpty=True)
self._code = pManager.extract("code", pType=str, allowEmpty=True)
self._message = pManager.extract("message", pType=str, allowEmpty=True)
inner = params.get("inner", "")
self._inner = "\n".join(inner) if isinstance(inner, list) else inner
self._requestInfo = pManager.extract("requestInfo", pType=dict, allowEmpty=True)
开发者ID:MichelCordeiro,项目名称:indico,代码行数:9,代码来源:error.py
示例19: _checkParams
def _checkParams(self):
UserModificationBase._checkParams(self)
ConferenceReviewingBase._checkParams(self)
if self._params.has_key("contributions"):
pm = ParameterManager(self._params)
contributionsIds = {int(c) for c in pm.extract("contributions", pType=list, allowEmpty=False)}
self._contributions = [contrib for contrib in self._event.contributions if contrib.id in contributionsIds]
else:
raise ServiceError("ERR-REV2", _("List of contribution ids not set"))
开发者ID:OmeGak,项目名称:indico,代码行数:9,代码来源:reviewing.py
示例20: _checkParams
def _checkParams(self):
UserModificationBase._checkParams(self)
ConferenceReviewingBase._checkParams(self)
if self._params.has_key('contributions'):
pm = ParameterManager(self._params)
contributionsIds = pm.extract("contributions", pType=list, allowEmpty=False)
self._contributions = [self._conf.getContributionById(contributionId) for contributionId in contributionsIds]
else:
raise ServiceError("ERR-REV2",_("List of contribution ids not set"))
开发者ID:dbourillot,项目名称:indico,代码行数:9,代码来源:reviewing.py
注:本文中的MaKaC.services.implementation.base.ParameterManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论