本文整理汇总了Python中kiwi.defaults.Defaults.get_solvable_location方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_solvable_location方法的具体用法?Python Defaults.get_solvable_location怎么用?Python Defaults.get_solvable_location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_solvable_location方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_uptodate
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_solvable_location [as 别名]
def is_uptodate(self, target_dir=Defaults.get_solvable_location()):
"""
Check if repository metadata is up to date
:rtype: bool
"""
solvable_time_file = ''.join(
[target_dir, os.sep, self.uri.alias(), '.timestamp']
)
if os.path.exists(solvable_time_file):
with open(solvable_time_file) as solvable_time:
saved_time = solvable_time.read()
if saved_time == self.timestamp() and not saved_time == 'static':
return True
return False
示例2: create_repository_solvable
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_solvable_location [as 别名]
def create_repository_solvable(
self, target_dir=Defaults.get_solvable_location()
):
"""
Create SAT solvable for this repository from previously
created intermediate solvables by merge and store the
result solvable in the specified target_dir
:param string target_dir: path name
:return: file path to solvable
:rtype: string
"""
Path.create(target_dir)
solvable = os.sep.join(
[target_dir, self.uri.alias()]
)
if not self.is_uptodate(target_dir):
self._setup_repository_metadata()
solvable = self._merge_solvables(target_dir)
self._cleanup()
return solvable