Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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")
Exemplo n.º 7
0
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)
Exemplo n.º 8
0
class INewGameForm(annotate.TypedInterface):
    def deleteGame(self,
                   ctx=annotate.Context(),
                   gameId=annotate.String(required=True)):
        pass

    deleteGame = annotate.autocallable(deleteGame, invisible=True)
Exemplo n.º 9
0
class IKickUserForm(annotate.TypedInterface):
    def kickUser(self,
                 ctx=annotate.Context(),
                 username=annotate.String(required=True)):
        pass

    kickUser = annotate.autocallable(kickUser, invisible=True)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
class IWikiForm(annotate.TypedInterface):
    def updateWiki(self,
                   ctx=annotate.Context(),
                   text=annotate.Text(),
                   new=annotate.String(hidden=True)):
        pass

    updateWiki = annotate.autocallable(updateWiki)
Exemplo n.º 12
0
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)
Exemplo n.º 13
0
class IEditUserForm(annotate.TypedInterface):
    def modifyUser(self,
                   ctx=annotate.Context(),
                   oldPassword=annotate.PasswordEntry(),
                   password=annotate.Password(),
                   isAdministrator=isAdmin):
        pass

    modifyUser = annotate.autocallable(modifyUser)
Exemplo n.º 14
0
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")
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
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)
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
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"))
Exemplo n.º 19
0
class IResetRankForm(annotate.TypedInterface):
    def resetRank(self, ctx=annotate.Context()):
        pass

    resetRank = annotate.autocallable(resetRank)
Exemplo n.º 20
0
class IStopServerForm(annotate.TypedInterface):
    def stopServer(self, ctx=annotate.Context()):
        pass

    stopServer = annotate.autocallable(stopServer)
Exemplo n.º 21
0
class IItemWithSubject(annotate.TypedInterface):
    def setSubject(newSubject=annotate.String(label="Change Subject")):
        pass

    setSubject = annotate.autocallable(setSubject)
Exemplo n.º 22
0
class IAddItem(annotate.TypedInterface):
    def addItem(newSubject=annotate.String()):
        pass

    addItem = annotate.autocallable(addItem)