• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python folder.process_filesystem_structure函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tank.folder.process_filesystem_structure函数的典型用法代码示例。如果您正苦于以下问题:Python process_filesystem_structure函数的具体用法?Python process_filesystem_structure怎么用?Python process_filesystem_structure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了process_filesystem_structure函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_shot

    def test_shot(self):
        """Tests paths used in making a shot are as expected."""
        
        expected_paths = []
        shot_path = os.path.join(self.project_root, "%s_%s" % (self.shot["code"], self.seq["code"]))
        expected_paths.extend( [self.project_root, shot_path] )

        folder.process_filesystem_structure(self.tk, 
                                            self.shot["type"], 
                                            self.shot["id"], 
                                            preview=False,
                                            engine=None)        
        
        assert_paths_to_create(expected_paths)

        # now check the path cache!
        # there shouldbe two entries, one for the shot and one for the seq        
        pc = path_cache.PathCache(self.pipeline_configuration)
        shot_paths = pc.get_paths("Shot", self.shot["id"], primary_only=False)
        seq_paths = pc.get_paths("Sequence", self.seq["id"], primary_only=False)
        self.assertEquals( len(shot_paths), 1 )
        self.assertEquals( len(seq_paths), 1)
        pc.close()
        
        # it's the same folder for seq and shot
        self.assertEquals(shot_paths, seq_paths)
开发者ID:Pixomondo,项目名称:tk-core,代码行数:26,代码来源:test_secondary_entity.py


示例2: test_step_b

    def test_step_b(self):
        """Tests paths used in making a shot are as expected."""

        folder.process_filesystem_structure(self.tk, 
                                            self.task2["type"], 
                                            self.task2["id"], 
                                            preview=False,
                                            engine=None)        
        
        expected_paths = []

        sequence_path = os.path.join(self.project_root, "sequences", self.seq["code"])     
        sequences_path = os.path.join(self.project_root, "sequences")   
        shot_path = os.path.join(sequence_path, self.shot["code"])
        step_path = os.path.join(shot_path, self.step2["short_name"])
        
        expected_paths.extend( [self.project_root, sequences_path, sequence_path, shot_path, step_path] )
        
        # add non-entity paths
        expected_paths.append(os.path.join(step_path, "publish"))
        expected_paths.append(os.path.join(step_path, "images"))
        expected_paths.append(os.path.join(step_path, "review"))
        expected_paths.append(os.path.join(step_path, "work"))
        expected_paths.append(os.path.join(step_path, "work", "snapshots"))
        expected_paths.append(os.path.join(step_path, "work", "workspace.mel"))
        expected_paths.append(os.path.join(step_path, "out"))

        assert_paths_to_create(expected_paths)
开发者ID:AdricEpic,项目名称:tk-core,代码行数:28,代码来源:test_step_node.py


示例3: test_context_from_path

    def test_context_from_path(self):
        """Testing task based context resolution from path."""

        task_path = os.path.join(
            self.project_root,
            "sequences",
            self.seq["code"],
            self.shot["code"],
            self.task["content"]
        )

        # before folders exist for the task, we expect
        # only the project to be extracted from the path
        ctx = self.tk.context_from_path(task_path)

        self.assertEqual(ctx.project, {'type': 'Project', 'id': 1, 'name': 'project_name'})
        self.assertEqual(ctx.entity, None)
        self.assertEqual(ctx.step, None)
        self.assertEqual(ctx.task, None)

        # create folders
        folder.process_filesystem_structure(self.tk,
                                            self.task["type"],
                                            self.task ["id"],
                                            preview=False,
                                            engine=None)


        # now we should get a full context, including step
        ctx = self.tk.context_from_path(task_path)

        self.assertEqual(ctx.project, {'type': 'Project', 'id': 1, 'name': 'project_name'})
        self.assertEqual(ctx.entity, {'type': 'Shot', 'id': 1, 'name': 'shot_code'})
        self.assertEqual(ctx.step, {'type': 'Step', 'id': 3, 'name': 'step_code'})
        self.assertEqual(ctx.task, {'type': 'Task', 'id': 23, 'name': 'task1'})
开发者ID:adriankrupa,项目名称:tk-core,代码行数:35,代码来源:test_task_node.py


示例4: test_step_a

    def test_step_a(self, get_current_user):
        """Tests paths used in making a shot are as expected."""

        get_current_user.return_value = self.humanuser

        folder.process_filesystem_structure(self.tk, 
                                            self.task["type"], 
                                            self.task ["id"], 
                                            preview=False,
                                            engine="foo-bar")        
        
        expected_paths = []

        sequence_path = os.path.join(self.project_root, "sequences", self.seq["code"])   
        sequences_path = os.path.join(self.project_root, "sequences")     
        shot_path = os.path.join(sequence_path, self.shot["code"])
        sandbox_path = os.path.join(shot_path, self.humanuser["login"])
        step_path = os.path.join(sandbox_path, self.step["short_name"])
        
        expected_paths.extend( [self.project_root, sequences_path, sequence_path, shot_path, sandbox_path, step_path] )
        
        # add non-entity paths
        expected_paths.append(os.path.join(step_path, "publish"))
        expected_paths.append(os.path.join(step_path, "images"))
        expected_paths.append(os.path.join(step_path, "review"))
        expected_paths.append(os.path.join(step_path, "work"))
        expected_paths.append(os.path.join(step_path, "work", "snapshots"))
        expected_paths.append(os.path.join(step_path, "work", "workspace.mel"))
        expected_paths.append(os.path.join(step_path, "out"))

        assert_paths_to_create(expected_paths)
