From 6c610ac5a45a91006235c465d1c8d391b126e215 Mon Sep 17 00:00:00 2001 From: ryancox Date: Wed, 4 Aug 2010 03:35:26 -0700 Subject: [PATCH] licensing and setup --- .gitignore | 2 +- README.md | 7 ++++--- examples/munich.py | 44 -------------------------------------------- motionless.py | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 1 - 5 files changed, 42 insertions(+), 49 deletions(-) delete mode 100644 examples/munich.py diff --git a/.gitignore b/.gitignore index 8102ec1..6f97ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ build -.pyc +*.pyc diff --git a/README.md b/README.md index 351c75e..0aa6639 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -motionless is a Python library that takes the pain out of generating [Google Static Map](http://code.google.com/apis/maps/documentation/staticmaps/) URLs. Three map types are supported. Each is illustrated below. For fully worked code see the examples directory for code that parses and visualizes bot GeoRSS feeds and GPX files. +motionless is a Python library that takes the pain out of generating [Google Static Map](http://code.google.com/apis/maps/documentation/staticmaps/) URLs. Three map types are supported. Each is illustrated below. For fully worked code see the examples directory for code that parses and visualizes both GeoRSS feeds and GPX files. Code is licensed under Apache 2.0 @@ -7,8 +7,9 @@ For DecoratedMaps, paths are encoded if [gpolyencode](http://code.google.com/p/p If you have run into bugs, open a github issue. If you have questions, feel free to email me at ryan.a.cox@gmail.com --ryan - +-ryan +@ryancox +[www.asciiarmor.com](http://www.asciiarmor.com) CenterMap ========= diff --git a/examples/munich.py b/examples/munich.py deleted file mode 100644 index 7f7e3ca..0000000 --- a/examples/munich.py +++ /dev/null @@ -1,44 +0,0 @@ -from motionless import AddressMarker, LatLonMarker,DecoratedMap, CenterMap, VisibleMap -import xml.sax - -class GPXHandler(xml.sax.handler.ContentHandler): - - def __init__(self,gmap): - self.gmap = gmap - self.first = True - self.prev = None - - def startElement(self, name, attrs): - if name == 'trkpt': - self.gmap.add_path_latlon(attrs['lat'],attrs['lon']) - self.prev = (attrs['lat'],attrs['lon']) - if self.first: - self.first = False - self.gmap.add_marker(LatLonMarker(attrs['lat'],attrs['lon'],color='green',label='S')) - - def endElement(self,name): - if name == 'trk': - self.gmap.add_marker(LatLonMarker(self.prev[0],self.prev[1],color='red',label='E')) - -munich = DecoratedMap(size_x=640,size_y=640,pathweight=8,pathcolor='blue') -parser = xml.sax.make_parser() -parser.setContentHandler(GPXHandler(munich)) -parser.feed(open('Current.gpx').read()) - -htmlPage = """ - - -

Munich

-Trip from Schwabing (S) to Airport (E). Current.gpx file taken of my Garmin device and edited down to single track. -

-

- - - -""" % munich.generate_url() - - -html = open("munich.html","w") -html.write(htmlPage) -html.close() -print "munich.html file created" diff --git a/motionless.py b/motionless.py index 7c9d0cb..bac416f 100644 --- a/motionless.py +++ b/motionless.py @@ -1,6 +1,43 @@ from urllib import quote import re +""" + motionless is a library that takes the pain out of generating Google Static Map URLs. + + For example code and documentation see: + http://github.com/ryancox/motionless + + For details about the GoogleStatic Map API see: + http://code.google.com/apis/maps/documentation/staticmaps/ + + If you encounter problems, log an issue on github. If you have questions, drop me an + email at ryan.a.cox@gmail.com. + +""" + +""" + + Copyright 2010 Ryan A Cox - ryan.a.cox@gmail.com + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +""" + + + +__author__ = "Ryan Cox " +__version__ = "1.0" + class Color(object): COLORS = ['black', 'brown', 'green', 'purple', 'yellow', 'blue', 'gray', 'orange', 'red', 'white'] pat = re.compile("0x[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8}") diff --git a/setup.py b/setup.py index 563d658..64c9f7d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ author = 'Ryan Cox', author_email = 'ryan.a.cox@gmail.com', description = 'An easy way to generate Google Static Map URLs with Python.', - long_description = open("README.md").read(), license = 'Apache 2.0 License', url = 'http://github.com/ryancox/motionless', keywords = 'google static maps url api georss mapping gpx kml geo gis',