Esempio n. 1
0
    def execute(self, command, project_name, cl_args, config):
        super(RepositoryCmd, self).execute(command, project_name, \
                cl_args, config)

        if len(cl_args) == 0:
            raise ScalakError("No subcommand specified")

        project = Project()
        project.load(project_name, config)

        if cl_args[0] == "add":
            self.add(project, cl_args, config)
        elif cl_args[0] == "remove":
            self.remove(project, cl_args, config)
        else:
            return -1

        return 0
Esempio n. 2
0
    def execute(self, command, project_name, cl_args, config):
        super(UserCmd, self).execute(command, project_name, \
                cl_args, config)

        if len(cl_args) == 0:
            raise ScalakError("No subcommand specified")

        project = Project()
        project.load(project_name, config)

        if cl_args[0] == "add":
            self.add(project, cl_args, config) 
        elif cl_args[0] == "remove":
            self.remove(project, cl_args, config) 
        else:
            return -1

        return 0
Esempio n. 3
0
    def create(self, command, project_name, cl_args, config):
        args,loose = getopt.getopt(cl_args, 'b:d:e:')
        args = dict(args)

        if len(loose) < 1:
            raise ScalakError("Create Error: at last administrators id must be supplied")

        admin = loose[0]
        brief = args.get('-b', None)
        desc = args.get('-d', None)

        # TODO checking date format
        due = args.get('-e', None)
        today = datetime.date.today().isoformat()

        project = Project(config, project_name, admin, today, due, brief, desc)
        project.create()
        project.addService(Trac())
        project.addUser(admin)
Esempio n. 4
0
 def remove(self, project_name, config):
     p = Project()
     p.load(project_name, config)
     p.remove()