Skip to content

Commit 7333d33

Browse files
committed
fixed issue #18, #16, #15, #14
1 parent 15a2fd0 commit 7333d33

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
# built documents.
6464
#
6565
# The short X.Y version.
66-
version = '0.2.5'
66+
version = '0.2.6'
6767
# The full version, including alpha/beta/rc tags.
68-
release = '0.2.5'
68+
release = '0.2.6'
6969

7070
# The language for content autogenerated by Sphinx. Refer to documentation
7171
# for a list of supported languages.

docs/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ Indices and tables
2424

2525
* :ref:`genindex`
2626

27-
.. todo::
28-
* Kunne hente objekt og egenskap basert på navn.
29-
* Bygge inn støttet for datafangst
30-
* Mulighet for å jobbe med vegnett. (Mulig dette ikke kommer før api'et er oppdatert til versjon 3.)
31-
3227
`Link to pnvdb on Github <https://github.com/Acurus/pnvdb>`_
3328

3429

pnvdb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060
>>> print(egenskap['verdi'])
6161
"""
6262
from .les import Nvdb
63-
__version__ = '0.2.5'
63+
__version__ = '0.2.6'

pnvdb/models/objekt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def vegreferanser(self):
172172
vegreferanser = None
173173
return vegreferanser
174174
@property
175-
def stedfestinger(self):
175+
def vegsegmenter(self):
176176
"""
177177
:Attribute type: list of dict
178178
:keys: []
@@ -182,4 +182,4 @@ def stedfestinger(self):
182182
self.data = _fetch_data(self.nvdb, 'vegobjekter/{}/{}'
183183
.format(self.objekt_type, self.nvdb_id),
184184
payload={'inkludergeometri':'utledet'})
185-
return data['stedfestinger']
185+
return self.data['vegsegmenter']

pnvdb/models/objekt_type.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,11 @@ def foreldre(self):
125125
self.data = _fetch_data(self.nvdb, 'vegobjekttyper/{}'.format(self.objekt_type))
126126
realasjoner = self.data['relasjonstyper']
127127
return [ObjektType(self.nvdb, i['type']['id']) for i in realasjoner['foreldre']]
128+
129+
def i_objekt_lista(self):
130+
if not self.data:
131+
self.data = _fetch_data(self.nvdb, 'vegobjekttyper/{}'.format(self.objekt_type))
132+
if 'objektliste_dato' in self.data:
133+
return True
134+
else:
135+
return False

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
setup(
1717
name='pnvdb',
1818

19-
version='0.2.5',
19+
version='0.2.6',
2020

2121
description='A python wrapper for the NVDB REST API',
2222
long_description=long_description,

test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
mport pprint
1+
import pprint
22
import pnvdb
33

44
pp = pprint.PrettyPrinter(indent=2)
55

66
nvdb = pnvdb.Nvdb(client='pnvdb', contact='jankyr@vegvesen.no')
77

8-
pp.pprint(nvdb.status())
8+
#pp.pprint(nvdb.status())
9+
910
#pos = nvdb.posisjon(x_coordinate=269815,y_coordinate=7038165)
1011
#pp.pprint(pos.vegreferanse)
1112
#vegref_point = nvdb.vegreferanse('5000Ev6hp12m1000')
@@ -55,6 +56,7 @@
5556
#
5657
#
5758
#objekttype = nvdb.objekt_type(470)
59+
#pp.pprint(obj.i_objekt_lista())
5860
#pp.pprint(objekttype)
5961
#pp.pprint(objekttype.barn)
6062
#pp.pprint(objekttype.foreldre)

0 commit comments

Comments
 (0)