本文整理匯總了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}