better doc strings

This commit is contained in:
Zen 2020-03-13 14:01:17 +02:00
parent 37577864f5
commit 2cec9794cf

View file

@ -29,9 +29,8 @@ if sys.version_info < (3, 7):
class Av1an:
def __init__(self):
"""
Av1an - AV1 wrapper for AV1 encoders
"""
"""Av1an - AV1 wrapper for AV1 encoders"""
self.temp_dir = Path('.temp')
self.FFMPEG = 'ffmpeg -y -hide_banner -loglevel error'
@ -52,10 +51,12 @@ class Av1an:
self.skip_scenes = False
def log(self, info):
"""Default logging function, write to file"""
with open(self.logging, 'a') as log:
log.write(time.strftime('%X') + ' ' + info)
def call_cmd(self, cmd, capture_output=False):
"""Calling system shell, if capture_ouput=True output string will be returned"""
if capture_output:
return subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
@ -63,8 +64,7 @@ class Av1an:
subprocess.run(cmd, shell=True, stdout=log, stderr=log)
def arg_parsing(self):
# Command line parse and assigning defined and user defined params
"""Command line parse and assigning defined and user defined params"""
parser = argparse.ArgumentParser()
parser.add_argument('--mode', '-m', type=int, default=self.mode, help='Mode 0 - video, Mode 1 - image')