本文整理汇总了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), ([], '', []))
示例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')
示例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'))
示例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')
示例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)