本文整理汇总了Python中pydio.job.localdb.LocalDbHandler.get_directory_node_status方法的典型用法代码示例。如果您正苦于以下问题:Python LocalDbHandler.get_directory_node_status方法的具体用法?Python LocalDbHandler.get_directory_node_status怎么用?Python LocalDbHandler.get_directory_node_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydio.job.localdb.LocalDbHandler
的用法示例。
在下文中一共展示了LocalDbHandler.get_directory_node_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from pydio.job.localdb import LocalDbHandler [as 别名]
# 或者: from pydio.job.localdb.LocalDbHandler import get_directory_node_status [as 别名]
def get(self, job_id='', relative_path=''):
"""
retrieves the stat info for a given file / list the active job details
:param job_id: (optional) Job Id of the file/ folder
:param relative_path: (optional) relative path of the file/folder with respect
to the corresponding repository(job_id)
:returns a json response
"""
if request.path == '/stat':
jobs = JobsLoader.Instance().get_jobs()
json_jobs = {}
for job in jobs:
if jobs[job].active:
json_jobs.update({jobs[job].id: [jobs[job].directory, jobs[job].server, jobs[job].label, jobs[job].workspace]})
return json_jobs
else:
directory_path = JobsLoader.Instance().get_job(job_id).directory
base_path = JobsLoader.Instance().build_job_data_path(job_id)
path = os.path.join(directory_path, relative_path)
#r = os.stat(path)
# Get the status of the file idle/busy... by join of ajxp_index and ajxp_node_status tables
db_handler = LocalDbHandler(base_path, directory_path)
if Path(str(path.encode("utf-8"))).is_dir():
node_status = db_handler.get_directory_node_status("/" + relative_path)
else:
node_status = db_handler.get_node_status("/" + relative_path)
return {"node_status": node_status}