Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
c6a5880a
Commit
c6a5880a
authored
9 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #8291: added method to get info for one direcory by id
parent
afd0be97
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LTA/ltastorageoverview/lib/store.py
+11
-0
11 additions, 0 deletions
LTA/ltastorageoverview/lib/store.py
with
11 additions
and
0 deletions
LTA/ltastorageoverview/lib/store.py
+
11
−
0
View file @
c6a5880a
...
...
@@ -217,6 +217,17 @@ class LTAStorageDb:
with
sqlite3
.
connect
(
self
.
db_filename
)
as
conn
:
return
conn
.
execute
(
'''
SELECT id, name, url FROM storage_site where id = ?
'''
,
[
site_id
]).
fetchone
()
def
directory
(
self
,
directory_id
):
'''
returns directory tuple (id, name, site_id, site_name) for the given directory_id
'''
with
sqlite3
.
connect
(
self
.
db_filename
)
as
conn
:
return
conn
.
execute
(
'''
SELECT dir.id, dir.name, site.id, site.name
FROM storage_site_root
join storage_site site on site.id = storage_site_root.storage_site_id
join directory_closure dc on dc.ancestor_id = storage_site_root.directory_id
join directory dir on dir.id = dc.descendant_id
where dc.descendant_id = ?
'''
,
[
directory_id
]).
fetchall
()
def
rootDirectories
(
self
):
'''
returns list of all root directories (id, name, site_id, site_name) for all sites
'''
with
sqlite3
.
connect
(
self
.
db_filename
)
as
conn
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment