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