Esempio n. 1
0
 def _sqlChanges(self):
     from Phoenix.Models import Privilege, Repository, Role
     Member.createTable(ifNotExists=True)
     Role.createTable(ifNotExists=True)
     Repository.createTable(ifNotExists=True)
     Privilege.createTable(ifNotExists=True)
     Hook.createTable(ifNotExists=True)
     Key.createTable(ifNotExists=True)
Esempio n. 2
0
 def _sqlChanges(self):
     from Phoenix.Models import Privilege, Repository, Role
     Member.createTable(ifNotExists=True)
     Role.createTable(ifNotExists=True)
     Repository.createTable(ifNotExists=True)
     Privilege.createTable(ifNotExists=True)
     Hook.createTable(ifNotExists=True)
     Key.createTable(ifNotExists=True)
Esempio n. 3
0
 def removehook(self):
     logging.info("Defining hook id ...")
     id = self.args.hook_id
     
     logging.info("Checking if hook exists ...")
     hook = Hook.get(id)
     
     if not hook:
         raise Exception("The hook with the id `%s' does not exist." % id)
     
     logging.info("Removing the hook from the database ...")
     hook.destroySelf()
     
     print "Done."
Esempio n. 4
0
    def removehook(self):
        logging.info("Defining hook id ...")
        id = self.args.hook_id

        logging.info("Checking if hook exists ...")
        hook = Hook.get(id)

        if not hook:
            raise Exception("The hook with the id `%s' does not exist." % id)

        logging.info("Removing the hook from the database ...")
        hook.destroySelf()

        print "Done."
Esempio n. 5
0
 def hook(cls, id):
     from Phoenix.Models import Hook
     if Hook.get(id):
         return True
     return False
Esempio n. 6
0
 def getHooksByName(self, name):
     from Phoenix.Models import Hook
     return Hook.selectBy(repository=self, hook=name)
Esempio n. 7
0
 def getHooksByName(self, name):
     from Phoenix.Models import Hook
     return Hook.selectBy(repository=self, hook=name)
Esempio n. 8
0
 def addHook(self, hook, command):
     from Phoenix.Models import Hook
     hook = Hook(repository=self, hook=hook, command=command)
     return hook
Esempio n. 9
0
 def hook(cls, id):
     from Phoenix.Models import Hook
     if Hook.get(id):
         return True
     return False