Re: [OSM-talk] Python API

2009-05-05 Thread Eddy Petrișor
Etienne Chové a scris:
 Etienne Chové a écrit :
 Dears,

 I wrote a python class to communicate with OSM API (read, write, 
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?
 
 This is now hosted on the main osm svn repositrory. I appologize for 
 people wanting it on an external repository but I prefer to put it on an 
 osm server.
 
 It's now at : http://svn.openstreetmap.org/applications/utils/python_lib/
 
 Thanks to Eddy Petrișor for some bugfix and ideas proposed on his 
 repository.

And I have a first bug fix, too. There is a spelling error in the code.

See attachment.

-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein
From 9a6233d0f5971feae07cc5f2f59567b9f4896dd7 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Eddy=20Petri=C8=99or?= eddy.petri...@gmail.com
Date: Mon, 4 May 2009 03:32:03 +0300
Subject: [PATCH] bugfix: fix spelling of 'Exception'

---
 OsmApi.py |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/OsmApi.py b/OsmApi.py
index 89f4924..05a86c9 100644
--- a/OsmApi.py
+++ b/OsmApi.py
@@ -133,7 +133,7 @@ class OsmApi:
 def WayUpdate(self, WayData):
  Updates way with WayData. Returns updated WayData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 WayData[uchangeset] = self._CurrentChangesetId
 result = self._put(/api/0.6/way/+str(WayData[uid]), self._XmlBuild(way, WayData))
 WayData[uversion] = int(result.strip())
@@ -143,7 +143,7 @@ class OsmApi:
 def WayDelete(self, WayData):
  Delete way with WayData. Returns updated WayData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 WayData[uchangeset] = self._CurrentChangesetId
 result = self._delete(/api/0.6/way/+str(WayData[uid]), self._XmlBuild(way, WayData))
 WayData[uversion] = int(result.strip())
@@ -154,7 +154,7 @@ class OsmApi:
 def WayCreate(self, WayData):
  Creates a way. Returns updated WayData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 WayData[uchangeset] = self._CurrentChangesetId
 result = self._put(/api/0.6/way/create, self._XmlBuild(way, WayData))
 WayData[uid]  = int(result.strip())
@@ -203,7 +203,7 @@ class OsmApi:
 def RelationUpdate(self, RelationData):
  Updates relation with RelationData. Returns updated RelationData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 RelationData[uchangeset] = self._CurrentChangesetId
 result = self._put(/api/0.6/relation/+str(RelationData[uid]), self._XmlBuild(relation, RelationData))
 RelationData[uversion] = int(result.strip())
@@ -213,7 +213,7 @@ class OsmApi:
 def RelationDelete(self, RelationData):
  Delete relation with RelationData. Returns updated RelationData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 RelationData[uchangeset] = self._CurrentChangesetId
 result = self._delete(/api/0.6/relation/+str(RelationData[uid]), self._XmlBuild(relation, RelationData))
 RelationData[uversion] = int(result.strip())
@@ -224,7 +224,7 @@ class OsmApi:
 def RelationCreate(self, RelationData):
  Creates a relation. Returns updated RelationData (without timestamp). 
 if self._CurrentChangesetId == -1:
-raise Execption, No changeset currently opened
+raise Exception, No changeset currently opened
 RelationData[uchangeset] = self._CurrentChangesetId
 result = self._put(/api/0.6/relation/create, self._XmlBuild(relation, RelationData))
 RelationData[uid]  = int(result.strip())
-- 
1.5.6.5



signature.asc
Description: OpenPGP digital signature
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-05-05 Thread Eddy Petrișor
Eddy Petrișor a scris:
 Etienne Chové a scris:
 Etienne Chové a écrit :
 Dears,

 I wrote a python class to communicate with OSM API (read, write, 
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?
 This is now hosted on the main osm svn repositrory. I appologize for 
 people wanting it on an external repository but I prefer to put it on an 
 osm server.

 It's now at : http://svn.openstreetmap.org/applications/utils/python_lib/

 Thanks to Eddy Petrișor for some bugfix and ideas proposed on his 
 repository.
 
 And I have a first bug fix, too. There is a spelling error in the code.

Which you seem to already have fixed :-D

BTW, it might be useful to have an ApiVersion method so that incompatible 
changes
like the the switch of parameter position in the Api can be signalled to 
users(apps)
and they don't break suddenly.

-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein



signature.asc
Description: OpenPGP digital signature
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-05-04 Thread Etienne Chové
Etienne Chové a écrit :
 Dears,
 
 I wrote a python class to communicate with OSM API (read, write, 
 update). For interested users, informations are here [1].
 
 May I put sources on the dev server ?

This is now hosted on the main osm svn repositrory. I appologize for 
people wanting it on an external repository but I prefer to put it on an 
osm server.

It's now at : http://svn.openstreetmap.org/applications/utils/python_lib/

Thanks to Eddy Petrișor for some bugfix and ideas proposed on his 
repository.

-- 
Etienne

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-30 Thread Etienne Chové
Etienne Chové a écrit :
 Dears,
 
 I wrote a python class to communicate with OSM API (read, write, 
 update). For interested users, informations are here [1].
 
 May I put sources on the dev server ?

Here it is :

http://osmose.openstreetmap.fr/src/modules/OsmApi.py

-- 
Etienne


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


[OSM-talk] Python API

2009-04-29 Thread Etienne Chové
Dears,

I wrote a python class to communicate with OSM API (read, write, 
update). For interested users, informations are here [1].

May I put sources on the dev server ?

-- 
Etienne

[1] http://wiki.openstreetmap.org/wiki/PythonOsmApi

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Shaun McDonald

On 29 Apr 2009, at 17:00, Etienne Chové wrote:

 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?


Wouldn't it be better to put them into SVN?

Shaun


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Etienne Chové
Shaun McDonald a écrit :
 
 On 29 Apr 2009, at 17:00, Etienne Chové wrote:
 
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?

 
 Wouldn't it be better to put them into SVN?

It's what I'd like to say ;-)

-- 
Etienne

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Thomas Wood
See also the osmparser.py class, that may also be useful.
http://trac.openstreetmap.org/browser/applications/editors/django/osmeditor/lib/osmparser.py

2009/4/29 Etienne Chové ch...@crans.org:
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?

 --
 Etienne

 [1] http://wiki.openstreetmap.org/wiki/PythonOsmApi

 ___
 talk mailing list
 talk@openstreetmap.org
 http://lists.openstreetmap.org/listinfo/talk




-- 
Regards,
Thomas Wood
(Edgemaster)

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Eddy Petrișor
2009/4/29 Etienne Chové ch...@crans.org:
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

COOL! I was thinking of writing such a class myself, but it's great
you did it :) .

 May I put sources on the dev server ?

