本文整理汇总了Python中itools.uri.Path.resolve方法的典型用法代码示例。如果您正苦于以下问题:Python Path.resolve方法的具体用法?Python Path.resolve怎么用?Python Path.resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类itools.uri.Path
的用法示例。
在下文中一共展示了Path.resolve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_item_value
# 需要导入模块: from itools.uri import Path [as 别名]
# 或者: from itools.uri.Path import resolve [as 别名]
def get_item_value(self, resource, context, item, column):
if column == 'checkbox':
if self.is_folder(item):
return None
proxy = super(AddImage_BrowseContent, self)
return proxy.get_item_value(resource, context, item, column)
elif column == 'icon':
if self.is_folder(item):
# icon
path_to_icon = item.get_resource_icon(48)
if path_to_icon.startswith(';'):
path_to_icon = Path('%s/' % item.name).resolve(path_to_icon)
else:
path = item.abspath
path_to_icon = ";thumb?width=48&height=48"
if path:
path_to_resource = Path(str(path) + '/')
path_to_icon = path_to_resource.resolve(path_to_icon)
return path_to_icon
else:
proxy = super(AddImage_BrowseContent, self)
return proxy.get_item_value(resource, context, item, column)
示例2: resolve
# 需要导入模块: from itools.uri import Path [as 别名]
# 或者: from itools.uri.Path import resolve [as 别名]
def resolve(base, path):
if type(base) is not Path:
base = Path(base)
path = base.resolve(path)
return str(path)
示例3: test_resolve_w_slash
# 需要导入模块: from itools.uri import Path [as 别名]
# 或者: from itools.uri.Path import resolve [as 别名]
def test_resolve_w_slash(self):
before = Path('/a/b/')
after = Path('/a/b/c')
self.assertEqual(before.resolve('c'), after)