mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
autopep8
This commit is contained in:
@@ -8,6 +8,7 @@ import json
|
||||
from enum import Enum
|
||||
from base64 import b64encode
|
||||
|
||||
|
||||
class MyJSONEncoder(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
if isinstance(o, Enum):
|
||||
@@ -57,7 +58,7 @@ def main():
|
||||
'run_date': datetime.datetime.now().isoformat(),
|
||||
'application': "wavinfo " + __version__,
|
||||
'scopes': {}
|
||||
}
|
||||
}
|
||||
for scope, name, value in this_file.walk():
|
||||
if scope not in ret_dict['scopes'].keys():
|
||||
ret_dict['scopes'][scope] = {}
|
||||
|
||||
@@ -16,6 +16,8 @@ from .wave_cues_reader import WavCuesReader
|
||||
from .wave_smpl_reader import WavSmplReader
|
||||
|
||||
#: Calculated statistics about the audio data.
|
||||
|
||||
|
||||
class WavDataDescriptor(NamedTuple):
|
||||
byte_count: int
|
||||
frame_count: int
|
||||
@@ -81,7 +83,7 @@ class WavInfoReader:
|
||||
#: RIFF cues markers, labels, and notes.
|
||||
self.cues: Optional[WavCuesReader] = None
|
||||
|
||||
#: Sampler `smpl` metadata
|
||||
#: Sampler `smpl` metadata
|
||||
self.smpl: Optional[WavSmplReader] = None
|
||||
|
||||
if hasattr(path, 'read'):
|
||||
|
||||
@@ -25,14 +25,14 @@ class WaveSmplLoop(NamedTuple):
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'ident': self.ident,
|
||||
'loop_type': self.loop_type,
|
||||
'loop_type_description': self.loop_type_desc(),
|
||||
'start_samples': self.start,
|
||||
'end_samples': self.end,
|
||||
'fraction': self.fraction,
|
||||
'repetition_count': self.repetition_count,
|
||||
}
|
||||
'ident': self.ident,
|
||||
'loop_type': self.loop_type,
|
||||
'loop_type_description': self.loop_type_desc(),
|
||||
'start_samples': self.start,
|
||||
'end_samples': self.end,
|
||||
'fraction': self.fraction,
|
||||
'repetition_count': self.repetition_count,
|
||||
}
|
||||
|
||||
|
||||
class WavSmplReader:
|
||||
@@ -99,13 +99,13 @@ class WavSmplReader:
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'manufactuer': self.manufacturer,
|
||||
'product': self.product,
|
||||
'sample_period_ns': self.sample_period_ns,
|
||||
'midi_note': self.midi_note,
|
||||
'midi_pitch_fraction_semis': self.midi_pitch_fraction_semis,
|
||||
'smpte_format': self.smpte_format,
|
||||
'smpte_offset': "%02i:%02i:%02i:%02i" % self.smpte_offset,
|
||||
'loops': [x.to_dict() for x in self.sample_loops],
|
||||
'sampler_user_data': self.sampler_udata,
|
||||
}
|
||||
'manufactuer': self.manufacturer,
|
||||
'product': self.product,
|
||||
'sample_period_ns': self.sample_period_ns,
|
||||
'midi_note': self.midi_note,
|
||||
'midi_pitch_fraction_semis': self.midi_pitch_fraction_semis,
|
||||
'smpte_format': self.smpte_format,
|
||||
'smpte_offset': "%02i:%02i:%02i:%02i" % self.smpte_offset,
|
||||
'loops': [x.to_dict() for x in self.sample_loops],
|
||||
'sampler_user_data': self.sampler_udata,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user