コード例 #1
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
 def testScanProduction(self):
     refresh()
     serviceproduction.handleAdd(
         Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
     )
     serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, {})
     serviceproduction.handleGetProductionView(Tempout(), {}, {})
コード例 #2
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
    def testScenarioRenameElementElementChangeType(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
        )
        session = {}
        serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)

        self.renameElement(session, "chars/frankie.blend", "GRFlyingSquirrel", "grFrankie", True)
コード例 #3
0
 def testActivateProduction(self):
     refresh()
     serviceproduction.handleAdd(
         Tempout(), {
             "production_location": REPOSITORYLOCATION,
             "production_name": "unittest"
         }, {})
     serviceproduction.handleActivateProduction(Tempout(),
                                                {"production_id": 1}, {})
コード例 #4
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
 def testMissingBlendFileRollback(self):
     refresh()
     self.osRenameFile("chars/bird.blend", "chars/birdtest.blend")
     serviceproduction.handleAdd(
         Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
     )
     session = {}
     serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)
     self.fix("chars/bird.blend", "levels/start_menu.blend", "chars/birdtest.blend", session)
     servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #5
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
    def testScenarioRenameElementRollback(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
        )
        session = {}
        serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)

        self.renameElement(session, "chars/frankie.blend", "GRFlyingSquirrel", "GRFrankie")
        servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #6
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
    def testScenarioRenameTextureRollback(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
        )
        session = {}
        serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)

        self.renameFile(session, "chars/textures/flyingsquirrel_skin_col.jpg", "frankie_skin_col.jpg")
        servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #7
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
    def testScenarioRenameBlendCommit(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
        )
        session = {}
        serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)

        self.renameFile(session, "chars/frankie.blend", "frankie_momo.blend")
        servicerefactor.handleCommitCurrentTasks(Tempout(), {}, session)
コード例 #8
0
ファイル: testscenarios.py プロジェクト: jay3sh/blender-aid
    def testScenarioMoveBlendRollback(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {"production_location": REPOSITORYLOCATION, "production_name": "unittest"}, {}
        )
        session = {}
        serviceproduction.handleActivateProduction(Tempout(), {"production_id": 1}, session)

        self.moveFile(session, "chars/frankie_testlevel.blend", "levels")
        servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #9
0
    def testScenarioRenameElementElementChangeType(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {
                "production_location": REPOSITORYLOCATION,
                "production_name": "unittest"
            }, {})
        session = {}
        serviceproduction.handleActivateProduction(Tempout(),
                                                   {"production_id": 1},
                                                   session)

        self.renameElement(session, "chars/frankie.blend", "GRFlyingSquirrel",
                           "grFrankie", True)
コード例 #10
0
    def testScenarioRenameBlendRollback(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {
                "production_location": REPOSITORYLOCATION,
                "production_name": "unittest"
            }, {})
        session = {}
        serviceproduction.handleActivateProduction(Tempout(),
                                                   {"production_id": 1},
                                                   session)

        self.renameFile(session, "chars/frankie.blend", "frankie_momo.blend")
        servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #11
0
    def testScenarioMoveBlendCommit(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {
                "production_location": REPOSITORYLOCATION,
                "production_name": "unittest"
            }, {})
        session = {}
        serviceproduction.handleActivateProduction(Tempout(),
                                                   {"production_id": 1},
                                                   session)

        self.moveFile(session, "chars/frankie_testlevel.blend", "levels")
        servicerefactor.handleCommitCurrentTasks(Tempout(), {}, session)
コード例 #12
0
 def testMissingBlendFileRollback(self):
     refresh()
     self.osRenameFile("chars/bird.blend", "chars/birdtest.blend")
     serviceproduction.handleAdd(
         Tempout(), {
             "production_location": REPOSITORYLOCATION,
             "production_name": "unittest"
         }, {})
     session = {}
     serviceproduction.handleActivateProduction(Tempout(),
                                                {"production_id": 1},
                                                session)
     self.fix("chars/bird.blend", "levels/start_menu.blend",
              "chars/birdtest.blend", session)
     servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #13