开发者ID:AdricEpic,项目名称:tk-core,代码行数:31,代码来源:test_step_node.py


示例5: test_shot

    def test_shot(self):
        """Tests paths used in making a shot are as expected."""
        
        
        sequence_path = os.path.join(self.project_root, "sequences", self.seq["code"])
        sequences_path = os.path.join(self.project_root, "sequences")        
        shot_path = os.path.join(sequence_path, self.shot["code"])
        ws_path = os.path.join(shot_path, self.workspace["code"])

        expected_paths = [self.project_root,                          
                          os.path.join(self.project_root, "assets"),
                          ]
        
        
        expected_paths.extend( [sequences_path, 
                                sequence_path, 
                                shot_path,
                                ws_path] )

        folder.process_filesystem_structure(self.tk, 
                                            self.workspace["type"], 
                                            self.workspace["id"], 
                                            preview=False,
                                            engine=None)        
        
        assert_paths_to_create(expected_paths)
开发者ID:bdeluca,项目名称:tk-core,代码行数:26,代码来源:test_create_folders.py


示例6: test_asset

    def test_asset(self):
        """Tests paths used in making a asset are as expected."""
        # expected paths here are based on sg_standard start-config
        # define paths we expect for entities
        
        expected_paths = []
        
        expected_paths.append(self.alt_root_1)
        expected_paths.append(os.path.join(self.alt_root_1, "assets"))
        expected_paths.append(os.path.join(self.alt_root_1, "alternate_reference"))        
        
        asset_folder_name = "%s_%s" % (self.asset["sg_asset_type"], self.asset["code"])
        asset_path = os.path.join(self.alt_root_1, "assets", asset_folder_name)
        step_path = os.path.join(asset_path, self.step["short_name"])
        expected_paths.append(asset_path)
        expected_paths.append(step_path)
        
        # add non-entity paths
        expected_paths.append(os.path.join(step_path, "publish"))
        expected_paths.append(os.path.join(step_path, "images"))
        expected_paths.append(os.path.join(step_path, "review"))
        expected_paths.append(os.path.join(step_path, "work"))
        expected_paths.append(os.path.join(step_path, "work", "snapshots"))
        expected_paths.append(os.path.join(step_path, "out"))

        folder.process_filesystem_structure(self.tk, 
                                            self.asset["type"], 
                                            self.asset["id"], 
                                            preview=False,
                                            engine=None)        

        assert_paths_to_create(expected_paths)
开发者ID:bdeluca,项目名称:tk-core,代码行数:32,代码来源:test_create_folders.py


示例7: test_list_field_token

    def test_list_field_token(self):
        """
        Test that we can reference list field tokens in the symlink definition
        """
        self.assertFalse(os.path.exists(self.bbb))
        self.assertFalse(os.path.exists(self.bbb_work))
        self.assertFalse(os.path.exists(self.bbb_link))

        folder.process_filesystem_structure(
            self.tk,
            self.asset_bbb["type"],
            self.asset_bbb["id"],
            preview=False,
            engine=None
        )

        self.assertTrue(os.path.exists(self.bbb))
        self.assertTrue(os.path.exists(self.bbb_work))
        if sys.platform != "win32":
            self.assertTrue(os.path.lexists(self.bbb_link))
            self.assertTrue(os.path.islink(self.bbb_link))
            self.assertEqual(os.readlink(self.bbb_link), "../Stuff/project_code/vehicle/bbb")
        else:
            # no support on windows
            self.assertFalse(os.path.exists(self.bbb_link))
开发者ID:shotgunsoftware,项目名称:tk-core,代码行数:25,代码来源:test_symlinks.py


示例8: test_create_symlink

    def test_create_symlink(self):
        """
        Test folder creation for a shot which matches the static folder trigger condition
        """
        self.assertFalse(os.path.exists(self.aaa))
        self.assertFalse(os.path.exists(self.aaa_work))
        self.assertFalse(os.path.exists(self.aaa_link))

        folder.process_filesystem_structure(
            self.tk,
            self.shot_aaa["type"],
            self.shot_aaa["id"],
            preview=False,
            engine=None
        )

        self.assertTrue(os.path.exists(self.aaa))
        self.assertTrue(os.path.exists(self.aaa_work))
        if sys.platform != "win32":
            self.assertTrue(os.path.lexists(self.aaa_link))
            self.assertTrue(os.path.islink(self.aaa_link))
            self.assertEqual(os.readlink(self.aaa_link), "../Stuff/project_code/aaa")
        else:
            # no support on windows
            self.assertFalse(os.path.exists(self.aaa_link))
