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