From c5153db0acb199b1382a970d12805e7706974413 Mon Sep 17 00:00:00 2001 From: Lars Immisch Date: Tue, 30 May 2023 14:26:56 +0100 Subject: [PATCH] Whitespace fixes - strip trailing whitespace in several files - fix some indentation (tabs vs. spaces) --- alsaaudio.c | 4 ++-- mixertest.py | 4 ++-- setup.py | 4 ++-- test.py | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/alsaaudio.c b/alsaaudio.c index a9bfc58..ca9466c 100644 --- a/alsaaudio.c +++ b/alsaaudio.c @@ -196,8 +196,8 @@ get_pcmtype(PyObject *obj) static bool is_value_volume_unit(long unit) { if (unit == VOLUME_UNITS_PERCENTAGE || - unit == VOLUME_UNITS_RAW || - unit == VOLUME_UNITS_DB) { + unit == VOLUME_UNITS_RAW || + unit == VOLUME_UNITS_DB) { return true; } return false; diff --git a/mixertest.py b/mixertest.py index 3dad561..d7fd7c7 100755 --- a/mixertest.py +++ b/mixertest.py @@ -73,7 +73,7 @@ def show_mixer(name, kwargs): volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB) for i in range(len(volumes)): print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0)) - + try: mutes = mixer.getmute() for i in range(len(mutes)): @@ -113,7 +113,7 @@ def set_mixer(name, args, kwargs): mixer.setmute(1, channel) else: mixer.setmute(0, channel) - + elif args in ['rec','unrec']: # Enable/disable recording if args == 'rec': diff --git a/setup.py b/setup.py index 05c77ea..6a34461 100755 --- a/setup.py +++ b/setup.py @@ -29,12 +29,12 @@ if __name__ == '__main__': 'License :: OSI Approved :: Python Software Foundation License', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3', 'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio :: Mixers', 'Topic :: Multimedia :: Sound/Audio :: Players', 'Topic :: Multimedia :: Sound/Audio :: Capture/Recording', ], - ext_modules=[Extension('alsaaudio',['alsaaudio.c'], + ext_modules=[Extension('alsaaudio',['alsaaudio.c'], libraries=['asound'])] ) diff --git a/test.py b/test.py index b8f987f..1a6858a 100755 --- a/test.py +++ b/test.py @@ -20,7 +20,7 @@ PCMMethods = [ ] PCMDeprecatedMethods = [ - ('setchannels', (2,)), + ('setchannels', (2,)), ('setrate', (44100,)), ('setformat', (alsaaudio.PCM_FORMAT_S8,)), ('setperiodsize', (320,)) @@ -49,10 +49,10 @@ class MixerTest(unittest.TestCase): def testMixer(self): """Open the default Mixers and the Mixers on every card""" - + for c in alsaaudio.card_indexes(): mixers = alsaaudio.mixers(cardindex=c) - + for m in mixers: mixer = alsaaudio.Mixer(m, cardindex=c) mixer.close() @@ -73,7 +73,7 @@ class MixerTest(unittest.TestCase): mixer.close() def testMixerClose(self): - """Run common Mixer methods on a closed object and verify it raises an + """Run common Mixer methods on a closed object and verify it raises an error""" mixers = alsaaudio.mixers() @@ -133,7 +133,7 @@ class PCMTest(unittest.TestCase): pcm = alsaaudio.PCM(card='default') except alsaaudio.ALSAAudioError: pass - + # Verify we got a DepreciationWarning self.assertEqual(len(w), 1, "PCM(card='default') expected a warning" ) self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "PCM(card='default') expected a DeprecationWarning")