May I suggest keeping it in a git repository so other people than the
ones with commit access to the openstreetmap svn can contribute?

I have used repo.or.cz which is a free service offered by Petr Baudis,
author of many improvements in the git user interface for the
osm-helpers improved code.

I am probably going to be one of your early adopters :-)

-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Thomas Wood
2009/4/29 Etienne Chové ch...@crans.org:
 Thomas Wood a écrit :

 See also the osmparser.py class, that may also be useful.

 http://trac.openstreetmap.org/browser/applications/editors/django/osmeditor/lib/osmparser.py

 Interesting... does it work with API 0.6 and changesets ? (see 0.5 inside).

Not yet, I was thinking of updating it, since the original author
doesn't seem to have...

-- 
Regards,
Thomas Wood
(Edgemaster)

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Etienne Chové
Eddy Petrișor a écrit :
 2009/4/29 Etienne Chové ch...@crans.org:
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].
 
 COOL! I was thinking of writing such a class myself, but it's great
 you did it :) .
 
 May I put sources on the dev server ?
 
 May I suggest keeping it in a git repository so other people than the
 ones with commit access to the openstreetmap svn can contribute?
 
 I have used repo.or.cz which is a free service offered by Petr Baudis,
 author of many improvements in the git user interface for the
 osm-helpers improved code.
 
 I am probably going to be one of your early adopters :-)

I can put it where ever people want it. I think svn.openstreetmap.org is 
the best. Where to ask to get svn account ?

-- 
Etienne

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Etienne Chové
Thomas Wood a écrit :
 See also the osmparser.py class, that may also be useful.
 http://trac.openstreetmap.org/browser/applications/editors/django/osmeditor/lib/osmparser.py

