当前位置: 首页>>代码示例>>Python>>正文


Python Project.repair方法代码示例

本文整理汇总了Python中osc2.wc.project.Project.repair方法的典型用法代码示例。如果您正苦于以下问题:Python Project.repair方法的具体用法?Python Project.repair怎么用?Python Project.repair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osc2.wc.project.Project的用法示例。


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

示例1: test_repair3

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import repair [as 别名]
 def test_repair3(self):
     """test repair (invalid _packages xml)"""
     path = self.fixture_file('inv4')
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, added='A', missing=' ')
     self.assertEqual(Project.wc_check(path), ([], '', []))
开发者ID:scarabeusiv,项目名称:osc2,代码行数:9,代码来源:test_project.py

示例2: test_repair4

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import repair [as 别名]
 def test_repair4(self):
     """test repair (wc + pkg data missing)"""
     # remove package from _packages in this case
     path = self.fixture_file('inv5')
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     prj = Project(path)
     self.assertEqual(prj._status('missing'), '?')
     self.assertEqual(prj._status('added'), 'A')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:12,代码来源:test_project.py

示例3: test_repair2

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import repair [as 别名]
 def test_repair2(self):
     """test repair (missing pkg data; state ' ')"""
     path = self.fixture_file('inv3')
     self._not_exists(path, 'conflict', data=True)
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, 'conflict', data=True)
     prj = Project(path)
     self.assertEqual(prj._status('conflict'), ' ')
     self.assertIsNotNone(prj.package('conflict'))
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例4: test_repair1

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import repair [as 别名]
 def test_repair1(self):
     """test repair (missing _project and storefile)"""
     path = self.fixture_file('inv1')
     self._not_exists(path, '_project', store=True)
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, project='inv1')
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, '_project', store=True)
     prj = Project(path)
     self.assertEqual(prj.name, 'inv1')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例5: convert_project

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import repair [as 别名]
def convert_project(path, project='', apiurl='', **package_states):
    """Convert working copy to the new format.

    path is the path to the project working copy.

    Keyword arguments:
    project -- the name of the project (default: '')
    apiurl -- the apiurl of the project (default: '')
    **package_states -- a package to state mapping (default: {})

    """
    Project.repair(path, project=project, apiurl=apiurl, no_packages=True,
                   **package_states)
    _write_storefile(path, '_version', str(_VERSION))
    project = wc_read_project(path)
    apiurl = wc_read_apiurl(path)
    packages = wc_read_packages(path)
    for entry in packages:
        package = entry.get('name')
        package_path = os.path.join(path, package)
        storedir = wc_pkg_data_mkdir(path, package)
        convert_package(package_path, project=project, package=package,
                        apiurl=apiurl, ext_storedir=storedir)
开发者ID:bergmannf,项目名称:osc2,代码行数:25,代码来源:convert.py


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