Пример #1
0
    def run(self):
        """Create cocos project.
        custom message rules to notify ui
        As follow:
            begin@%d@%d@%s  --- create before
            doing@%d@%d@%s  --- creating
            end@%d@%d@%s    --- create after
        """
        #delete exist project.
        if os.path.exists(os.path.join(self.projectPath, self.projectName)):
            print("###begin remove:  " + self.projectName)
            try:
                shutil.rmtree(os.path.join(self.projectPath, self.projectName))
                print("###remove finish:  " + self.projectName)
            except:
                print("###remove folder failure %s" % self.projectName)
                putMsg = "end@%d@%d@%s" % (100, 100, "create failure")
                self.queue.put(putMsg)
        putMsg = "begin@%d@%d@%s" % (0, 100, "begin create")
        self.queue.put(putMsg)

        project = CocosProject()
        breturn = project.createPlatformProjects(self.projectName,
                                                 self.packageName,
                                                 self.language, self.runtime,
                                                 self.projectPath,
                                                 self.newProjectCallBack)
        if breturn:
            putMsg = "end@%d@%d@%s" % (100, 100,
                                       "Projected created successfully")
        else:
            putMsg = "end@%d@%d@%s" % (100, 100, "Failed to create project")
        self.queue.put(putMsg)
Пример #2
0
    def run(self):
        """Create cocos project.
        custom message rules to notify ui
        As follow:
            begin@%d@%d@%s  --- create before
            doing@%d@%d@%s  --- creating
            end@%d@%d@%s    --- create after
        """
        #delete exist project.
        if os.path.exists(os.path.join(self.projectPath, self.projectName)):
            print ("###begin remove:  " + self.projectName)
            try:
                shutil.rmtree(os.path.join(self.projectPath, self.projectName))
                print ("###remove finish:  " + self.projectName)
            except:
                print ("###remove folder failure %s" %self.projectName)
                putMsg = "end@%d@%d@%s" %(100, 100, "create failure")
                self.queue.put(putMsg)
        putMsg = "begin@%d@%d@%s" %(0, 100, "begin create")
        self.queue.put(putMsg)

        project = CocosProject()
        breturn = project.createPlatformProjects(
            self.projectName,
            self.packageName,
            self.language,
            self.projectPath,
            self.newProjectCallBack
        )
        if breturn:
            putMsg = "end@%d@%d@%s" %(100, 100, "create successful")
        else:
            putMsg = "end@%d@%d@%s" %(100, 100, "create failure")
        self.queue.put(putMsg)
Пример #3
0
def commandCreate():
    from module.core import CocosProject
    project = CocosProject()
    name, package, language, runtime, path = project.checkParams()
    project.createPlatformProjects(name, package, language, runtime, path)
Пример #4
0
def commandCreate():
        from module.core import CocosProject
        project = CocosProject()
        name, package, language, path = project.checkParams()
        project.createPlatformProjects(name, package, language, path)