INNER CODE UNIT · Python
ensure_local_setup
miztiik/AWS-Demos · how-to-examples/iam-s3-sqs-sns-video-transcoder.py:180
def ensure_local_setup(self):
"""
Ensures that the local directory setup is sane by making sure
that the directories exist and aren't the same.
"""
if self.unconverted_directory == self.converted_directory:
raise AutoTranscodeError(
"The unconverted & converted directories can not be the same."
)
if not os.path.exists(self.unconverted_directory):
os.makedirs(self.unconverted_directory)
else:
# If it's there, it may already have files in it, which may have
# already been processed. Keep these filenames & only process
# new ones.
self.existing_files = set(self.collect_files())