Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Textgrid Repository WebDAV Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
DARIAH-DE
TextGridRep
Textgrid Repository WebDAV Server
Commits
fe73736e
Verified
Commit
fe73736e
authored
3 years ago
by
Ubbo Veentjer
Browse files
Options
Downloads
Patches
Plain Diff
feat(textgrid_named_dav_provider.py): show project names in dav root
parent
3df4fbe2
No related branches found
No related tags found
1 merge request
!14
Resolve "Show titles and format in repdav listing"
Pipeline
#278149
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/repdav/textgrid_named_dav_provider.py
+14
-1
14 additions, 1 deletion
src/repdav/textgrid_named_dav_provider.py
with
14 additions
and
1 deletion
src/repdav/textgrid_named_dav_provider.py
+
14
−
1
View file @
fe73736e
...
...
@@ -6,6 +6,7 @@ from pprint import pformat
from
tgclients.config
import
TextgridConfig
from
tgclients.crud
import
TextgridCRUD
from
tgclients.metadata
import
TextgridMetadata
from
tgclients.auth
import
TextgridAuth
from
wsgidav.util
import
join_uri
from
repdav.stream_tools
import
FileLikeQueue
...
...
@@ -42,6 +43,16 @@ class TextgridNamedRoot(TextgridRoot):
def
__init__
(
self
,
path
,
environ
):
super
().
__init__
(
path
,
environ
)
config
=
TextgridConfig
()
self
.
_auth
=
TextgridAuth
(
config
)
def
get_member_names
(
self
):
_logger
.
debug
(
"
Called TextgridNamedRoot.get_member_names(self).
"
)
projects
=
[]
for
project
in
tuple
(
self
.
_auth
.
list_assigned_projects
(
self
.
_sid
)):
projects
.
append
(
self
.
_auth
.
get_project_description
(
project
).
name
+
'
[
'
+
project
+
'
]
'
)
_logger
.
debug
(
"
MY PROJECTS: %s
"
,
projects
)
return
projects
def
get_member
(
self
,
name
):
_logger
.
debug
(
"
Called TextgridRoot.get_member(self, %s).
"
,
name
)
...
...
@@ -62,7 +73,9 @@ class TextgridNamedProject(TextgridProject):
# return names
#
# path resolution has to be rewritten before we can work with resource titles
response
=
self
.
_tgsearch
.
list_project_root
(
self
.
path
.
split
(
"
/
"
)[
-
1
],
self
.
_sid
)
name
=
self
.
path
.
split
(
"
/
"
)[
-
1
]
project_id
=
name
[
name
.
rfind
(
'
[
'
)
+
1
:
name
.
rfind
(
'
]
'
)]
response
=
self
.
_tgsearch
.
list_project_root
(
project_id
,
self
.
_sid
)
names
=
[]
for
result
in
response
.
result
:
names
.
append
(
self
.
_tgmeta
.
filename_from_metadata
(
result
))
...
...
This diff is collapsed.
Click to expand it.
Stefan Hynek
@hynek
mentioned in commit
9dc9a589
·
3 years ago
mentioned in commit
9dc9a589
mentioned in commit 9dc9a589184fe7e34bbad69d7f4f562a101c7e9e
Toggle commit list
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