From 6a6017fd6b6f333140af3372060bed48ba0dd2ca Mon Sep 17 00:00:00 2001 From: kageru Date: Tue, 27 Mar 2018 17:26:57 +0200 Subject: [PATCH] fixed local folders not being created properly --- pyshare.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyshare.py b/pyshare.py index 27fa662..3ed4ae0 100755 --- a/pyshare.py +++ b/pyshare.py @@ -42,9 +42,6 @@ def get_date_folder(): def find_valid_filename(length, ext, conn): - full_path = get_local_full_path() - if not os.path.exists(full_path): - os.makedirs(full_path) filename = os.path.join(get_date_folder(), generate_filename(length=length, ext=ext)) i = 0 @@ -66,6 +63,9 @@ def upload_local_file(path: str, mode='file') -> str: def take_screenshot(edit=False) -> None: + full_path = get_local_full_path() + if not os.path.exists(full_path): + os.makedirs(full_path) tempname = generate_filename(config.length, 'png') file = os.path.join(get_local_full_path(), tempname) call(['maim', '-suk', file])