Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
aab1235e
Commit
aab1235e
authored
7 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix open in browser with no bma
parent
81e808c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/gui/navigation/network/controller.py
+7
-4
7 additions, 4 deletions
src/sakia/gui/navigation/network/controller.py
with
7 additions
and
4 deletions
src/sakia/gui/navigation/network/controller.py
+
7
−
4
View file @
aab1235e
...
@@ -4,6 +4,7 @@ from PyQt5.QtWidgets import QAction, QMenu
...
@@ -4,6 +4,7 @@ from PyQt5.QtWidgets import QAction, QMenu
from
PyQt5.QtGui
import
QCursor
,
QDesktopServices
from
PyQt5.QtGui
import
QCursor
,
QDesktopServices
from
PyQt5.QtCore
import
pyqtSlot
,
QUrl
,
QObject
from
PyQt5.QtCore
import
pyqtSlot
,
QUrl
,
QObject
from
duniterpy.api
import
bma
from
duniterpy.api
import
bma
from
duniterpy.documents
import
BMAEndpoint
class
NetworkController
(
QObject
):
class
NetworkController
(
QObject
):
...
@@ -70,7 +71,9 @@ class NetworkController(QObject):
...
@@ -70,7 +71,9 @@ class NetworkController(QObject):
@pyqtSlot
()
@pyqtSlot
()
def
open_node_in_browser
(
self
):
def
open_node_in_browser
(
self
):
node
=
self
.
sender
().
data
()
node
=
self
.
sender
().
data
()
conn_handler
=
next
(
node
.
endpoints
[
0
].
conn_handler
())
bma_endpoints
=
[
e
for
e
in
node
.
endpoints
if
isinstance
(
e
,
BMAEndpoint
)]
peering_url
=
bma
.
API
(
conn_handler
,
bma
.
network
.
URL_PATH
).
reverse_url
(
conn_handler
.
http_scheme
,
'
/peering
'
)
if
bma_endpoints
:
url
=
QUrl
(
peering_url
)
conn_handler
=
next
(
bma_endpoints
[
0
].
conn_handler
())
QDesktopServices
.
openUrl
(
url
)
peering_url
=
bma
.
API
(
conn_handler
,
bma
.
network
.
URL_PATH
).
reverse_url
(
conn_handler
.
http_scheme
,
'
/peering
'
)
url
=
QUrl
(
peering_url
)
QDesktopServices
.
openUrl
(
url
)
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