diff --git a/README.md b/README.md index aaacc59..74886b6 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,9 @@ __photo-to-kml__ creates a kml file that shows geotagged images in Google Earth. ## Installation ## -``` -pip install simplekml -``` - -Then - ``` git clone http://git.wrl.unsw.edu.au:3000/gis-cad/photo-to-kml.git -cd photo-to-kml -python setup.py install +pip install -e photo-to-kml ``` ## Usage ## diff --git a/photo_to_kml/__init__.py b/photo_to_kml/__init__.py index 728a446..dc430ea 100644 --- a/photo_to_kml/__init__.py +++ b/photo_to_kml/__init__.py @@ -1 +1 @@ -from .photo_to_kml import main +from .photo_to_kml import main diff --git a/photo_to_kml/photo_to_kml.py b/photo_to_kml/photo_to_kml.py index 27fa03c..c2f0d1e 100644 --- a/photo_to_kml/photo_to_kml.py +++ b/photo_to_kml/photo_to_kml.py @@ -20,6 +20,7 @@ Create a kml for a folder of photos, named 'image_folder'. """ import os +import sys import argparse from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS @@ -138,6 +139,12 @@ def main(): metavar='IMAGE_FOLDER', help='name of input folder', default=None) + + # Print usage if no arguments are provided + if len(sys.argv) == 1: + parser.print_help(sys.stderr) + sys.exit(1) + args = parser.parse_args() # Get files in image directory diff --git a/setup.py b/setup.py index 91f112c..ccf4214 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,11 @@ -from setuptools import setup - -setup( - name='photo_to_kml', - version='0.2.0', - packages=['photo_to_kml'], - entry_points={'console_scripts':['photo_to_kml = photo_to_kml:main']}, - author='Dan Howe', - author_email='d.howe@wrl.unsw.edu.au', - description='Add geotagged images to a kml for viewing in Google Earth') +from setuptools import setup + +setup( + name='photo_to_kml', + version='0.2.0', + packages=['photo_to_kml', 'PIL'], + install_requires=['simplekml'], + entry_points={'console_scripts':['photo_to_kml = photo_to_kml:main']}, + author='Dan Howe', + author_email='d.howe@wrl.unsw.edu.au', + description='Add geotagged images to a kml for viewing in Google Earth')