Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Лошкарев Сергей Алексеевич
PS page generation
Commits
fcb9a97f
Commit
fcb9a97f
authored
3 years ago
by
Лошкарев Сергей Алексеевич
Browse files
Options
Download
Patches
Plain Diff
add TaigaReader class
parent
1d30590b
master
1.0
1 merge request
!4
many shit
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
get_from_tagia.py
+24
-7
get_from_tagia.py
with
24 additions
and
7 deletions
+24
-7
get_from_tagia.py
+
24
−
7
View file @
fcb9a97f
...
...
@@ -20,12 +20,29 @@ class Person():
self
.
bio
=
user
.
bio
self
.
role_name
=
member
.
role_name
[
0
],
def
get_users_from_taiga
(
host
,
username
,
password
,
project_slug
):
class
TaigaReader
(
):
'''
function for connecting to taiga at host, with username and password
and getting information about users from project by project_slug
object to read information from taiga
'''
api
=
TaigaAPI
(
host
=
host
)
api
.
auth
(
username
,
password
)
members
=
api
.
projects
.
get_by_slug
(
project_slug
).
list_memberships
()
return
[
Person
(
member
,
api
.
users
.
get
(
member
.
user
))
for
member
in
members
]
def
__init__
(
self
,
taiga_config
):
'''
Constructor to TaigaReader
'''
self
.
_api
=
TaigaAPI
(
host
=
taiga_config
[
'host'
])
self
.
_api
.
auth
(
taiga_config
[
'username'
],
taiga_config
[
'password'
])
def
create_person
(
self
,
member
):
'''
Create Person with member and request to getting information from user
'''
user
=
api
.
users
.
get
(
member
.
user
)
return
Person
(
member
,
user
)
def
get_persons
(
self
):
'''
function for connecting to taiga at host, with username and password
and getting information about users from project by project_slug
'''
members
=
api
.
projects
.
get_by_slug
(
project_slug
).
list_memberships
()
return
map
(
self
.
create_person
,
members
)
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets