Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
clients
python
DuniterPy
Commits
8207347e
Commit
8207347e
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#139
: Rename ConnectionHandler.{server,address}
parent
f86e281c
No related branches found
No related tags found
2 merge requests
!157
v1.0.0rc0: merge dev into master
,
!149
#139: Endpoints: renamings
Pipeline
#13067
waiting for manual action
Stage: checks
Stage: tests
Stage: release
Changes
2
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
duniterpy/api/client.py
+6
-6
6 additions, 6 deletions
duniterpy/api/client.py
duniterpy/api/endpoint.py
+5
-5
5 additions, 5 deletions
duniterpy/api/endpoint.py
with
11 additions
and
11 deletions
duniterpy/api/client.py
+
6
−
6
View file @
8207347e
...
@@ -189,17 +189,17 @@ class API:
...
@@ -189,17 +189,17 @@ class API:
# remove starting slash in path if present
# remove starting slash in path if present
path
=
path
.
lstrip
(
"
/
"
)
path
=
path
.
lstrip
(
"
/
"
)
server
,
port
=
self
.
connection_handler
.
server
,
self
.
connection_handler
.
port
address
,
port
=
self
.
connection_handler
.
address
,
self
.
connection_handler
.
port
if
self
.
connection_handler
.
path
:
if
self
.
connection_handler
.
path
:
url
=
"
{scheme}://{
server
}:{port}/{api_path}
"
.
format
(
url
=
"
{scheme}://{
address
}:{port}/{api_path}
"
.
format
(
scheme
=
scheme
,
scheme
=
scheme
,
server
=
server
,
address
=
address
,
port
=
port
,
port
=
port
,
api_path
=
self
.
connection_handler
.
path
,
api_path
=
self
.
connection_handler
.
path
,
)
)
else
:
else
:
url
=
"
{scheme}://{
server
}:{port}
"
.
format
(
url
=
"
{scheme}://{
address
}:{port}
"
.
format
(
scheme
=
scheme
,
server
=
server
,
port
=
port
scheme
=
scheme
,
address
=
address
,
port
=
port
)
)
if
len
(
path
.
strip
())
>
0
:
if
len
(
path
.
strip
())
>
0
:
...
@@ -332,7 +332,7 @@ class Client:
...
@@ -332,7 +332,7 @@ class Client:
Init Client instance
Init Client instance
:param _endpoint: Endpoint string in duniter format
:param _endpoint: Endpoint string in duniter format
:param proxy: Proxy
server
as hostname:port (optional, default None)
:param proxy: Proxy
address
as hostname:port (optional, default None)
"""
"""
if
isinstance
(
_endpoint
,
str
):
if
isinstance
(
_endpoint
,
str
):
# Endpoint Protocol detection
# Endpoint Protocol detection
...
...
This diff is collapsed.
Click to expand it.
duniterpy/api/endpoint.py
+
5
−
5
View file @
8207347e
...
@@ -23,13 +23,13 @@ from ..documents import MalformedDocumentError
...
@@ -23,13 +23,13 @@ from ..documents import MalformedDocumentError
class
ConnectionHandler
:
class
ConnectionHandler
:
"""
Helper class used by other API classes to ease passing
server
connection information.
"""
"""
Helper class used by other API classes to ease passing
address
connection information.
"""
def
__init__
(
def
__init__
(
self
,
self
,
http_scheme
:
str
,
http_scheme
:
str
,
ws_scheme
:
str
,
ws_scheme
:
str
,
server
:
str
,
address
:
str
,
port
:
int
,
port
:
int
,
path
:
str
,
path
:
str
,
proxy
:
Optional
[
str
]
=
None
,
proxy
:
Optional
[
str
]
=
None
,
...
@@ -39,20 +39,20 @@ class ConnectionHandler:
...
@@ -39,20 +39,20 @@ class ConnectionHandler:
:param http_scheme: Http scheme
:param http_scheme: Http scheme
:param ws_scheme: Web socket scheme
:param ws_scheme: Web socket scheme
:param
server: Server IP or domain name
:param
address: Domain name, IPv6, or IPv4 address
:param port: Port number
:param port: Port number
:param port: Url path
:param port: Url path
:param proxy: Proxy (optional, default=None)
:param proxy: Proxy (optional, default=None)
"""
"""
self
.
http_scheme
=
http_scheme
self
.
http_scheme
=
http_scheme
self
.
ws_scheme
=
ws_scheme
self
.
ws_scheme
=
ws_scheme
self
.
server
=
server
self
.
address
=
address
self
.
port
=
port
self
.
port
=
port
self
.
path
=
path
self
.
path
=
path
self
.
proxy
=
proxy
self
.
proxy
=
proxy
def
__str__
(
self
)
->
str
:
def
__str__
(
self
)
->
str
:
return
"
connection info: %s:%d
"
%
(
self
.
server
,
self
.
port
)
return
"
connection info: %s:%d
"
%
(
self
.
address
,
self
.
port
)
# required to type hint cls in classmethod
# required to type hint cls in classmethod
...
...
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