diff --git a/python-flask/swagger_server/controllers/user_controller.py b/python-flask/swagger_server/controllers/user_controller.py index 54fdf1e..3549319 100644 --- a/python-flask/swagger_server/controllers/user_controller.py +++ b/python-flask/swagger_server/controllers/user_controller.py @@ -4,6 +4,13 @@ from swagger_server.models.survey import Survey # noqa: E501 from swagger_server import util +from precisionmapper import PrecisionMapper +import os + +# Get useful environment variables +_LOGIN = os.environ.get('PRECISIONMAPPER_LOGIN', None) +_PASSWORD = os.environ.get('PRECISIONMAPPER_PASSWORD', None) + def list_surveys(): # noqa: E501 """list the surveys available @@ -13,4 +20,10 @@ def list_surveys(): # noqa: E501 :rtype: List[Survey] """ + pm = PrecisionMapper(login=_LOGIN, password=_PASSWORD) + pm.sign_in() + shared_surveys = pm.get_shared_surveys() + + for survey in shared_surveys: + print(survey) return 'do some magic!' diff --git a/setup.py b/setup.py index 2e0c5ea..9826362 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ __version__ = '0.0.1' # Should match with __init.py__ -_GITHUB_URL = 'https://github.com/tducret/precisionmapper-python', +_GITHUB_URL = 'https://github.com/tducret/precisionmapper-python' _KEYWORDS = ['api', 'precisionmapper', 'parsing', 'drone', 'platform', 'python-wrapper', 'scraping', 'scraper', 'parser', 'precisionhawk'] @@ -32,7 +32,7 @@ author="Thibault Ducret", author_email='hello@tducret.com', url=_GITHUB_URL, - download_url=_GITHUB_URL+"/tarball/"+__version__, + download_url='%s/tarball/%s' % (_GITHUB_URL, __version__), keywords=_KEYWORDS, setup_requires=requirements, install_requires=requirements, @@ -49,9 +49,7 @@ # ------------------------------------------ # Make sure everything was pushed (with a git status) # (or git commit --am "Comment" and git push) -# git tag 0.0.1 -m "First version" -# git push --tags +# export VERSION="0.0.1"; git tag $VERSION -m "First version"; git push --tags # If you need to delete a tag -# git push --delete origin VERSION -# git tag -d VERSION +# git push --delete origin $VERSION; git tag -d $VERSION