开发者ID:shotgunsoftware,项目名称:tk-core,代码行数:25,代码来源:test_symlinks.py


示例9: test_no_new_folders_created

    def test_no_new_folders_created(self):
        """
        Test the case when folder creation is running for an already existing path 
        """        
        
        # we should have one Toolkit_Folders_Create record in the path cache,
        # coming from the project setup
        folder_events = self.tk.shotgun.find("EventLogEntry", [["event_type", "is", "Toolkit_Folders_Create"]])
        self.assertEqual(len(folder_events), 1)
        
        folder.process_filesystem_structure(self.tk,
                                            self.seq["type"], 
                                            self.seq["id"],
                                            preview=False,
                                            engine=None)        
        
        # a seq should have been added to the path cache and we should have two events
        folder_events = self.tk.shotgun.find("EventLogEntry", [["event_type", "is", "Toolkit_Folders_Create"]])
        self.assertEqual(len(folder_events), 2)

        # running this again, no folders should be created and no events should be generated
        folder.process_filesystem_structure(self.tk,
                                            self.seq["type"], 
                                            self.seq["id"],
                                            preview=False,
                                            engine=None)        

        folder_events = self.tk.shotgun.find("EventLogEntry", [["event_type", "is", "Toolkit_Folders_Create"]])
        self.assertEqual(len(folder_events), 2)
开发者ID:hongloull,项目名称:tk-core,代码行数:29,代码来源:test_path_cache.py


示例10: test_made_string

    def test_made_string(self, get_current_user):
        self.assertFalse(os.path.exists(self.user_path))
        
        get_current_user.return_value = self.humanuser
        folder.process_filesystem_structure(self.tk, 
                                            self.shot["type"], 
                                            self.shot["id"], 
                                            preview=False,
                                            engine="tk-maya")

        self.assertTrue(os.path.exists(self.user_path))
        
        get_current_user.return_value = self.humanuser2
        folder.process_filesystem_structure(self.tk, 
                                            self.shot["type"], 
                                            self.shot["id"], 
                                            preview=False,
                                            engine="tk-maya")

        self.assertTrue(os.path.exists(self.user_path2))

        # test user context
        ctx_foo = self.tk.context_from_path(self.user_path)        
        ctx_bar = self.tk.context_from_path(self.user_path2)
        
        self.assertEquals(ctx_foo.filesystem_locations, [self.user_path])
        self.assertEquals(ctx_bar.filesystem_locations, [self.user_path2])        
开发者ID:adriankrupa,项目名称:tk-core,代码行数:27,代码来源:test_user_sandbox.py


示例11: test_create_sequence

 def test_create_sequence(self):
     expected = os.path.join(self.project_root, "sequences", self.seq["code"])
     self.assertFalse(os.path.exists(expected))
     folder.process_filesystem_structure(self.tk, 
                                         self.seq["type"], 
                                         self.seq["id"], 
                                         preview=False,
                                         engine=None)
     self.assertTrue(os.path.exists(expected))
开发者ID:bdeluca,项目名称:tk-core,代码行数:9,代码来源:test_create_folders.py


示例12: test_create_project

 def test_create_project(self):
     # Check static folders without entity children are created
     expected = os.path.join(self.project_root, "reference", "artwork")
     self.assertFalse(os.path.exists(expected))
     folder.process_filesystem_structure(self.tk, 
                                         self.project["type"], 
                                         self.project["id"], 
                                         preview=False,
                                         engine=None)
     self.assertTrue(os.path.exists(expected))
开发者ID:bdeluca,项目名称:tk-core,代码行数:10,代码来源:test_create_folders.py


示例13: test_create_task

 def test_create_task(self):
     # Task should create folders for it's entity
     expected = os.path.join(self.project_root, "sequences", self.seq["code"], self.shot["code"])
     self.assertFalse(os.path.exists(expected))
     folder.process_filesystem_structure(self.tk, 
                                         self.task["type"], 
                                         self.task["id"], 
                                         preview=False, 
                                         engine=None)
     self.assertTrue(os.path.exists(expected))
开发者ID:bdeluca,项目名称:tk-core,代码行数:10,代码来源:test_create_folders.py


示例14: test_not_made_default

    def test_not_made_default(self, get_current_user):

        self.assertFalse(os.path.exists(self.user_path))
        get_current_user.return_value = self.humanuser        
        folder.process_filesystem_structure(self.tk,
                                            self.shot["type"], 
                                            self.shot["id"], 
                                            preview=False,
                                            engine=None)
        self.assertFalse(os.path.exists(self.user_path))
开发者ID:adriankrupa,项目名称:tk-core,代码行数:10,代码来源:test_user_sandbox.py



注:本文中的tank.folder.process_filesystem_structure函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python qt.QtCore类代码示例发布时间:2022-05-27
下一篇:
Python tank.tank_from_path函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap