update to python3
This commit is contained in:
parent
9a2b79cb60
commit
33ba6a6d33
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# Gatewayliste
|
# Gatewayliste
|
||||||
|
@ -36,4 +36,4 @@ db.import_wikigps("http://freifunk.metameute.de/Knoten")
|
||||||
|
|
||||||
m = GeoMapBuilder(db)
|
m = GeoMapBuilder(db)
|
||||||
|
|
||||||
print(m.build().encode("utf8"))
|
print(m.build())
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# Gatewayliste
|
# Gatewayliste
|
||||||
|
|
13
nodedb.py
13
nodedb.py
|
@ -3,18 +3,7 @@ from node import Node
|
||||||
from link import Link
|
from link import Link
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
||||||
# Python2/3 compatiblity hacks
|
|
||||||
try:
|
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
except ImportError:
|
|
||||||
from urllib import urlopen
|
|
||||||
|
|
||||||
try:
|
|
||||||
basestring
|
|
||||||
except NameError:
|
|
||||||
basestring = str
|
|
||||||
|
|
||||||
class NodeDB:
|
class NodeDB:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -170,7 +159,7 @@ class NodeDB:
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
def maybe_strip(x):
|
def maybe_strip(x):
|
||||||
if isinstance(x.string, basestring):
|
if isinstance(x.string, str):
|
||||||
return x.string.strip()
|
return x.string.strip()
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Reference in a new issue