0
    def testScenarioRenameElementCommit(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {
                "production_location": REPOSITORYLOCATION,
                "production_name": "unittest"
            }, {})
        session = {}
        serviceproduction.handleActivateProduction(Tempout(),
                                                   {"production_id": 1},
                                                   session)

        self.renameElement(session, "chars/frankie.blend", "GRFlyingSquirrel",
                           "GRFrankie")
        servicerefactor.handleCommitCurrentTasks(Tempout(), {}, session)
コード例 #14
0
    def testScenarioRenameTextureRollback(self):
        refresh()
        serviceproduction.handleAdd(
            Tempout(), {
                "production_location": REPOSITORYLOCATION,
                "production_name": "unittest"
            }, {})
        session = {}
        serviceproduction.handleActivateProduction(Tempout(),
                                                   {"production_id": 1},
                                                   session)

        self.renameFile(session, "chars/textures/flyingsquirrel_skin_col.jpg",
                        "frankie_skin_col.jpg")
        servicerefactor.handleRollbackCurrentTasks(Tempout(), {}, session)
コード例 #15
0
ファイル: server.py プロジェクト: JenevanStudios/blender-aid
    def doHandleService(self):
        try:
            servicename = self.path
            if servicename.find("?") != -1:
                servicename = servicename[0:servicename.find("?")]

            session = getSession(self.client_address[0])
            line = self.rfile.readline().decode();

            log.debug((servicename, line))
            req = json.loads(line)
            if servicename=="/service/metafromproductionfiles":
                servicescenes.handleGetAll(self.wfile, req, session)
            elif servicename=="/service/productions":
                serviceproduction.handleGetAll(self.wfile, req, session)
            elif servicename=="/service/deleteproduction":
                serviceproduction.handleDelete(self.wfile, req, session)
            elif servicename=="/service/addproduction":
                serviceproduction.handleAdd(self.wfile, req, session)
            elif servicename=="/service/activateproduction":
                serviceproduction.handleActivateProduction(self.wfile, req, session)
            elif servicename=="/service/productionview":
                serviceproduction.handleGetProductionView(self.wfile, req, session)
            elif servicename=="/service/fileview":
                serviceproduction.handleGetFileView(self.wfile, req, session)
            elif servicename=="/service/dependancy":
                servicedependancy.handleGet(self.wfile, req, session)
            elif servicename=="/service/renamefile":
                servicerefactor.handleStartRenameFile(self.wfile, req, session)
            elif servicename=="/service/movefile":
                servicerefactor.handleStartMoveFile(self.wfile, req, session)
            elif servicename=="/service/renamedir":
                servicerefactor.handleStartRenameDirectory(self.wfile, req, session)
            elif servicename=="/service/movedir":
                servicerefactor.handleStartMoveDirectory(self.wfile, req, session)
            elif servicename=="/service/renameelement":
                servicerefactor.handleStartRenameElement(self.wfile, req, session)
            elif servicename=="/service/refactoringtasks":
                servicerefactor.handleGetCurrentTasks(self.wfile, req, session)
            elif servicename=="/service/executetask":
                servicerefactor.handleExecuteOneTask(self.wfile, req, session)
            elif servicename=="/service/missinglinksolutions":
                servicerefactor.handleGetMissingLinkSolutions(self.wfile, req, session)
            elif servicename=="/service/solvemissinglink":
                servicerefactor.handleStartSolveMissingLink(self.wfile, req, session)
            elif servicename=="/service/svnadd":
                serviceproduction.handleSvnAdd(self.wfile, req, session)
            elif servicename=="/service/svnrevert":
                serviceproduction.handleSvnRevert(self.wfile, req, session)
            elif servicename=="/service/svnupdate":
                serviceproduction.handleSvnUpdate(self.wfile, req, session)
            elif servicename=="/service/svncommit":
                serviceproduction.handleSvnCommit(self.wfile, req, session)
