Skip to content

Commit e179c09

Browse files
committed
Revert "Add --config option for explicitly stating configuration file to use."
This reverts commit 37a3d83.
1 parent 975b275 commit e179c09

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,6 @@ Example usage: **`--downloaded-posts D:\bdfr\ALL_POSTS.txt`**
186186

187187
## **`--downloaded-delay`**
188188
When specified, it delays every download for given seconds.
189-
190-
191-
## **`--config`**
192-
Specify a `config.json` file to use. This will disable reading from the default `Bulk downloader for reddit/config.json` file, as well as `--use-local-config` option.
193-
194-
Example usage: **`--config /etc/bdfr/config.json`**
195-
Example usage: **`-c ~/config.json`**
196-
Example usage: **`--config c:\Users\Me\Downloads\config.json`**
197-
Example usage: **`-c c:\config.json`**
198189

199190
## ❔ FAQ
200191

script.py

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -269,33 +269,26 @@ def printLogo():
269269
)
270270

271271
def main():
272-
273-
sys.argv = sys.argv + GLOBAL.config["options"].split()
274-
arguments = Arguments.parse()
275-
GLOBAL.arguments = arguments
276272

277-
if arguments.config:
278-
if arguments.use_local_config:
279-
sys.exit()
280-
if Path(arguments.config).exists():
281-
GLOBAL.configDirectory = Path(arguments.config)
282-
else:
283-
VanillaPrint("custom config",arguments.config,"not found. Exiting.")
284-
sys.exit()
273+
if not Path(GLOBAL.defaultConfigDirectory).is_dir():
274+
os.makedirs(GLOBAL.defaultConfigDirectory)
275+
276+
if Path("config.json").exists():
277+
GLOBAL.configDirectory = Path("config.json")
285278
else:
286-
if Path("config.json").exists():
287-
GLOBAL.configDirectory = Path("config.json")
288-
else:
289-
if not Path(GLOBAL.defaultConfigDirectory).is_dir():
290-
os.makedirs(GLOBAL.defaultConfigDirectory)
291-
GLOBAL.configDirectory = GLOBAL.defaultConfigDirectory / "config.json"
279+
GLOBAL.configDirectory = GLOBAL.defaultConfigDirectory / "config.json"
292280
try:
293281
GLOBAL.config = Config(GLOBAL.configDirectory).generate()
294282
except InvalidJSONFile as exception:
295283
VanillaPrint(str(exception.__class__.__name__), ">>", str(exception))
296284
VanillaPrint("Resolve it or remove it to proceed")
297285
sys.exit()
298286

287+
sys.argv = sys.argv + GLOBAL.config["options"].split()
288+
289+
arguments = Arguments.parse()
290+
GLOBAL.arguments = arguments
291+
299292
if arguments.set_filename:
300293
Config(GLOBAL.configDirectory).setCustomFileName()
301294
sys.exit()
@@ -382,5 +375,5 @@ def main():
382375
exc_info=full_exc_info(sys.exc_info()))
383376
print(GLOBAL.log_stream.getvalue())
384377

385-
if not GLOBAL.arguments.quit:
386-
input("\nPress enter to quit\n")
378+
if not GLOBAL.arguments.quit: input("\nPress enter to quit\n")
379+

src/arguments.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,6 @@ def parse(arguments=None):
170170
type=int,
171171
help="Amount, in seconds, to delay before beginning the next item in the download queue")
172172

173-
parser.add_argument(
174-
"--config","-c",
175-
help="Specify exact config.json file to use. " \
176-
"Disables reading from 'Bulk downloader for " \
177-
"reddit/config.json' and --use-local-config " \
178-
"option.")
179173

180174
if arguments == []:
181175
return parser.parse_args()

0 commit comments

Comments
 (0)