本文整理汇总了Python中libs.Paths.getLibraryPath方法的典型用法代码示例。如果您正苦于以下问题:Python Paths.getLibraryPath方法的具体用法?Python Paths.getLibraryPath怎么用?Python Paths.getLibraryPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libs.Paths
的用法示例。
在下文中一共展示了Paths.getLibraryPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: saveLibraryData
# 需要导入模块: from libs import Paths [as 别名]
# 或者: from libs.Paths import getLibraryPath [as 别名]
def saveLibraryData(self, data, file_name):
"""
Stores the data of the libraries in a json file
Arguments:
data {json}
json data with the libraries
file_name {string}
name of the json file
"""
libraries_path = Paths.getLibraryPath()
library_path = os.path.join(libraries_path, file_name)
libraries = JSONFile(library_path)
libraries.setData(data)
libraries.saveData()
示例2: getLibrary
# 需要导入模块: from libs import Paths [as 别名]
# 或者: from libs.Paths import getLibraryPath [as 别名]
def getLibrary(self, file_name):
"""
Get a specific json file and return the data
Arguments:
file_name {string}
Json file name where is stored the library data
Returns:
[dict] -- Dictionary with the library data
"""
plugin_path = Paths.getLibraryPath()
library_path = os.path.join(plugin_path, file_name)
libraries = JSONFile(library_path).getData()
return libraries