return path + "/../"
def parse_args():
- argv = sys.argv[1:]
- sys.argv = sys.argv[:1]
+ argv = sys.argv[1 :]
+ sys.argv = sys.argv[: 1]
if "--" in argv:
index = argv.index("--")
- kivy_args = argv[index+1:]
- argv = argv[:index]
+ kivy_args = argv[index+1 :]
+ argv = argv[: index]
sys.argv.extend(kivy_args)
help="Print messages in console")
parser.add_argument("-m", "--builtin-mixing",
action="store_true",
- help="Make the mixing of sounds manually (do it if the system cannot handle it correctly)")
+ help="Make the mixing of sounds manually\
+ (do it if the system cannot handle it correctly)")
parser.add_argument("-l", "--latency",
default="high",
required=False,
default=0,
type=int,
required=False,
- help="Blocksize: If not 0, the numbe of frames to take at each step for the mixer")
+ help="Blocksize: If not 0, the number of frames to take\
+ at each step for the mixer")
parser.add_argument("-f", "--frame-rate",
default=44100,
type=int,
help="Sample width (number of bytes for each frame)")
parser.add_argument("-V", "--version",
action="version",
- help="Displays the current version and exits. Only use in bundled package",
+ help="Displays the current version and exits. Only use\
+ in bundled package",
version=show_version())
parser.add_argument("--device",
action=SelectDeviceAction,
)
parser.add_argument('--',
dest="args",
- help="Kivy arguments. All arguments after this are interpreted by Kivy. Pass \"-- --help\" to get Kivy's usage.")
+ help="Kivy arguments. All arguments after this are interpreted\
+ by Kivy. Pass \"-- --help\" to get Kivy's usage.")
from kivy.logger import Logger
Logger.setLevel(logging.ERROR)
else:
return "{}:{:0>2}".format(minutes, seconds)
-def gain(volume, old_volume = None):
+def gain(volume, old_volume=None):
if old_volume is None:
- return 20 * math.log10(volume / 100)
+ return 20 * math.log10(max(volume, 0.1) / 100)
else:
- return [20 * math.log10(max(volume, 0.1) / max(old_volume, 0.1)), max(volume, 0)]
+ return [
+ 20 * math.log10(max(volume, 0.1) / max(old_volume, 0.1)),
+ max(volume, 0)]
def debug_print(message):
from kivy.logger import Logger