Interesting... does it work with API 0.6 and changesets ? (see 0.5 inside).

-- 
Etienne

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Eddy Petrișor
On Wed, Apr 29, 2009 at 7:37 PM, Etienne Chové ch...@crans.org wrote:
 Eddy Petrișor a écrit :

 2009/4/29 Etienne Chové ch...@crans.org:

 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 COOL! I was thinking of writing such a class myself, but it's great
 you did it :) .

 May I put sources on the dev server ?

 May I suggest keeping it in a git repository so other people than the
 ones with commit access to the openstreetmap svn can contribute?

 I have used repo.or.cz which is a free service offered by Petr Baudis,
 author of many improvements in the git user interface for the
 osm-helpers improved code.

 I am probably going to be one of your early adopters :-)

 I can put it where ever people want it. I think svn.openstreetmap.org is the
 best. Where to ask to get svn account ?

Well, that's the nice thing about git, you don't need to request
access from anyone.

See more information about the service provided by Petr:
http://repo.or.cz/about.html
More information about how to create the project and how to create a
user to be able to publish your changes is on pages linked from the
one above.

-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Eddy Petrișor
2009/4/29 Etienne Chové ch...@crans.org:
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 May I put sources on the dev server ?

 [1] http://wiki.openstreetmap.org/wiki/PythonOsmApi

BTW, under which license are publishing your changes? May I suggest
one of 'LGPL', 'GPL v2 or later' or 'GPL v3 or later'? I would be fine
with either of those, but I think LGPL would be the best choice for
such code as a library.


-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Thomas Wood
2009/4/29 Etienne Chové ch...@crans.org:
 Eddy Petrișor a écrit :
 2009/4/29 Etienne Chové ch...@crans.org:
 Dears,

 I wrote a python class to communicate with OSM API (read, write,
 update). For interested users, informations are here [1].

 COOL! I was thinking of writing such a class myself, but it's great
 you did it :) .

 May I put sources on the dev server ?

 May I suggest keeping it in a git repository so other people than the
 ones with commit access to the openstreetmap svn can contribute?

 I have used repo.or.cz which is a free service offered by Petr Baudis,
 author of many improvements in the git user interface for the
 osm-helpers improved code.

 I am probably going to be one of your early adopters :-)

 I can put it where ever people want it. I think svn.openstreetmap.org is
 the best. Where to ask to get svn account ?

The machine admin - TomH creates accounts for anyone who requires one.
(A few) more details on the wiki -
http://wiki.openstreetmap.org/wiki/SVN

-- 
Regards,
Thomas Wood
(Edgemaster)

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Etienne Chové
Eddy Petrișor a écrit :
 2009/4/29 Etienne Chové ch...@crans.org:
 [1] http://wiki.openstreetmap.org/wiki/PythonOsmApi
 
 BTW, under which license are publishing your changes? May I suggest
 one of 'LGPL', 'GPL v2 or later' or 'GPL v3 or later'? I would be fine
 with either of those, but I think LGPL would be the best choice for
 such code as a library.

Until now, all my publcations are GPLv3, and this one yet have it 
licence header. I don't know differences with LGPL.

-- 
Etienne


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Python API

2009-04-29 Thread Eddy Petrișor
On Wed, Apr 29, 2009 at 8:10 PM, Etienne Chové ch...@crans.org wrote:
 Eddy Petrișor a écrit :

 2009/4/29 Etienne Chové ch...@crans.org:

 [1] http://wiki.openstreetmap.org/wiki/PythonOsmApi

 BTW, under which license are publishing your changes? May I suggest
 one of 'LGPL', 'GPL v2 or later' or 'GPL v3 or later'? I would be fine
 with either of those, but I think LGPL would be the best choice for
 such code as a library.

 Until now, all my publcations are GPLv3, and this one yet have it licence
 header. I don't know differences with LGPL.

Basically LGPL allows building proprietary or non-GPLed apps linked
with LGPL libraries, but in the case of Python modules I am unsure if
that would really allow creating proprietary or non-GPLed apps since I
am unsure if an import counts as linking. Either way I am fine with
GPLv3, too.

If you don't feel too strong about it, you might want to add a or
later there to ease up possible future migrations to newer versions
of the license.

-- 
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk