Skip to content

Commit

Permalink
Remove u string prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
verhovsky committed Jan 20, 2025
1 parent 16aeb18 commit 48014e5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ Check the [examples directory](https://github.com/metaodi/osmapi/tree/develop/ex
>>> import osmapi
>>> api = osmapi.OsmApi()
>>> print(api.NodeGet(123))
{u'changeset': 532907, u'uid': 14298,
u'timestamp': u'2007-09-29T09:19:17Z',
u'lon': 10.790009299999999, u'visible': True,
u'version': 1, u'user': u'Mede',
u'lat': 59.9503044, u'tag': {}, u'id': 123}
{'changeset': 532907, 'uid': 14298,
'timestamp': '2007-09-29T09:19:17Z',
'lon': 10.790009299999999, 'visible': True,
'version': 1, 'user': 'Mede',
'lat': 59.9503044, 'tag': {}, 'id': 123}
```

### Write to OpenStreetMap

```python
>>> import osmapi
>>> api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org", username = u"metaodi", password = u"*******")
>>> api.ChangesetCreate({u"comment": u"My first test"})
>>> print(api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}}))
{u'changeset': 532907, u'lon': 1, u'version': 1, u'lat': 1, u'tag': {}, u'id': 164684}
>>> api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org", username = "metaodi", password = "*******")
>>> api.ChangesetCreate({"comment": "My first test"})
>>> print(api.NodeCreate({"lon":1, "lat":1, "tag": {}}))
{'changeset': 532907, 'lon': 1, 'version': 1, 'lat': 1, 'tag': {}, 'id': 164684}
>>> api.ChangesetClose()
```

Expand Down
2 changes: 1 addition & 1 deletion docs/osmapi/OsmApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -6500,7 +6500,7 @@ <h2 id="notes">Notes:</h2>

with <a href="../osmapi.html#Changeset">osmapi.Changeset</a>({"comment": "Import script XYZ"}) as changeset_id:
print(f"Part of changeset {changeset_id}")
api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}})
api.NodeCreate({"lon":1, "lat":1, "tag": {}})
</code></pre>

<p>If <code>ChangesetTags</code> are given, this tags are applied (key/value).</p>
Expand Down
2 changes: 1 addition & 1 deletion osmapi/OsmApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ def Changeset(self, ChangesetTags={}):
with osmapi.Changeset({"comment": "Import script XYZ"}) as changeset_id:
print(f"Part of changeset {changeset_id}")
api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}})
api.NodeCreate({"lon":1, "lat":1, "tag": {}})
If `ChangesetTags` are given, this tags are applied (key/value).
Expand Down
24 changes: 12 additions & 12 deletions tests/fixtures/test_NoteCreate_wo_auth.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
</note>
</osm>

{u'comments': [{u'action': u'opened',
u'date': u'2014-10-03 16:09:12 UTC',
u'html': u'<p>This is an unauthenticated test</p>',
u'text': u'This is an unauthenticated test',
u'uid': None,
u'user': None}],
u'date_closed': None,
u'date_created': u'2014-10-03 16:09:11 UTC',
u'id': u'824',
u'lat': 47.123,
u'lon': 8.432,
u'status': u'open'}
{'comments': [{'action': 'opened',
'date': '2014-10-03 16:09:12 UTC',
'html': '<p>This is an unauthenticated test</p>',
'text': 'This is an unauthenticated test',
'uid': None,
'user': None}],
'date_closed': None,
'date_created': '2014-10-03 16:09:11 UTC',
'id': '824',
'lat': 47.123,
'lon': 8.432,
'status': 'open'}

0 comments on commit 48014e5

Please sign in to comment.