Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
verktoy
PyMetric
Commits
9305c0de
Commit
9305c0de
authored
Nov 29, 2019
by
Runar Borge
Browse files
Try to keep python 2.7 compability until at least netBSD gets gtk2 support on python3
parent
634c0faa
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripting.py
View file @
9305c0de
from
__future__
import
print_function
import
os.path
import
sys
...
...
utils.py
View file @
9305c0de
import
networkx
as
nx
import
http.client
import
sys
if
(
sys
.
version_info
>
(
3
,
0
)):
import
http.client
as
httplib
else
:
import
httplib
def
reciprocity
(
G
):
"""Calculate reciprocity of graph, i.e. the ratio of the edges in
...
...
@@ -73,7 +77,7 @@ def cap2str(capacity):
def
read_linkloads
(
G
,
host
,
url
):
conn
=
http
.
client
.
HTTPConnection
(
host
)
conn
=
http
lib
.
HTTPConnection
(
host
)
conn
.
request
(
"GET"
,
url
)
r1
=
conn
.
getresponse
()
if
r1
.
status
!=
200
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment