diff --git a/pygeoapi/provider/csv_.py b/pygeoapi/provider/csv_.py index c2c08ba..448eab4 100644 --- a/pygeoapi/provider/csv_.py +++ b/pygeoapi/provider/csv_.py @@ -77,7 +77,7 @@ class CSVProvider(BaseProvider): LOGGER.debug('Serializing DictReader') data_ = csv.DictReader(ff) if resulttype == 'hits': - LOGGER('Returning hits only') + LOGGER.debug('Returning hits only') feature_collection['numberMatched'] = len(list(data_)) return feature_collection LOGGER.debug('Slicing CSV rows') diff --git a/setup.py b/setup.py index 340b292..e29b3c5 100644 --- a/setup.py +++ b/setup.py @@ -31,9 +31,49 @@ import io import os import re from setuptools import Command, find_packages, setup +import shutil import sys +class PyCleanBuild(Command): + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + remove_files = [ + 'debian/files', + 'debian/python-pygeoapi.debhelper.log', + 'debian/python-pygeoapi.postinst.debhelper', + 'debian/python-pygeoapi.prerm.debhelper', + 'debian/python-pygeoapi.substvars' + ] + + remove_dirs = [ + 'debian/python-pygeoapi' + ] + + for file_ in remove_files: + try: + os.remove(file_) + except OSError: + pass + + for dir_ in remove_dirs: + try: + shutil.rmtree(dir_) + except OSError: + pass + + for file_ in os.listdir('..'): + if file_.endswith(('.deb', '.build', '.changes')): + os.remove('../{}'.format(file_)) + + class PyTest(Command): user_options = [] @@ -134,5 +174,9 @@ setup( 'Programming Language :: Python', 'Topic :: Scientific/Engineering :: GIS' ], - cmdclass={'test': PyTest, 'coverage': PyTest} + cmdclass={ + 'test': PyTest, + 'coverage': PyCoverage, + 'cleanbuild': PyCleanBuild + } )