From e984feeb8dcba24c5e8b14a55bc1a2602eed2b83 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 3 Apr 2018 23:00:14 +0200 Subject: [PATCH 1/2] Would fail if the parent was not a directory. --- app/classedStray.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classedStray.py b/app/classedStray.py index 36e94ef..ba090ab 100755 --- a/app/classedStray.py +++ b/app/classedStray.py @@ -3,7 +3,7 @@ # @Author: KevinMidboe # @Date: 2017-04-05 18:40:11 # @Last Modified by: KevinMidboe -# @Last Modified time: 2017-06-18 21:49:33 +# @Last Modified time: 2018-04-03 22:58:20 import os.path, hashlib, time, glob, sqlite3, re, json, tweepy import logging from functools import reduce @@ -188,6 +188,9 @@ def XOR(list1, list2): return set(list1) ^ set(list2) def filterChildItems(parent): + if ! os.path.isdir(parent): + strayEpisode(parent[:-4], parent) + return try: children = getDirContent('/'.join([env.input_dir, parent])) if children: From 66a2a06f9b2767fcbe9bb93ae117de9bf5039892 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 3 Apr 2018 23:02:54 +0200 Subject: [PATCH 2/2] Compile error, if-statement. --- app/classedStray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classedStray.py b/app/classedStray.py index ba090ab..0d7e290 100755 --- a/app/classedStray.py +++ b/app/classedStray.py @@ -188,7 +188,7 @@ def XOR(list1, list2): return set(list1) ^ set(list2) def filterChildItems(parent): - if ! os.path.isdir(parent): + if (not os.path.isdir(parent)): strayEpisode(parent[:-4], parent) return try: