class ITreeEdit(annotate.TypedInterface): def setDescription(description=annotate.String()): pass setDescription = annotate.autocallable(setDescription) def deleteChild(name=annotate.String(required=True)): pass deleteChild = annotate.autocallable(deleteChild, invisible=True) def addChild(name=annotate.String(required=True), description=annotate.String()): pass addChild = annotate.autocallable(addChild)
class IBulletinForm(annotate.TypedInterface): def addNewBulletin(self, ctx=annotate.Context(), message=annotate.String(required=True)): pass addNewBulletin = annotate.autocallable(addNewBulletin) def deleteBulletin(self, ctx=annotate.Context(), bulletinId=annotate.String(required=True)): pass deleteBulletin = annotate.autocallable(deleteBulletin, invisible=True)
class ITodo(annotate.TypedInterface): def insert(ctx=annotate.Context(), description=annotate.String(required=True, requiredFailMessage="Description Missing") ): pass insert = annotate.autocallable(insert, action="New Todo") def delete(ctx=annotate.Context(), id=annotate.Integer()): pass delete = annotate.autocallable(delete, invisible=True) def update(ctx=annotate.Context(), id=annotate.Integer(), oldstate=annotate.Integer()): pass update = annotate.autocallable(update, invisible=True)
class IFormBuilder(annotate.TypedInterface): def addElement(name=annotate.String(required=True), type=typeChoice): """Add Element Add an element to this form. """ pass addElement = annotate.autocallable(addElement) def clearForm(): """Clear Form Clear this form. """ clearForm = annotate.autocallable(clearForm)
class IAddPasting(annotate.TypedInterface): def addPasting(request=annotate.Request(), author=annotate.String(strip=True), text=annotate.Text(strip=True, required=True)): pass addPasting = annotate.autocallable(addPasting)
class IConfigurationWizard(annotate.TypedInterface): def divmod(self, req=annotate.Request(), name=annotate.String(label="Configuration Name"), username=annotate.String(), password=annotate.PasswordEntry()): """Divmod Account Add a configuration for a Divmod account. """ pass divmod = annotate.autocallable(divmod, action="Create") def fwd(self, req=annotate.Request(), name=annotate.String(label="Configuration Name"), username=annotate.String(), password=annotate.PasswordEntry()): """Free World Dialup Account Add a configuration for a FWD account. """ pass fwd = annotate.autocallable(fwd, action="Create")
class IMyForm(annotate.TypedInterface): foo = annotate.Integer() def bar(baz=annotate.Integer(), slam=newChoicesWay, ham=deferChoicesWay, radio=radioChoices, custom=customValueToKey): pass bar = annotate.autocallable(bar)
class INewGameForm(annotate.TypedInterface): def deleteGame(self, ctx=annotate.Context(), gameId=annotate.String(required=True)): pass deleteGame = annotate.autocallable(deleteGame, invisible=True)
class IKickUserForm(annotate.TypedInterface): def kickUser(self, ctx=annotate.Context(), username=annotate.String(required=True)): pass kickUser = annotate.autocallable(kickUser, invisible=True)
class IEditPasting(annotate.TypedInterface): def editPasting(request=annotate.Request(), postedBy=annotate.String(immutable=1), author=annotate.String(strip=True), text=annotate.Text(strip=True, required=True)): pass editPasting = annotate.autocallable(editPasting)
class IWikiForm(annotate.TypedInterface): def updateWiki(self, ctx=annotate.Context(), text=annotate.Text(), new=annotate.String(hidden=True)): pass updateWiki = annotate.autocallable(updateWiki)
class IAddressBookSearch(annotate.TypedInterface): def search(sn=annotate.String(label="Last name"), givenName=annotate.String(label="First name"), telephoneNumber=annotate.String(), description=annotate.String()): pass search = annotate.autocallable(search)
class IEditUserForm(annotate.TypedInterface): def modifyUser(self, ctx=annotate.Context(), oldPassword=annotate.PasswordEntry(), password=annotate.Password(), isAdministrator=isAdmin): pass modifyUser = annotate.autocallable(modifyUser)
class IInsert(annotate.TypedInterface): def insert(ctx = annotate.Context(), title = annotate.String(), author = annotate.String(), image = annotate.FileUpload(required=True, requiredFailMessage="Must upload something") ): """ Insert a new image """ insert = annotate.autocallable(insert, action="New Image")
class ILoginForm(annotate.TypedInterface): def login(ctx=annotate.Context(), userName=annotate.String( required=True, requiredFailMessage='Please enter your name'), password=annotate.PasswordEntry( required=True, requiredFailMessage='Please enter your name')): pass annotate.autocallable(login)
class IInsert(annotate.TypedInterface): def insert( ctx = annotate.Context(), title = annotate.String(strip=True, required=True, \ requiredFailMessage="Title must be provided", tabindex='1'), author = annotate.String(strip=True, default="Anonymous", tabindex='2'), id = annotate.String(hidden=True), category = annotate.Choice(categories, tabindex='3'), content = annotate.Text(required=True, \ requiredFailMessage="Posts with no content are not allowed", tabindex='4'), ): pass insert = annotate.autocallable(insert)
class ISomething(annotate.TypedInterface): def doSomething( ctx=annotate.Context(), fee=annotate.String(required=True, description="Wee!"), fi=annotate.Integer(description="Tra-la-la"), fo=annotate.Text(), fum=annotate.String(), ): """Do Something Really Exciting Normally you would put a useful description of the interface here but, since the inteface is useless anyway, I cannot think of anything useful to say about it. Although ... did I mention it is useless?""" doSomething = annotate.autocallable(doSomething)
class ISettings(annotate.TypedInterface): platform = annotate.String(label=_("Platform"), default=platform_module.system() + " " + platform_module.release(), immutable=True) # TODO version ? # pylint: disable=no-self-argument def sendLogMessage(ctx=annotate.Context(), level=annotate.Choice(LogLevels, required=True, label=_("Log message level")), message=annotate.String(label=_("Message text"))): pass sendLogMessage = annotate.autocallable( sendLogMessage, label=_("Send a message to the log"), action=_("Send"))
class IResetRankForm(annotate.TypedInterface): def resetRank(self, ctx=annotate.Context()): pass resetRank = annotate.autocallable(resetRank)
class IStopServerForm(annotate.TypedInterface): def stopServer(self, ctx=annotate.Context()): pass stopServer = annotate.autocallable(stopServer)
class IItemWithSubject(annotate.TypedInterface): def setSubject(newSubject=annotate.String(label="Change Subject")): pass setSubject = annotate.autocallable(setSubject)
class IAddItem(annotate.TypedInterface): def addItem(newSubject=annotate.String()): pass addItem = annotate.autocallable(addItem)