Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Python Briar Wrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
briar
Python Briar Wrapper
Merge requests
!12
Support deleting contacts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Support deleting contacts
16-delete-contact
into
main
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Nico
requested to merge
16-delete-contact
into
main
4 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
Fixes
#16 (closed)
0
0
Merge request reports
Viewing commit
df60279f
Show latest version
2 files
+
24
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
df60279f
Support deleting contacts
· df60279f
Nico
authored
4 years ago
Fixes
#16
briar_wrapper/models/contacts.py
+
14
−
0
Options
@@ -8,6 +8,7 @@ Wrapper around Briar API's _/contacts/_ resource
from
operator
import
itemgetter
from
urllib.parse
import
urljoin
from
requests
import
delete
as
_delete
from
requests
import
get
as
_get
from
requests
import
post
as
_post
@@ -35,6 +36,19 @@ class Contacts(Model):
url
=
urljoin
(
BASE_HTTP_URL
,
self
.
_API_ENDPOINT
+
"
add/pending/
"
)
_post
(
url
,
headers
=
self
.
_headers
,
json
=
{
"
link
"
:
link
,
"
alias
"
:
alias
})
def
delete
(
self
,
contact_id
):
# pylint: disable=line-too-long
"""
Deletes the contact with `contact_id`
[Upstream documentation](https://code.briarproject.org/briar/briar/blob/master/briar-headless/README.md#removing-a-contact)
.. versionadded:: 0.0.4
"""
url
=
urljoin
(
BASE_HTTP_URL
,
self
.
_API_ENDPOINT
+
str
(
contact_id
))
_delete
(
url
,
headers
=
self
.
_headers
)
def
get
(
self
):
# pylint: disable=line-too-long
"""
Loading