Ejemplo n.º 1
0
    def do_create(self, line):
        """\
Usage : create <projectname>
create new project
        """
        try:
            self.checkargs(line, "<projectname>")
        except PodError as error:
            print(error)
            return
        try:
            sy.check_name(line)
        except PodError as error:
            print(error)
            return 0
        dirname = os.path.abspath(line)
        if sy.dir_exist(dirname):
            print("Project " + line + " already exists")
            return 0
        else:
            try:
                self._project = Project(dirname, void=0)
            except PodError as error:
                print(error)
                return

        self.setPrompt("POD", self._project.name)
        print("Project " + self._project.name + " created")
Ejemplo n.º 2
0
    def do_create(self, line):
        """\
Usage : create <projectname>
create new project
        """
        try:
            self.checkargs(line, "<projectname>")
        except PodError as error:
            print(error)
            return
        try:
            sy.check_name(line)
        except PodError as error:
            print(error)
            return 0
        dirname = os.path.abspath(line)
        if sy.dir_exist(dirname):
            print("Project " + line + " already exists")
            return 0
        else:
            try:
                self._project = Project(dirname, void=0)
            except PodError as error:
                print(error)
                return

        self.setPrompt("POD", self._project.name)
        print("Project " + self._project.name + " created")
Ejemplo n.º 3
0
    def do_addinstance(self, line):
        """\
Usage : addinstance \\
        <libraryname>.<componentname>.[componentversion] \\
        [newinstancename]
Add component in project
        """
        try:
            self.is_project_open()
            self.isPlatformSelected()
            self.checkargs(
                line,
                "<libraryname>.<componentname>.[componentversion] " +
                "[newinstancename]")
        except PodError as error:
            print(DISPLAY)
            print(error)
            return
        arg = line.split(' ')
        subarg = arg[0].split(".")
        try:
            instancename = arg[1]
        except IndexError:
            instancename = None
        try:
            componentversion = subarg[2]
        except IndexError:
            componentversion = None
        try:
            if (instancename is not None):
                sy.check_name(instancename)
            if (instancename is None) and (componentversion is None):
                self._project.add_instance(
                    componentname=subarg[1],
                    libraryname=subarg[0])
            elif (instancename is not None) and (componentversion is None):
                self._project.add_instance(
                    componentname=subarg[1],
                    libraryname=subarg[0],
                    instancename=instancename)
            elif (instancename is None) and (componentversion is not None):
                self._project.add_instance(
                    componentname=subarg[1],
                    libraryname=subarg[0],
                    componentversion=componentversion)
            else:
                self._project.add_instance(
                    componentname=subarg[1],
                    libraryname=subarg[0],
                    componentversion=componentversion,
                    instancename=instancename)
        except PodError as error:
            print(DISPLAY)
            print(error)
            return
        print(DISPLAY)
Ejemplo n.º 4
0
    def do_addinstance(self, line):
        """\
Usage : addinstance \\
        <libraryname>.<componentname>.[componentversion] \\
        [newinstancename]
Add component in project
        """
        try:
            self.is_project_open()
            self.isPlatformSelected()
            self.checkargs(
                line, "<libraryname>.<componentname>.[componentversion] " +
                "[newinstancename]")
        except PodError as error:
            print(DISPLAY)
            print(error)
            return
        arg = line.split(' ')
        subarg = arg[0].split(".")
        try:
            instancename = arg[1]
        except IndexError:
            instancename = None
        try:
            componentversion = subarg[2]
        except IndexError:
            componentversion = None
        try:
            if (instancename is not None):
                sy.check_name(instancename)
            if (instancename is None) and (componentversion is None):
                self._project.add_instance(componentname=subarg[1],
                                           libraryname=subarg[0])
            elif (instancename is not None) and (componentversion is None):
                self._project.add_instance(componentname=subarg[1],
                                           libraryname=subarg[0],
                                           instancename=instancename)
            elif (instancename is None) and (componentversion is not None):
                self._project.add_instance(componentname=subarg[1],
                                           libraryname=subarg[0],
                                           componentversion=componentversion)
            else:
                self._project.add_instance(componentname=subarg[1],
                                           libraryname=subarg[0],
                                           componentversion=componentversion,
                                           instancename=instancename)
        except PodError as error:
            print(DISPLAY)
            print(error)
            return
        print(DISPLAY)
Ejemplo n.º 5
0
        else:
            cli.cmdloop()
            self.stdout.write("\n")

    def do_create(self,line):
        """\
Usage : create <projectname>
create new project
        """
        try:
            self.checkargs(line,"<projectname>")
        except Error,e:
            print e
            return
        try:
            sy.check_name(line)
        except Error,e:
            print e
            return 0
        dirname = os.path.abspath(line)
        if sy.dirExist(dirname):
            print "Project "+line+" already exists"
            return 0
        else:
            try:
                settings.active_project = Project(dirname,void=0)
            except Error,e:
                print e
                return

        self.setPrompt("POD",settings.active_project.getName())