Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
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
Container registry
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSCE 361
scripts
Commits
dd20cb6f
Commit
dd20cb6f
authored
5 years ago
by
Christopher Bohn
Browse files
Options
Downloads
Patches
Plain Diff
Added equality operators and blacklist/graylist compatibility checks.
parent
e2c73166
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
canvas_classes.py
+9
-0
9 additions, 0 deletions
canvas_classes.py
composite_user.py
+18
-0
18 additions, 0 deletions
composite_user.py
gitlab_classes.py
+9
-0
9 additions, 0 deletions
gitlab_classes.py
with
36 additions
and
0 deletions
canvas_classes.py
+
9
−
0
View file @
dd20cb6f
...
...
@@ -42,6 +42,15 @@ class CanvasUser:
username
=
self
.
get_username
()
return
f
'
@
{
username
}
'
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CanvasUser
):
return
self
.
get_username
()
==
other
.
get_username
()
else
:
return
False
def
__ne__
(
self
,
other
):
return
not
self
.
__eq__
(
other
)
"""
// A Canvas user, e.g. a student, teacher, administrator, observer, etc.
...
...
This diff is collapsed.
Click to expand it.
composite_user.py
+
18
−
0
View file @
dd20cb6f
...
...
@@ -48,12 +48,30 @@ class CompositeUser:
def
discard_team
(
self
):
self
.
candidate_teammates
=
None
def
has_blacklist
(
self
):
return
len
(
self
.
blacklist
)
>
0
def
is_blacklist_compatible
(
self
,
other
):
return
other
not
in
self
.
blacklist
def
is_graylist_compatible
(
self
,
other
):
return
other
not
in
self
.
graylist
def
__repr__
(
self
):
if
self
.
canvas_email
==
self
.
gitlab_email
:
return
f
'
{
self
.
readable_name
}
<
{
self
.
canvas_email
}
>
'
else
:
return
f
'
{
self
.
readable_name
}
<
{
self
.
canvas_email
}
> <
{
self
.
gitlab_email
}
>
'
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CompositeUser
):
return
self
.
canvas_username
()
==
other
.
canvas_username
()
else
:
return
False
def
__ne__
(
self
,
other
):
return
not
self
.
__eq__
(
other
)
@staticmethod
def
get_user
(
username_or_email
):
return
CompositeUser
.
instances
[
username_or_email
]
...
...
This diff is collapsed.
Click to expand it.
gitlab_classes.py
+
9
−
0
View file @
dd20cb6f
...
...
@@ -45,6 +45,15 @@ class GitlabUser:
username
=
self
.
get_username
()
return
f
'
@
{
username
}
'
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
GitlabUser
):
return
self
.
get_username
()
==
other
.
get_username
()
else
:
return
False
def
__ne__
(
self
,
other
):
return
not
self
.
__eq__
(
other
)
class
Issue
:
def
__init__
(
self
,
issue
):
...
...
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