mirror of
https://github.com/KevinMidboe/bulk-downloader-for-reddit.git
synced 2025-10-29 17:40:15 +00:00
Improved checkConflicts()
This commit is contained in:
14
script.py
14
script.py
@@ -184,9 +184,10 @@ def checkConflicts():
|
|||||||
else:
|
else:
|
||||||
user = 1
|
user = 1
|
||||||
|
|
||||||
|
search = 1 if GLOBAL.arguments.search else 0
|
||||||
|
|
||||||
modes = [
|
modes = [
|
||||||
"saved","subreddit","submitted","search","log","link","upvoted",
|
"saved","subreddit","submitted","log","link","upvoted","multireddit"
|
||||||
"multireddit"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
@@ -199,15 +200,18 @@ def checkConflicts():
|
|||||||
if not sum(values[x] for x in values) == 1:
|
if not sum(values[x] for x in values) == 1:
|
||||||
raise ProgramModeError("Invalid program mode")
|
raise ProgramModeError("Invalid program mode")
|
||||||
|
|
||||||
if values["search"]+values["saved"] == 2:
|
if search+values["saved"] == 2:
|
||||||
raise SearchModeError("You cannot search in your saved posts")
|
raise SearchModeError("You cannot search in your saved posts")
|
||||||
|
|
||||||
if values["search"]+values["submitted"] == 2:
|
if search+values["submitted"] == 2:
|
||||||
raise SearchModeError("You cannot search in submitted posts")
|
raise SearchModeError("You cannot search in submitted posts")
|
||||||
|
|
||||||
if values["search"]+values["upvoted"] == 2:
|
if search+values["upvoted"] == 2:
|
||||||
raise SearchModeError("You cannot search in upvoted posts")
|
raise SearchModeError("You cannot search in upvoted posts")
|
||||||
|
|
||||||
|
if search+values["log"] == 2:
|
||||||
|
raise SearchModeError("You cannot search in log files")
|
||||||
|
|
||||||
if values["upvoted"]+values["submitted"] == 1 and user == 0:
|
if values["upvoted"]+values["submitted"] == 1 and user == 0:
|
||||||
raise RedditorNameError("No redditor name given")
|
raise RedditorNameError("No redditor name given")
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ def getPosts(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if "search" in args:
|
if "search" in args:
|
||||||
if args["sort"] in ["hot","rising","controversial"]:
|
if GLOBAL.arguments.sort in ["hot","rising","controversial"]:
|
||||||
raise InvalidSortingType("Invalid sorting type has given")
|
raise InvalidSortingType("Invalid sorting type has given")
|
||||||
|
|
||||||
if "subreddit" in args:
|
if "subreddit" in args:
|
||||||
|
|||||||
Reference in New Issue
Block a user