From 94e2f90da41f6d1efb101605a2a1848cd999c518 Mon Sep 17 00:00:00 2001 From: Christian Muck Date: Sat, 11 Feb 2017 00:53:46 +0100 Subject: [PATCH] Applied PEP8 for Python files --- setup.py | 83 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 30 deletions(-) diff --git a/setup.py b/setup.py index d7b505ae2..6ffed1295 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,20 @@ #! python # -*- coding: UTF-8 -*- -from setuptools import setup -from setuptools.command.install import install -import subprocess import os +import subprocess import sys from distutils.spawn import find_executable +from setuptools import setup +from setuptools.command.install import install + package_name = 'osi' package_path = os.path.join(os.getcwd(), package_name) class GenerateProtobuf(install): + @staticmethod def find_protoc(): """Locates protoc executable""" @@ -23,22 +25,40 @@ def find_protoc(): protoc = find_executable('protoc') if protoc is None: - sys.stderr.write('protoc not found. Is protobuf-compiler installed? \n' - 'Alternatively, you can point the PROTOC environment variable at a local version.') + sys.stderr.write( + 'protoc not found. Is protobuf-compiler installed? \n' + 'Alternatively, you can point the PROTOC environment variable' + 'at a local version.') sys.exit(1) return protoc - osi_files = ('osi_common.proto', 'osi_datarecording.proto', 'osi_detectedlandmark.proto', - 'osi_detectedobject.proto', 'osi_detectedoccupant.proto', 'osi_detectedlane.proto', - 'osi_environment.proto', 'osi_groundtruth.proto', 'osi_landmark.proto', 'osi_lowleveldata.proto', - 'osi_modelinternal.proto', 'osi_object.proto', 'osi_occupant.proto', 'osi_lane.proto', - 'osi_sensordata.proto', 'osi_sensorspecific.proto') + osi_files = ( + 'osi_common.proto', + 'osi_datarecording.proto', + 'osi_detectedlandmark.proto', + 'osi_detectedobject.proto', + 'osi_detectedoccupant.proto', + 'osi_detectedlane.proto', + 'osi_environment.proto', + 'osi_groundtruth.proto', + 'osi_landmark.proto', + 'osi_lowleveldata.proto', + 'osi_modelinternal.proto', + 'osi_object.proto', + 'osi_occupant.proto', + 'osi_lane.proto', + 'osi_sensordata.proto', + 'osi_sensorspecific.proto') """ Generate Protobuf Messages """ + def run(self): for source in self.osi_files: sys.stdout.write('Protobuf-compiling ' + source + '\n') - subprocess.check_call([self.find_protoc(), '--proto_path=.', '--python_out='+package_path, './' + source]) + subprocess.check_call([self.find_protoc(), + '--proto_path=.', + '--python_out=' + package_path, + './' + source]) install.run(self) @@ -52,23 +72,26 @@ def run(self): except Exception: pass -setup(name='open-simulation-interface', - version='2.0.0', - description='A generic interface for the environmental perception of automated driving functions in virtual ' - 'scenarios.', - author='Carlo van Driesten, Timo Hanke, Nils Hirsenkorn, Pilar Garcia-Ramos, Mark Schiementz, ' - 'Sebastian Schneider', - author_email='Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de, Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,' - 'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de', - packages=[package_name], - install_requires=['protobuf'], - cmdclass={ +setup( + name='open-simulation-interface', + version='2.0.0', + description='A generic interface for the environmental perception of' + 'automated driving functions in virtual scenarios.', + author='Carlo van Driesten, Timo Hanke, Nils Hirsenkorn,' + 'Pilar Garcia-Ramos, Mark Schiementz, Sebastian Schneider', + author_email='Carlo.van-Driesten@bmw.de, Timo.Hanke@bmw.de,' + 'Nils.Hirsenkorn@tum.de, Pilar.Garcia-Ramos@bmw.de,' + 'Mark.Schiementz@bmw.de, Sebastian.SB.Schneider@bmw.de', + packages=[package_name], + install_requires=['protobuf'], + cmdclass={ 'install': GenerateProtobuf, - }, - url='https://github.com/OpenSimulationInterface/open-simulation-interface', - license="MPL 2.0", - classifiers=[ - 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', - ], - data_files=[("", ["LICENSE"])] -) + }, + url='https://github.com/OpenSimulationInterface/open-simulation-interface', + license="MPL 2.0", + classifiers=[ + 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', + ], + data_files=[ + ("", + ["LICENSE"])])