#todo add service execute all tasks.

        except sqlite3.Error:
            traceback.print_exc()
            self.wfile.write("ERROR: A database error occured. Please check your database configuration in the settings file. Make sure you have removed the old database. If that does not solve the problem, send us an email.".encode())
        except IndexError:
            traceback.print_exc()
            self.wfile.write("ERROR: A database error occured. Please check your database configuration in the settings file. Make sure you have removed the old database. If that does not solve the problem, send us an email.".encode())
コード例 #16
0
    def doHandleService(self):
        try:
            servicename = self.path
            if servicename.find("?") != -1:
                servicename = servicename[0:servicename.find("?")]

            session = getSession(self.client_address[0])
            line = self.rfile.readline().decode()

            log.debug((servicename, line))
            req = json.loads(line)
            if servicename == "/service/metafromproductionfiles":
                servicescenes.handleGetAll(self.wfile, req, session)
            elif servicename == "/service/productions":
                serviceproduction.handleGetAll(self.wfile, req, session)
            elif servicename == "/service/deleteproduction":
                serviceproduction.handleDelete(self.wfile, req, session)
            elif servicename == "/service/addproduction":
                serviceproduction.handleAdd(self.wfile, req, session)
            elif servicename == "/service/activateproduction":
                serviceproduction.handleActivateProduction(
                    self.wfile, req, session)
            elif servicename == "/service/productionview":
                serviceproduction.handleGetProductionView(
                    self.wfile, req, session)
            elif servicename == "/service/fileview":
                serviceproduction.handleGetFileView(self.wfile, req, session)
            elif servicename == "/service/dependancy":
                servicedependancy.handleGet(self.wfile, req, session)
            elif servicename == "/service/renamefile":
                servicerefactor.handleStartRenameFile(self.wfile, req, session)
            elif servicename == "/service/movefile":
                servicerefactor.handleStartMoveFile(self.wfile, req, session)
            elif servicename == "/service/renamedir":
                servicerefactor.handleStartRenameDirectory(
                    self.wfile, req, session)
            elif servicename == "/service/movedir":
                servicerefactor.handleStartMoveDirectory(
                    self.wfile, req, session)
            elif servicename == "/service/renameelement":
                servicerefactor.handleStartRenameElement(
                    self.wfile, req, session)
            elif servicename == "/service/refactoringtasks":
                servicerefactor.handleGetCurrentTasks(self.wfile, req, session)
            elif servicename == "/service/executetask":
                servicerefactor.handleExecuteOneTask(self.wfile, req, session)
            elif servicename == "/service/missinglinksolutions":
                servicerefactor.handleGetMissingLinkSolutions(
                    self.wfile, req, session)
            elif servicename == "/service/solvemissinglink":
                servicerefactor.handleStartSolveMissingLink(
                    self.wfile, req, session)
            elif servicename == "/service/svnadd":
                serviceproduction.handleSvnAdd(self.wfile, req, session)
            elif servicename == "/service/svnrevert":
                serviceproduction.handleSvnRevert(self.wfile, req, session)
            elif servicename == "/service/svnupdate":
                serviceproduction.handleSvnUpdate(self.wfile, req, session)
            elif servicename == "/service/svncommit":
                serviceproduction.handleSvnCommit(self.wfile, req, session)
#todo add service execute all tasks.

        except sqlite3.Error:
            traceback.print_exc()
            self.wfile.write(
                "ERROR: A database error occured. Please check your database configuration in the settings file. Make sure you have removed the old database. If that does not solve the problem, send us an email."
                .encode())
        except IndexError:
            traceback.print_exc()
            self.wfile.write(
                "ERROR: A database error occured. Please check your database configuration in the settings file. Make sure you have removed the old database. If that does not solve the problem, send us an email."
                .encode())