Whitespace fixes

- strip trailing whitespace in several files
- fix some indentation (tabs vs. spaces)
This commit is contained in:
Lars Immisch
2023-05-30 14:26:56 +01:00
committed by Oswald Buddenhagen
parent f25c8243dc
commit c5153db0ac
4 changed files with 11 additions and 11 deletions

View File

@@ -196,8 +196,8 @@ get_pcmtype(PyObject *obj)
static bool is_value_volume_unit(long unit) static bool is_value_volume_unit(long unit)
{ {
if (unit == VOLUME_UNITS_PERCENTAGE || if (unit == VOLUME_UNITS_PERCENTAGE ||
unit == VOLUME_UNITS_RAW || unit == VOLUME_UNITS_RAW ||
unit == VOLUME_UNITS_DB) { unit == VOLUME_UNITS_DB) {
return true; return true;
} }
return false; return false;

View File

@@ -73,7 +73,7 @@ def show_mixer(name, kwargs):
volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB) volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB)
for i in range(len(volumes)): for i in range(len(volumes)):
print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0)) print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
try: try:
mutes = mixer.getmute() mutes = mixer.getmute()
for i in range(len(mutes)): for i in range(len(mutes)):
@@ -113,7 +113,7 @@ def set_mixer(name, args, kwargs):
mixer.setmute(1, channel) mixer.setmute(1, channel)
else: else:
mixer.setmute(0, channel) mixer.setmute(0, channel)
elif args in ['rec','unrec']: elif args in ['rec','unrec']:
# Enable/disable recording # Enable/disable recording
if args == 'rec': if args == 'rec':

View File

@@ -29,12 +29,12 @@ if __name__ == '__main__':
'License :: OSI Approved :: Python Software Foundation License', 'License :: OSI Approved :: Python Software Foundation License',
'Operating System :: POSIX :: Linux', 'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Sound/Audio :: Mixers', 'Topic :: Multimedia :: Sound/Audio :: Mixers',
'Topic :: Multimedia :: Sound/Audio :: Players', 'Topic :: Multimedia :: Sound/Audio :: Players',
'Topic :: Multimedia :: Sound/Audio :: Capture/Recording', 'Topic :: Multimedia :: Sound/Audio :: Capture/Recording',
], ],
ext_modules=[Extension('alsaaudio',['alsaaudio.c'], ext_modules=[Extension('alsaaudio',['alsaaudio.c'],
libraries=['asound'])] libraries=['asound'])]
) )

10
test.py
View File

@@ -20,7 +20,7 @@ PCMMethods = [
] ]
PCMDeprecatedMethods = [ PCMDeprecatedMethods = [
('setchannels', (2,)), ('setchannels', (2,)),
('setrate', (44100,)), ('setrate', (44100,)),
('setformat', (alsaaudio.PCM_FORMAT_S8,)), ('setformat', (alsaaudio.PCM_FORMAT_S8,)),
('setperiodsize', (320,)) ('setperiodsize', (320,))
@@ -49,10 +49,10 @@ class MixerTest(unittest.TestCase):
def testMixer(self): def testMixer(self):
"""Open the default Mixers and the Mixers on every card""" """Open the default Mixers and the Mixers on every card"""
for c in alsaaudio.card_indexes(): for c in alsaaudio.card_indexes():
mixers = alsaaudio.mixers(cardindex=c) mixers = alsaaudio.mixers(cardindex=c)
for m in mixers: for m in mixers:
mixer = alsaaudio.Mixer(m, cardindex=c) mixer = alsaaudio.Mixer(m, cardindex=c)
mixer.close() mixer.close()
@@ -73,7 +73,7 @@ class MixerTest(unittest.TestCase):
mixer.close() mixer.close()
def testMixerClose(self): 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""" error"""
mixers = alsaaudio.mixers() mixers = alsaaudio.mixers()
@@ -133,7 +133,7 @@ class PCMTest(unittest.TestCase):
pcm = alsaaudio.PCM(card='default') pcm = alsaaudio.PCM(card='default')
except alsaaudio.ALSAAudioError: except alsaaudio.ALSAAudioError:
pass pass
# Verify we got a DepreciationWarning # Verify we got a DepreciationWarning
self.assertEqual(len(w), 1, "PCM(card='default') expected a warning" ) self.assertEqual(len(w), 1, "PCM(card='default') expected a warning" )
self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "PCM(card='default') expected a DeprecationWarning") self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "PCM(card='default') expected a DeprecationWarning")